From 2c0413ecc539e7a6c16cd4fecdc411059b6e34ac Mon Sep 17 00:00:00 2001 From: ferenci84 Date: Tue, 8 Apr 2025 11:18:34 +0200 Subject: [PATCH] Add reasoning and reasoningBudgetTokens parameters to config schemas and docs --- docs/docs/json-reference.md | 2 ++ docs/docs/reference.md | 2 ++ extensions/vscode/config_schema.json | 10 ++++++++++ packages/config-yaml/src/schemas/models.ts | 2 ++ 4 files changed, 16 insertions(+) diff --git a/docs/docs/json-reference.md b/docs/docs/json-reference.md index 0fa8e2d25..897695b37 100644 --- a/docs/docs/json-reference.md +++ b/docs/docs/json-reference.md @@ -159,6 +159,8 @@ Parameters that control the behavior of text generation and completion settings. - `numThreads`: The number of threads used during the generation process. Available only for Ollama as `num_thread`. - `keepAlive`: For Ollama, this parameter sets the number of seconds to keep the model loaded after the last request, unloading it from memory if inactive (default: `1800` seconds, or 30 minutes). - `useMmap`: For Ollama, this parameter allows the model to be mapped into memory. If disabled can enhance response time on low end devices but will slow down the stream. +- `reasoning`: Enables thinking/reasoning for Anthropic Claude 3.7+ models. +- `reasoningBudgetTokens`: Sets budget tokens for thinking/reasoning in Anthropic Claude 3.7+ models. Example diff --git a/docs/docs/reference.md b/docs/docs/reference.md index 757cfa13e..4e418bc3d 100644 --- a/docs/docs/reference.md +++ b/docs/docs/reference.md @@ -160,6 +160,8 @@ The `models` section defines the language models used in your configuration. Mod - `topK`: Maximum number of tokens considered at each step. - `stop`: An array of stop tokens that will terminate the completion. - `n`: Number of completions to generate. + - `reasoning`: Boolean to enable thinking/reasoning for Anthropic Claude 3.7+ models. + - `reasoningBudgetTokens`: Budget tokens for thinking/reasoning in Anthropic Claude 3.7+ models. - `requestOptions`: HTTP request options specific to the model. diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index 801bba5ea..d8b540483 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -71,6 +71,16 @@ "title": "Ollama keep_alive", "description": "The number of seconds after no requests are made to unload the model from memory. Defaults to 60*30 = 30min", "type": "integer" + }, + "reasoning": { + "title": "Reasoning", + "description": "Enable thinking/reasoning for Anthropic Claude 3.7+ models", + "type": "boolean" + }, + "reasoningBudgetTokens": { + "title": "Reasoning Budget Tokens", + "description": "Set budget tokens for thinking/reasoning in Anthropic Claude 3.7+ models", + "type": "integer" } } }, diff --git a/packages/config-yaml/src/schemas/models.ts b/packages/config-yaml/src/schemas/models.ts index ff3f6bec3..5730c74f9 100644 --- a/packages/config-yaml/src/schemas/models.ts +++ b/packages/config-yaml/src/schemas/models.ts @@ -47,6 +47,8 @@ export const completionOptionsSchema = z.object({ topK: z.number().optional(), stop: z.array(z.string()).optional(), n: z.number().optional(), + reasoning: z.boolean().optional(), + reasoningBudgetTokens: z.number().optional(), }); export type CompletionOptions = z.infer;