import { type CredentialValueSource, type JsonObject, type ModelConfig } from "@arnilo/prism"; export interface ZaiModelConfig extends Omit { readonly provider?: "zai"; readonly compat?: JsonObject & { /** Official deep-thinking switch (`boolean` or `{ type, clear_thinking? }`). */ readonly thinking?: boolean | JsonObject; /** Official GLM-5.2+ effort: max | xhigh | high | medium | low | minimal | none. */ readonly reasoning_effort?: string; /** Official GLM-4.6+ streaming tool-call arguments. */ readonly tool_stream?: boolean; /** Official nested `thinking.clear_thinking` (also accepted at compat root). */ readonly clear_thinking?: boolean; /** Prism-local: replay prior thinking as `reasoning_content` when not clearing. */ readonly preserveThinking?: boolean; }; } export interface ListZaiModelsOptions { readonly apiKey?: CredentialValueSource; readonly fetch?: typeof fetch; /** Defaults to official international `https://api.z.ai/api/paas/v4`. */ readonly baseUrl?: string; readonly signal?: AbortSignal; readonly headers?: Readonly>; readonly provider?: string; } /** * Sparse OpenAI-compatible `/models` entry. Z.AI does not publish a first-class * list-models API page; this helper follows the OpenAI-compatible convention * used by the Chat Completions base (`GET {baseUrl}/models`). Prefer featured * `zaiModels` (docs-verified) when discovery is unavailable. * @see https://docs.z.ai/api-reference/llm/chat-completion * @see https://docs.z.ai/guides/overview/overview */ export interface ZaiModelEntry { readonly id: string; readonly object?: string; readonly created?: number; readonly owned_by?: string; } export declare function defineZaiModel(config: ZaiModelConfig): ModelConfig; /** * Caller-gated Z.AI model discovery via OpenAI-compatible `GET /models`. * Never invoked by `createZaiProviderPackage` — hosts call this and pass results * via `models:` (or register themselves). Official docs list model codes on the * Chat Completions page / overview; use featured `zaiModels` as offline bootstrap. */ export declare function listZaiModels(options?: ListZaiModelsOptions): Promise; /** * Map a sparse OpenAI-compatible `/models` entry to Prism `ModelConfig`. * Limits / thinking defaults are inferred from official Chat Completions model codes. */ export declare function mapZaiModel(entry: ZaiModelEntry, options?: { readonly provider?: string; }): ModelConfig; /** * Featured offline bootstrap aliases — official Chat Completions model codes from * https://docs.z.ai/api-reference/llm/chat-completion and overview context sizes. * Refresh live ids via `listZaiModels()` when the OpenAI-compatible list endpoint * is available to the account. */ export declare const zaiModels: readonly [ModelConfig, ModelConfig, ModelConfig, ModelConfig, ModelConfig, ModelConfig, ModelConfig];