The reasoning_effort
parameter does not work as expected in the Python lib due to the OpenAI API side; it looks like it is already set when you create the O1 assistant object so when you try to switch to gpt-4 series the API side will return an error about reasoning_effort
is already set but not support in gpt-4.
Like: openai.BadRequestError: Error code: 400 - {'error': {'message': "Unsupported value: 'reasoning_effort' does not support 'medium' with this model.", 'type': 'invalid_request_error', 'param': None, 'code': 'unsupported_value'}}
To Reproduce
assistant = client.beta.assistants.create(
instructions="You are a personal math tutor. When asked a question, write and run Python code to answer the question.",
name="Test",
tools=[],
model="o1",
description="Test",
temperature=None,
top_p=None,
)
# You will get:
Assistant(id='xxx', created_at=1739327593, description='xxx', instructions='You are a personal math tutor. When asked a question, write and run Python code to answer the question.', metadata={}, model='o1', name='xxx', object='assistant', tools=[], response_format='auto', temperature=1.0, tool_resources=ToolResources(code_interpreter=None, file_search=None), top_p=1.0, reasoning_effort='medium')
# Try to change the model to gpt-4
assistant = client.beta.assistants.update(
assistant_id="some_id",
model="gpt-4o",
temperature=1,
top_p=1,
)
# You will get:
openai.BadRequestError: Error code: 400 - {'error': {'message': "Unsupported value: 'reasoning_effort' does not support 'medium' with this model.", 'type': 'invalid_request_error', 'param': None, 'code': 'unsupported_value'}}
Update:
in Python SDK openai 1.62.0 (2025-02-12)
you can use reasoning_effort
params to None to reset the assistant setting, but I think it would be better not to manually set the params. E.g.: without providing reasoning_effort when switch to gpt4.
# Try to change the model to gpt-4
assistant = client.beta.assistants.update(
assistant_id="some_id",
model="gpt-4o",
reasoning_effort=None,
)