import type { AIProvider, JsonObject, Message, ModelConfig, ProviderEvent, ProviderRequest } from "@arnilo/prism"; import { type CredentialValueSource } from "@arnilo/prism"; /** Official international Chat Completions base (China `open.bigmodel.cn` remains overridable). */ export declare const ZAI_DEFAULT_BASE_URL = "https://api.z.ai/api/paas/v4"; export interface ZaiProviderOptions { readonly id?: string; readonly baseUrl?: string; readonly apiKey?: CredentialValueSource; readonly fetch?: typeof fetch; } export declare function createZaiProvider(options?: ZaiProviderOptions): AIProvider; export declare function zaiBody(request: ProviderRequest): JsonObject; export declare function zaiEvents(body: ReadableStream, signal?: AbortSignal): AsyncIterable; /** * Serialize Prism messages for Z.AI Chat Completions. * Prior thinking blocks become `reasoning_content` when Preserved Thinking is active; * otherwise they are dropped (never flattened into visible text). * @see https://docs.z.ai/guides/capabilities/thinking-mode */ export declare function toZaiMessage(message: Message, model: ModelConfig, preserveThinking?: boolean): JsonObject;