API Reference
injectReasoningKwargs
function injectReasoningKwargs(body, mode?): Record<string, unknown>;Defined in: providers/reasoning-kwargs.ts:363
Merge the derived chat_template_kwargs into an OpenAI chat-completions
request body, keyed by its own model field. The seam a proxy uses to inject
thinking control without the client knowing the per-family dialect.
Returns the body unchanged when it already carries an explicit
chat_template_kwargs (the caller's choice always wins), has no string
model, or the model is unknown/non-reasoning. Otherwise returns a shallow
copy with the kwargs added — the input is never mutated.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
body | Record<string, unknown> | undefined | The parsed request body. |
mode | ThinkingMode | "auto" | Desired thinking state; defaults to "auto" (family default). |
Returns
Record<string, unknown>
The body to forward upstream.