From ea287fae98c59867bccc28045979c083400428aa Mon Sep 17 00:00:00 2001 From: "mingholy.lmh" Date: Mon, 29 Dec 2025 15:37:08 +0800 Subject: [PATCH] docs: add reasoning configuration and sampling parameters instructions --- docs/users/configuration/settings.md | 26 +++++++++++++++ packages/cli/src/config/settingsSchema.ts | 39 +++++++++++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/docs/users/configuration/settings.md b/docs/users/configuration/settings.md index 3e87985b8..f2b156be0 100644 --- a/docs/users/configuration/settings.md +++ b/docs/users/configuration/settings.md @@ -124,12 +124,38 @@ Settings are organized into categories. All settings should be placed within the "temperature": 0.2, "top_p": 0.8, "max_tokens": 1024 + }, + "reasoning": { + "effort": "medium" } } } } ``` +**Reasoning Configuration:** + +The `reasoning` field controls reasoning behavior for models that support it: + +- Set to `false` to disable reasoning entirely +- Set to an object with `effort` field to enable reasoning with a specific effort level: + - `"low"`: Minimal reasoning effort + - `"medium"`: Balanced reasoning effort (default) + - `"high"`: Maximum reasoning effort +- Optionally include `budget_tokens` to limit reasoning token usage + +Example to disable reasoning: + +```json +{ + "model": { + "generationConfig": { + "reasoning": false + } + } +} +``` + **model.openAILoggingDir examples:** - `"~/qwen-logs"` - Logs to `~/qwen-logs` directory diff --git a/packages/cli/src/config/settingsSchema.ts b/packages/cli/src/config/settingsSchema.ts index 2fe467ba9..ab151b67d 100644 --- a/packages/cli/src/config/settingsSchema.ts +++ b/packages/cli/src/config/settingsSchema.ts @@ -675,6 +675,45 @@ const SETTINGS_SCHEMA = { { value: 'openapi_30', label: 'OpenAPI 3.0 Strict' }, ], }, + samplingParams: { + type: 'object', + label: 'Sampling Parameters', + category: 'Generation Configuration', + requiresRestart: false, + default: undefined as + | { + top_p?: number; + top_k?: number; + repetition_penalty?: number; + presence_penalty?: number; + frequency_penalty?: number; + temperature?: number; + max_tokens?: number; + } + | undefined, + description: 'Sampling parameters for content generation.', + parentKey: 'generationConfig', + childKey: 'samplingParams', + showInDialog: false, + }, + reasoning: { + type: 'object', + label: 'Reasoning Configuration', + category: 'Generation Configuration', + requiresRestart: false, + default: undefined as + | false + | { + effort?: 'low' | 'medium' | 'high'; + budget_tokens?: number; + } + | undefined, + description: + 'Reasoning configuration for models that support reasoning. Set to false to disable reasoning, or provide an object with effort level and optional token budget.', + parentKey: 'generationConfig', + childKey: 'reasoning', + showInDialog: false, + }, }, }, },