update settings

This commit is contained in:
Swifty
2026-02-10 16:08:21 +01:00
parent 90eac56525
commit ba6d585170
2 changed files with 7 additions and 34 deletions

View File

@@ -96,13 +96,7 @@ class ChatConfig(BaseSettings):
# Extended thinking configuration for Claude models
thinking_enabled: bool = Field(
default=True,
description="Enable extended thinking for Claude models",
)
thinking_budget_tokens: int = Field(
default=10000,
ge=1000,
le=100000,
description="Token budget for extended thinking (1000-100000)",
description="Enable adaptive thinking for Claude models via OpenRouter",
)
@field_validator("api_key", mode="before")

View File

@@ -1066,16 +1066,9 @@ async def _stream_chat_chunks(
:128
] # OpenRouter limit
# Enable extended thinking for Anthropic models
# Enable adaptive thinking for Anthropic models via OpenRouter
if config.thinking_enabled and "anthropic" in model.lower():
extra_body["provider"] = {
"anthropic": {
"thinking": {
"type": "enabled",
"budget_tokens": config.thinking_budget_tokens,
}
}
}
extra_body["reasoning"] = {"enabled": True}
api_call_start = time_module.perf_counter()
stream = await client.chat.completions.create(
@@ -1840,16 +1833,9 @@ async def _generate_llm_continuation(
if session_id:
extra_body["session_id"] = session_id[:128]
# Enable extended thinking for Anthropic models
# Enable adaptive thinking for Anthropic models via OpenRouter
if config.thinking_enabled and "anthropic" in config.model.lower():
extra_body["provider"] = {
"anthropic": {
"thinking": {
"type": "enabled",
"budget_tokens": config.thinking_budget_tokens,
}
}
}
extra_body["reasoning"] = {"enabled": True}
retry_count = 0
last_error: Exception | None = None
@@ -1981,16 +1967,9 @@ async def _generate_llm_continuation_with_streaming(
if session_id:
extra_body["session_id"] = session_id[:128]
# Enable extended thinking for Anthropic models
# Enable adaptive thinking for Anthropic models via OpenRouter
if config.thinking_enabled and "anthropic" in config.model.lower():
extra_body["provider"] = {
"anthropic": {
"thinking": {
"type": "enabled",
"budget_tokens": config.thinking_budget_tokens,
}
}
}
extra_body["reasoning"] = {"enabled": True}
# Make streaming LLM call (no tools - just text response)
from typing import cast