Assistant API - Cannot modify assistant model from o1 to gpt4 due to reasoning_effort is already set

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,
)
1 Like

change temp to 1 and top_p to 1 should do it

The self-discovered solution can be marked, but the API of assistants could work better.

The Assistants playground works by sending the parameter as JSON null to reset the reasoning effort upon a model switch, a full update of the assistants with the current state, which is why it doesn’t fail:

{"model":"gpt-4o","tools":[],"name":"thinkbot","instructions":"You are a puzzle-solving advanced AI model","tool_resources":{"code_interpreter":{"file_ids":[]},"file_search":{"vector_store_ids":[]}},"temperature":null,"top_p":null,"response_format":"auto","reasoning_effort":null}

It doesn’t have to do with the OpenAI library specifically, and the library wouldn’t know the previous settings. To necessarily send parameters you didn’t set yourself could cause more undocumented issues.

1 Like