From 5de3955a3f7105b25c83f650686219951da4fe62 Mon Sep 17 00:00:00 2001 From: Alex Curley Date: Mon, 11 May 2026 23:14:06 -0400 Subject: [PATCH] Revert "Invoke file ID" This reverts commit c8ca68f13bec93d2ae5103509cd45db511b9b6f1. --- netlify/functions/agent-proxy.js | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) 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