|
1 | 1 | import { existsSync, readFileSync } from "node:fs"; |
2 | 2 | import { extname, join } from "node:path"; |
3 | 3 | import { createAnthropicAdapter } from "./adapters/anthropic"; |
4 | | -import { createAnthropicSdkAdapter } from "./adapters/anthropic-sdk"; |
5 | 4 | import { createAzureAdapter } from "./adapters/azure"; |
6 | 5 | import { createGoogleAdapter } from "./adapters/google"; |
7 | 6 | import { createOpenAIChatAdapter } from "./adapters/openai-chat"; |
@@ -105,8 +104,6 @@ export function resolveAdapter(providerConfig: OcxProviderConfig) { |
105 | 104 | return createOpenAIChatAdapter(providerConfig); |
106 | 105 | case "anthropic": |
107 | 106 | return createAnthropicAdapter(providerConfig); |
108 | | - case "anthropic-sdk": |
109 | | - return createAnthropicSdkAdapter(providerConfig); |
110 | 107 | case "openai-responses": |
111 | 108 | return createResponsesPassthroughAdapter(providerConfig); |
112 | 109 | case "google": |
@@ -224,27 +221,6 @@ async function handleResponses( |
224 | 221 | const upstream = new AbortController(); |
225 | 222 | linkAbortSignal(upstream, options.abortSignal); |
226 | 223 |
|
227 | | - if (parsed.stream && adapter.executeStream) { |
228 | | - const eventStream = adapter.executeStream(parsed, upstream.signal); |
229 | | - const toolNsMap = new Map<string, { namespace: string; name: string }>(); |
230 | | - const freeformToolNames = new Set<string>(); |
231 | | - const toolSearchToolNames = new Set<string>(); |
232 | | - for (const t of parsed.context.tools ?? []) { |
233 | | - if (t.namespace) toolNsMap.set(namespacedToolName(t.namespace, t.name), { namespace: t.namespace, name: t.name }); |
234 | | - if (t.freeform) freeformToolNames.add(t.name); |
235 | | - if (t.toolSearch) toolSearchToolNames.add(t.name); |
236 | | - } |
237 | | - const sseStream = bridgeToResponsesSSE( |
238 | | - eventStream, parsed.modelId, toolNsMap, freeformToolNames, toolSearchToolNames, |
239 | | - () => upstream.abort(), 2_000, |
240 | | - options.forceEmptyResponseId ? { responseId: "" } : undefined, |
241 | | - ); |
242 | | - return new Response(sseStream, { |
243 | | - headers: { "Content-Type": "text/event-stream", "Cache-Control": "no-cache", "Connection": "keep-alive", "X-Accel-Buffering": "no" }, |
244 | | - }); |
245 | | - } |
246 | | - |
247 | | - // Fallback: buildRequest → fetch → parseStream (used by all non-SDK adapters and web-search sidecar) |
248 | 224 | const request = adapter.buildRequest(parsed, { headers: req.headers }); |
249 | 225 | let upstreamResponse: Response; |
250 | 226 | try { |
|
0 commit comments