/** * @license * Copyright 2026 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ import type { DeepSeekModelConfig } from "./DeepSeek_ModelSchema"; /** * Default base URL for the DeepSeek OpenAI-compatible API. DeepSeek serves the * same routes with and without a `/v1` prefix; the un-prefixed form is what the * vendor documents, and it is what makes `client.models.list()` hit the * documented `GET /models` endpoint. */ export declare const DEEPSEEK_DEFAULT_BASE_URL = "https://api.deepseek.com"; /** * Hostnames (or hostname suffixes) accepted for DeepSeek `base_url` without the * explicit `trustedBaseUrl` opt-out. */ export declare const DEEPSEEK_ALLOWED_HOSTS: readonly string[]; type OpenAIClientClass = new (config: any) => any; export declare function loadOpenAISDK(): Promise; /** * Override the client returned by {@link getClient} so runtime tests can * exercise run-fns without a live SDK, API key, or network call. Pass * `undefined` to restore normal SDK-backed creation. */ declare function setDeepSeekClientForTests(client: unknown): void; /** * @internal Symbols exported only for use by `@workglow/test`. Not part of the * stable public API. Surfaced on the `ai-runtime` barrel (via `export *`) and * merged into the `/ai` barrel's `_testOnly`. */ export declare const _testOnly: { readonly setDeepSeekClientForTests: typeof setDeepSeekClientForTests; }; export declare function getClient(model: DeepSeekModelConfig | undefined): Promise; export declare function getModelName(model: DeepSeekModelConfig | undefined): string; /** * The request fields that carry `model.effort` to DeepSeek. Without them the * effort a caller set only sized `max_tokens`, and the model reasoned at its own * default whatever was asked. Nothing is sent for a model whose policy has no * reasoning, or when no effort is set. */ export declare function reasoningParams(model: DeepSeekModelConfig | undefined): { reasoning_effort?: string; thinking?: { type: "disabled"; }; }; /** * Reasoning headroom added when the model sets no `reasoning_allowance`. Sized * above the ~4k reasoning tokens the thinking models typically spend. */ export declare const DEEPSEEK_DEFAULT_REASONING_ALLOWANCE = 16384; /** * Turns the caller's answer-token budget into DeepSeek's `max_tokens`. Thinking * models bill `reasoning_tokens` against the same budget, so the wire value has * to cover both. Native `reasoning_allowance` wins over `model.effort`; when * neither is set the shared default allowance applies — but only to a model the * policy says reasons at all. Both branches read the one policy: paying the * default allowance on a model it has just declared has no reasoning spends a * whole extra `max_tokens` budget on tokens that are never generated. * Undefined budget stays undefined, leaving DeepSeek's default. */ export declare function resolveMaxTokens(model: DeepSeekModelConfig | undefined, maxTokens: number | undefined): number | undefined; /** * Throws when the budget ran out before any content was emitted — otherwise the * empty string parses to `{}` and surfaces as a confusing schema error. A * truncated-but-non-empty response is left alone; the partial is worth keeping. */ export declare function assertNotTruncatedByReasoning(finishReason: string | null | undefined, content: string, requestedMaxTokens: number | undefined): void; export {};