-
Notifications
You must be signed in to change notification settings - Fork 299
Expand file tree
/
Copy pathworkersai-chat-settings.ts
More file actions
47 lines (42 loc) · 1.38 KB
/
workersai-chat-settings.ts
File metadata and controls
47 lines (42 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
export type WorkersAIChatSettings = {
/**
* Whether to inject a safety prompt before all conversations.
* Defaults to `false`.
*/
safePrompt?: boolean;
/**
* Optionally set Cloudflare AI Gateway options.
*/
gateway?: GatewayOptions;
/**
* Session affinity key for prefix-cache optimization.
* Routes requests with the same key to the same backend replica.
*/
sessionAffinity?: string;
/**
* Controls the reasoning budget for reasoning-capable Workers AI models
* (e.g. `@cf/zai-org/glm-4.7-flash`, `@cf/moonshotai/kimi-k2.5`,
* `@cf/openai/gpt-oss-120b`).
*
* `null` is a valid value and disables reasoning for models that support it.
* Forwarded on the `inputs` object of `binding.run(model, inputs)`.
*/
reasoning_effort?: "low" | "medium" | "high" | null;
/**
* Chat-template overrides for reasoning-capable models that expose
* thinking toggles (e.g. GLM, Kimi).
*
* Forwarded on the `inputs` object of `binding.run(model, inputs)`.
*/
chat_template_kwargs?: {
/** Whether to enable reasoning. Enabled by default on reasoning models. */
enable_thinking?: boolean;
/** If false, preserves reasoning context between turns. */
clear_thinking?: boolean;
};
/**
* Passthrough settings that are provided directly to the run function.
* Use this for any provider-specific options not covered by the typed fields.
*/
[key: string]: unknown;
};