diff --git a/backend/ai_generator.py b/backend/ai_generator.py index 0363ca90c..149cb46e1 100644 --- a/backend/ai_generator.py +++ b/backend/ai_generator.py @@ -34,10 +34,13 @@ def __init__(self, api_key: str, model: str): self.model = model # Pre-build base API parameters + # Sonnet 5 rejects non-default sampling params, and runs adaptive + # thinking when `thinking` is omitted - disabled here to keep answers + # fast and to leave the full max_tokens budget for the response. self.base_params = { "model": self.model, - "temperature": 0, - "max_tokens": 800 + "max_tokens": 800, + "thinking": {"type": "disabled"} } def generate_response(self, query: str, diff --git a/backend/config.py b/backend/config.py index d9f6392ef..c4ba3712b 100644 --- a/backend/config.py +++ b/backend/config.py @@ -10,7 +10,7 @@ class Config: """Configuration settings for the RAG system""" # Anthropic API settings ANTHROPIC_API_KEY: str = os.getenv("ANTHROPIC_API_KEY", "") - ANTHROPIC_MODEL: str = "claude-sonnet-4-20250514" + ANTHROPIC_MODEL: str = "claude-sonnet-5" # Embedding model settings EMBEDDING_MODEL: str = "all-MiniLM-L6-v2"