conductor-checkpoint-msg_01SwJkCDAScffk8116KPVpTd
This commit is contained in:
parent
8a24aa16c6
commit
f88a5c4ed2
1 changed files with 4 additions and 1 deletions
|
|
@ -73,13 +73,16 @@ class OpenAIClient(BaseOpenAIClient):
|
|||
verbosity: str | None = None,
|
||||
):
|
||||
"""Create a structured completion using OpenAI's beta parse API."""
|
||||
# Only pass reasoning parameter for reasoning models (gpt-5 family: o1, o3-mini, o3, gpt-5-*)
|
||||
is_reasoning_model = model.startswith('gpt-5') or model.startswith('o1') or model.startswith('o3')
|
||||
|
||||
response = await self.client.responses.parse(
|
||||
model=model,
|
||||
input=messages, # type: ignore
|
||||
temperature=temperature,
|
||||
max_output_tokens=max_tokens,
|
||||
text_format=response_model, # type: ignore
|
||||
reasoning={'effort': reasoning} if reasoning is not None else None, # type: ignore
|
||||
reasoning={'effort': reasoning} if reasoning is not None and is_reasoning_model else None, # type: ignore
|
||||
text={'verbosity': verbosity} if verbosity is not None else None, # type: ignore
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue