mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
unused hardcoded artifact id
This commit is contained in:
@@ -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,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
|
||||
|
||||
@@ -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();
|
||||
Reference in New Issue
Block a user