feat: set frequency penalty to 1 for gpt-4o (#3962)

This commit is contained in:
cthomas
2025-08-18 14:20:16 -07:00
committed by GitHub
parent 519363ea28
commit 4765f8e7f5
2 changed files with 2 additions and 1 deletions

View File

@@ -222,6 +222,7 @@ def _safe_load_tool_call_str(tool_call_args_str: str) -> dict:
# Load it again - this is due to sometimes Anthropic returning weird json @caren
tool_args = json.loads(tool_args)
except json.JSONDecodeError:
logger.error("Failed to JSON decode tool call argument string: %s", tool_call_args_str)
tool_args = {}
return tool_args

View File

@@ -142,7 +142,7 @@ class OpenAIProvider(Provider):
"""This function is used to tune LLMConfig parameters to improve model performance."""
# gpt-4o-mini has started to regress with pretty bad emoji spam loops (2025-07)
if "gpt-4o-mini" in model_name or "gpt-4.1-mini" in model_name:
if "gpt-4o" in model_name or "gpt-4.1-mini" in model_name:
llm_config.frequency_penalty = 1.0
return llm_config