diff --git a/netlify/functions/agent-proxy.js b/netlify/functions/agent-proxy.js index 1566392..43a0a4a 100644 --- a/netlify/functions/agent-proxy.js +++ b/netlify/functions/agent-proxy.js @@ -72,17 +72,7 @@ export default async (req /*, context */) => { return new Response('Server is missing ANTHROPIC_API_KEY', { status: 500 }) } - const client = new Anthropic({ - apiKey: process.env.ANTHROPIC_API_KEY, - // Required while the Files API is in beta. - defaultHeaders: { 'anthropic-beta': 'files-api-2025-04-14' }, - }) - - // File uploaded to the Anthropic Console / Files API that the agent - // should consult on every call. - const KNOWLEDGE_FILE_ID = - process.env.ANTHROPIC_KNOWLEDGE_FILE_ID || - 'file_011Cawv1SPNaknuMmyDtM1S7' + const client = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY }) const userMessage = `Here is a new public media station intake: @@ -103,20 +93,7 @@ Please draft the funding outlook brief described in your instructions.` model: MODEL, max_tokens: 10000, system: SYSTEM_PROMPT, - messages: [ - { - role: 'user', - content: [ - { - type: 'document', - source: { type: 'file', file_id: KNOWLEDGE_FILE_ID }, - // Lets the model cite the doc in answers. - citations: { enabled: true }, - }, - { type: 'text', text: userMessage }, - ], - }, - ], + messages: [{ role: 'user', content: userMessage }], } if (AGENT_ID && AGENT_ID !== 'YOUR_AGENT_ID_HERE') { streamArgs.agent_id = AGENT_ID