Skip to content

Commit 89ea3a7

Browse files
Fix o1 usage with tool calls (#764)
1 parent ffd5691 commit 89ea3a7

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

pydantic_ai_slim/pydantic_ai/models/groq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ async def _completions_create(
197197
model=str(self.model_name),
198198
messages=groq_messages,
199199
n=1,
200-
parallel_tool_calls=model_settings.get('parallel_tool_calls', True if self.tools else NOT_GIVEN),
200+
parallel_tool_calls=model_settings.get('parallel_tool_calls', NOT_GIVEN),
201201
tools=self.tools or NOT_GIVEN,
202202
tool_choice=tool_choice or NOT_GIVEN,
203203
stream=stream,

pydantic_ai_slim/pydantic_ai/models/openai.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ async def _completions_create(
199199
model=self.model_name,
200200
messages=openai_messages,
201201
n=1,
202-
parallel_tool_calls=model_settings.get('parallel_tool_calls', True if self.tools else NOT_GIVEN),
202+
parallel_tool_calls=model_settings.get('parallel_tool_calls', NOT_GIVEN),
203203
tools=self.tools or NOT_GIVEN,
204204
tool_choice=tool_choice or NOT_GIVEN,
205205
stream=stream,

pydantic_ai_slim/pydantic_ai/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class ModelSettings(TypedDict, total=False):
8080
"""Whether to allow parallel tool calls.
8181
8282
Supported by:
83-
* OpenAI
83+
* OpenAI (some models, not o1)
8484
* Groq
8585
* Anthropic
8686
"""

0 commit comments

Comments
 (0)