fix model name for anthropic model before fallback to OpenRouter

This commit is contained in:
mykonos-ibiza 2025-07-24 18:11:37 +05:30 committed by Bobbie
parent d72f84240a
commit f4df0087b1
1 changed files with 3 additions and 1 deletions

View File

@ -509,7 +509,9 @@ Here are the XML tools available with examples:
if ("AnthropicException - Overloaded" in str(e)):
logger.error(f"AnthropicException - Overloaded detected - Falling back to OpenRouter: {str(e)}", exc_info=True)
nonlocal llm_model
llm_model = f"openrouter/{llm_model}"
# Remove "-20250514" from the model name if present
model_name_cleaned = llm_model.replace("-20250514", "")
llm_model = f"openrouter/{model_name_cleaned}"
auto_continue = True
continue # Continue the loop
else: