Skip to content

Commit

Permalink
don't pass parallel_tool_calls to o1 models (#1025)
Browse files Browse the repository at this point in the history
Co-authored-by: J.J. Allaire <[email protected]>
  • Loading branch information
jjallaire-aisi and jjallaire authored Dec 19, 2024
1 parent ac922a4 commit e47724b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/inspect_ai/model/_providers/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,11 @@ def __init__(
**model_args,
)

def is_o1(self) -> bool:
return self.model_name.startswith("o1")

def is_o1_full(self) -> bool:
return (
self.model_name.startswith("o1")
and not self.is_o1_mini()
and not self.is_o1_preview()
)
return self.is_o1() and not self.is_o1_mini() and not self.is_o1_preview()

def is_o1_mini(self) -> bool:
return self.model_name.startswith("o1-mini")
Expand Down Expand Up @@ -285,7 +284,7 @@ def completion_params(self, config: GenerateConfig, tools: bool) -> dict[str, An
params["logprobs"] = config.logprobs
if config.top_logprobs is not None:
params["top_logprobs"] = config.top_logprobs
if tools and config.parallel_tool_calls is not None:
if tools and config.parallel_tool_calls is not None and not self.is_o1():
params["parallel_tool_calls"] = config.parallel_tool_calls
if config.reasoning_effort is not None and self.is_o1_full():
params["reasoning_effort"] = config.reasoning_effort
Expand Down

0 comments on commit e47724b

Please sign in to comment.