import type { AIProviderName } from "../constants/enums.js"; import type { NeurolinkCredentials, OpenAICompatResponseFormat } from "../types/index.js"; import { OpenAIChatCompletionsProvider } from "./openaiChatCompletionsBase.js"; /** * DeepSeek Provider — direct HTTP, no AI SDK. * * OpenAI-compatible chat completions at api.deepseek.com (deepseek-chat / * deepseek-reasoner). All request/stream/tool-loop orchestration lives in * `OpenAIChatCompletionsProvider`; this class declares configuration and * provider-specific quirks: * * 1. Structured-output downgrade — DeepSeek rejects `response_format: * { type: "json_schema" }` ("This response_format type is unavailable * now"), so `adjustResponseFormat` downgrades it to `json_object` — * matching the `supportsStructuredOutputs: false` behaviour of the * `@ai-sdk/openai-compatible` path this migration replaced. The base * client injects the literal "json" word the API requires for that mode. * * 2. Reasoning support — `reasoning_content` (deepseek-reasoner / R1) is * surfaced automatically by the native base client: streamed deltas * arrive as `{ content: "", reasoning }` chunks and the non-streaming * result carries `result.reasoning`. The opt-in `thinking` request * param (non-reasoner chat models) still needs thinking-signal plumbing * and is tracked as a follow-up. All other behavior is preserved. * * @see https://api-docs.deepseek.com */ export declare class DeepSeekProvider extends OpenAIChatCompletionsProvider { constructor(modelName?: string, sdk?: unknown, _region?: string, credentials?: NeurolinkCredentials["deepseek"]); protected getProviderName(): AIProviderName; protected getDefaultModel(): string; protected formatProviderError(error: unknown): Error; protected getFallbackModelName(): string; protected getFallbackModels(): string[]; /** * DeepSeek's /chat/completions rejects `response_format: { type: * "json_schema" }` outright ("This response_format type is unavailable * now"). The `@ai-sdk/openai-compatible` provider this migration replaced * ran with `supportsStructuredOutputs: false`, which downgraded structured- * output requests to `{ type: "json_object" }`. Replicate that downgrade so * `generate({ schema })` keeps working. (DeepSeek's json_object mode also * requires the word "json" somewhere in the messages; the base client's * `ensureJsonWordInBody` injects a minimal instruction when the prompt * lacks it.) */ protected adjustResponseFormat(rf: OpenAICompatResponseFormat | undefined, _modelId: string): OpenAICompatResponseFormat | undefined; }