unused hardcoded artifact id

This commit is contained in:
Ariel Weinberger
2025-07-17 11:08:36 -05:00
parent e8110ec9e3
commit c72c3aec59
3 changed files with 35 additions and 3 deletions
-2
View File
@@ -1,5 +1,3 @@
ANTHROPIC_API_KEY=
APPWRITE_ENDPOINT=http://localhost/v1
IMAGINE_PROJECT_ID=demo-project
IMAGINE_ARTIFACT_ID=demo-artifact
SYNAPSE_ENDPOINT=http://127.0.0.1:3010
-1
View File
@@ -1,2 +1 @@
export const OVERRIDE_BASE_DIR = `./tmp/workspace/artifact/${process.env.ARTIFACT_ID}`;
export const ANTHROPIC_MAX_CACHE_CONTROL_BLOCKS = 4; // Anthropic only allows 4 cache control blocks
+35
View File
@@ -0,0 +1,35 @@
import "dotenv/config";
import fs from 'fs';
import { convertToModelMessages, generateText, UIMessage } from 'ai';
import { anthropic } from '@ai-sdk/anthropic';
async function main() {
const loaded = fs.readFileSync('./tmp/messages-submitted-tool-result.json', 'utf-8');
const messages: UIMessage[] = JSON.parse(loaded);
messages.push({
id: "123",
role: "user",
parts: [
{
type: "text",
text: "What is the content of the src/App.tsx file?"
}
]
})
const converted = convertToModelMessages(messages);
// const loaded = fs.readFileSync('/Users/arielweinberger/Development/appwrite/appwrite-console/ai-service/tmp/messages-submitted-tool-result-converted.json', 'utf-8');
// const converted = JSON.parse(loaded);
const result = await generateText({
model: anthropic("claude-3-7-sonnet-20250219"),
messages: converted,
});
console.log(result.text);
}
main();