Interface: WebLLMChatCompletionsAdapterOptions
Extends
Omit<OpenAIChatCompletionsAdapterOptions,"apiKey"|"baseURL"|"headers"|"fetch"|"retry"|"requestTimeoutMs">
Properties
| Property | Type | Default value | Description | Inherited from |
|---|---|---|---|---|
audio? | { format: "wav" | "mp3" | "flac" | "opus" | "pcm16"; voice: string; } | undefined | - | OpenAIChatCompletionsAdapterOptions.audio |
audio.format | "wav" | "mp3" | "flac" | "opus" | "pcm16" | undefined | - | - |
audio.voice | string | undefined | - | - |
autoAck? | boolean | false | Whether the executor should call ctx.ack() itself when a generation completes with no tool calls (a terminal text answer). Remarks ack() is terminal and one-shot: once called, the dispatch loop exits after the current iteration. When the executor acks automatically, it seizes turn-completion control from the implementor — a dispatchOutputPipeline quality gate can never run, because the signal is already set before the output pipeline executes. This option therefore defaults to false (opt-in). With autoAck: false, a tool-call-free response leaves the context unsignalled and the executor returns; the implementor's output pipeline (or a later iteration) is responsible for calling ctx.ack() / ctx.nack(). This is the seam that makes output-side quality gates (citation enforcement, schema validation, regenerate-on-reject) possible. Set autoAck: true to restore single-shot behavior: the executor acks the moment a tool-call-free answer finishes, terminating the turn without giving the output pipeline a vote. The tool-call path is unaffected by this flag — it always withholds ack so the runner can iterate and execute the calls. Error paths always nack regardless of this flag. | OpenAIChatCompletionsAdapterOptions.autoAck |
bucketOrder? | ChatCompletionsBucketOrder | undefined | - | OpenAIChatCompletionsAdapterOptions.bucketOrder |
chatOptions? | ChatOptions | ChatOptions[] | undefined | - | - |
contextWindow? | number | undefined | - | OpenAIChatCompletionsAdapterOptions.contextWindow |
createEngine? | (input: { chatOptions?: ChatOptions | ChatOptions[]; engineConfig?: MLCEngineConfig; model: string; onInitProgress?: (report: InitProgressReport) => void; }) => Promise<MLCEngineInterface> | undefined | - | - |
engine? | MLCEngineInterface | undefined | - | - |
engineConfig? | MLCEngineConfig | undefined | - | - |
extra_body? | Record<string, unknown> | undefined | - | - |
frequency_penalty? | number | undefined | - | OpenAIChatCompletionsAdapterOptions.frequency_penalty |
function_call? | | "auto" | "none" | { name: string; } | undefined | - | OpenAIChatCompletionsAdapterOptions.function_call |
functions? | { description?: string; name: string; parameters?: JsonSchema; }[] | undefined | - | OpenAIChatCompletionsAdapterOptions.functions |
helpers? | Partial<ChatCompletionsHelpers> | undefined | - | OpenAIChatCompletionsAdapterOptions.helpers |
ignore_eos? | boolean | undefined | - | - |
isWebGPUAvailable? | () => boolean | undefined | - | - |
logit_bias? | Record<string, number> | undefined | - | OpenAIChatCompletionsAdapterOptions.logit_bias |
logprobs? | boolean | undefined | - | OpenAIChatCompletionsAdapterOptions.logprobs |
max_completion_tokens? | number | undefined | - | OpenAIChatCompletionsAdapterOptions.max_completion_tokens |
max_tokens? | number | undefined | - | OpenAIChatCompletionsAdapterOptions.max_tokens |
metadata? | Record<string, string> | undefined | - | OpenAIChatCompletionsAdapterOptions.metadata |
modalities? | ("text" | "audio")[] | undefined | - | OpenAIChatCompletionsAdapterOptions.modalities |
model | string | undefined | - | OpenAIChatCompletionsAdapterOptions.model |
n? | number | undefined | - | OpenAIChatCompletionsAdapterOptions.n |
onInitProgress? | (report: InitProgressReport) => void | undefined | - | - |
parallel_tool_calls? | boolean | undefined | - | OpenAIChatCompletionsAdapterOptions.parallel_tool_calls |
prediction? | { content: | string | { text: string; type: "text"; }[]; type: "content"; } | undefined | - | OpenAIChatCompletionsAdapterOptions.prediction |
prediction.content | | string | { text: string; type: "text"; }[] | undefined | - | - |
prediction.type | "content" | undefined | - | - |
presence_penalty? | number | undefined | - | OpenAIChatCompletionsAdapterOptions.presence_penalty |
prompt_cache_key? | string | undefined | - | OpenAIChatCompletionsAdapterOptions.prompt_cache_key |
prompt_cache_retention? | "in_memory" | "24h" | undefined | - | OpenAIChatCompletionsAdapterOptions.prompt_cache_retention |
reasoning_effort? | "low" | "high" | "minimal" | "medium" | undefined | - | OpenAIChatCompletionsAdapterOptions.reasoning_effort |
repetition_penalty? | number | undefined | - | - |
replayCompatibility? | readonly string[] | undefined | - | OpenAIChatCompletionsAdapterOptions.replayCompatibility |
response_format? | | { type: "text"; } | { type: "json_object"; } | { json_schema: { description?: string; name: string; schema: JsonSchema; strict?: boolean; }; type: "json_schema"; } | undefined | - | OpenAIChatCompletionsAdapterOptions.response_format |
safety_identifier? | string | undefined | - | OpenAIChatCompletionsAdapterOptions.safety_identifier |
seed? | number | undefined | - | OpenAIChatCompletionsAdapterOptions.seed |
selfIdentity? | string | undefined | - | OpenAIChatCompletionsAdapterOptions.selfIdentity |
service_tier? | "default" | "auto" | "flex" | "priority" | "scale" | undefined | - | OpenAIChatCompletionsAdapterOptions.service_tier |
stop? | string | string[] | undefined | - | OpenAIChatCompletionsAdapterOptions.stop |
store? | boolean | undefined | - | OpenAIChatCompletionsAdapterOptions.store |
stream? | boolean | undefined | - | OpenAIChatCompletionsAdapterOptions.stream |
stream_options? | { include_obfuscation?: boolean; include_usage?: boolean; } | undefined | - | OpenAIChatCompletionsAdapterOptions.stream_options |
stream_options.include_obfuscation? | boolean | undefined | - | - |
stream_options.include_usage? | boolean | undefined | - | - |
streamIdleTimeoutMs? | number | undefined | - | OpenAIChatCompletionsAdapterOptions.streamIdleTimeoutMs |
strictToolChoice? | boolean | false | When tool_choice (or the allowed_tools variant) forces the model onto a specific tool name, and that name resolves to an ephemeral, forged artifact-query tool (one produced by <Subclass>.forgeTools(ctx) — i.e. tool.ephemeral === true), this flag controls how the adapter reacts: - false (default): emit a single helpers.log.warn({ kind: 'tool-choice-forged-artifact', ... }) record and continue. Forging an artifact-query tool by name is almost always a misconfiguration — the tool may not exist in the next iteration once the artifact ages out — but the call still goes through. - true: hard-fail with E_INVALID_OPENAI_CHAT_COMPLETIONS_OPTIONS. Use this in production deployments where forcing a forged tool indicates a real bug. | OpenAIChatCompletionsAdapterOptions.strictToolChoice |
temperature? | number | undefined | - | OpenAIChatCompletionsAdapterOptions.temperature |
thoughtSurfacing? | "all-self" | "latest-self" | "all" | undefined | - | OpenAIChatCompletionsAdapterOptions.thoughtSurfacing |
tokenEncoding? | | "gpt2" | "r50k_base" | "p50k_base" | "p50k_edit" | "cl100k_base" | "o200k_base" | "gemini" | "llama2" | "claude" | null | undefined | - | OpenAIChatCompletionsAdapterOptions.tokenEncoding |
tool_choice? | | "required" | "auto" | "none" | { function: { name: string; }; type: "function"; } | { custom: { name: string; }; type: "custom"; } | { allowed_tools: { mode: "required" | "auto"; tools: ( | { function: { name: string; }; type: "function"; } | { custom: { name: string; }; type: "custom"; })[]; }; type: "allowed_tools"; } | undefined | - | OpenAIChatCompletionsAdapterOptions.tool_choice |
top_logprobs? | number | undefined | - | OpenAIChatCompletionsAdapterOptions.top_logprobs |
top_p? | number | undefined | - | OpenAIChatCompletionsAdapterOptions.top_p |
unsupportedMediaPolicy? | UnsupportedMediaPolicy | 'throw' | Policy for how the adapter handles a @nhtio/adk!Media instance whose modality the OpenAI Chat Completions wire format does not natively support (today: video). See UnsupportedMediaPolicy. | OpenAIChatCompletionsAdapterOptions.unsupportedMediaPolicy |
user? | string | undefined | - | OpenAIChatCompletionsAdapterOptions.user |
verbosity? | "low" | "high" | "medium" | undefined | - | OpenAIChatCompletionsAdapterOptions.verbosity |
web_search_options? | { search_context_size?: "low" | "high" | "medium"; user_location?: { approximate: { city?: string; country?: string; region?: string; timezone?: string; }; type: "approximate"; }; } | undefined | - | OpenAIChatCompletionsAdapterOptions.web_search_options |
web_search_options.search_context_size? | "low" | "high" | "medium" | undefined | - | - |
web_search_options.user_location? | { approximate: { city?: string; country?: string; region?: string; timezone?: string; }; type: "approximate"; } | undefined | - | - |
web_search_options.user_location.approximate | { city?: string; country?: string; region?: string; timezone?: string; } | undefined | - | - |
web_search_options.user_location.approximate.city? | string | undefined | - | - |
web_search_options.user_location.approximate.country? | string | undefined | - | - |
web_search_options.user_location.approximate.region? | string | undefined | - | - |
web_search_options.user_location.approximate.timezone? | string | undefined | - | - |
web_search_options.user_location.type | "approximate" | undefined | - | - |