/** * Back-compatibility shim for the legacy `anthropicApi` interface. * * All real work lives in `./llm.js`. Existing callers (extractionPipeline, * learningService, testService, KnowledgeGraph, useChat) keep working * unchanged; new code should import `callLLM` from `./llm.js` directly. */ import { callLLM } from './llm'; export const anthropicApi = { async generateContent(systemPrompt, userMessage /*, maxRetries */) { const { text } = await callLLM({ task: 'legacy.generateContent', tier: 'standard', system: systemPrompt, user: userMessage, maxTokens: 8192, temperature: 0, }); return text; }, async chat(systemPrompt, messages, opts = {}) { const r = await callLLM({ task: 'legacy.chat', tier: 'standard', system: systemPrompt, messages, tools: opts.tools, maxTokens: 1024, temperature: 0.3, }); const content = []; if (r.text) content.push({ type: 'text', text: r.text }); for (const tu of r.toolUses) content.push({ type: 'tool_use', name: tu.name, input: tu.input }); return { content, stop_reason: r.stopReason }; }, };