diff --git a/.changeset/towering-organic-grouse.md b/.changeset/towering-organic-grouse.md new file mode 100644 index 00000000..842aca68 --- /dev/null +++ b/.changeset/towering-organic-grouse.md @@ -0,0 +1,5 @@ +--- +"stagehand": patch +--- + +Fix temperature setting for GPT-5 family of models diff --git a/stagehand/llm/client.py b/stagehand/llm/client.py index 855b0fef..ac0ead4a 100644 --- a/stagehand/llm/client.py +++ b/stagehand/llm/client.py @@ -110,6 +110,9 @@ def create_response( filtered_params = { k: v for k, v in params.items() if v is not None or k in kwargs } + # Fixes parameters for GPT-5 family of models + if "gpt-5" in completion_model: + filtered_params["temperature"] = 1 self.logger.debug( f"Calling litellm.completion with model={completion_model} and params: {filtered_params}",