Skip to content

[Bug] Using claude sonnet 4.5 model with the reasoning true flag in agents and team results in Error at chatcompletion #7612

@user1500177

Description

@user1500177

Description

Status Description
BadRequestError: Error code: 400 - {'error_code': 'INVALID_PARAMETER_VALUE', 'message': 'INVALID_PARAMETER_VALUE: Cannot specify both response_format and tools in the same request.'}

Detailed event raised is as :

{
"exception.type": "openai.BadRequestError",
"exception.escaped": "False",
"exception.message": "Error code: 400 - {'error_code': 'INVALID_PARAMETER_VALUE', 'message': 'INVALID_PARAMETER_VALUE: Cannot specify both response_format and tools in the same request.'}",
"exception.stacktrace": "Traceback (most recent call last):\n File "C:\AGENTS\agent.api\.venv\Lib\site-packages\openinference\instrumentation\openai\_request.py", line 398, in call\n response = await wrapped(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File "C:\AGENTS\agent.api\.venv\Lib\site-packages\openai\_base_client.py", line 1669, in request\n raise self._make_status_error_from_response(err.response) from None\nopenai.BadRequestError: Error code: 400 - {'error_code': 'INVALID_PARAMETER_VALUE', 'message': 'INVALID_PARAMETER_VALUE: Cannot specify both response_format and tools in the same request.'}\n"
}

Steps to Reproduce

try to enable the reasoning flag in the Teams and Agents with reasoning = true.

Agent Configuration (if applicable)

used version 2..5.16 of agno
claude sonnetr version 4.5 via databricks
use openAILike libarary

Expected Behavior

Did expect the model to give the structured output with the confidence scores and all. Isnt that the way said in docs , if the model is a reasoning model , then Agno tires to create a sub reasoning agent under the main agent (usng the same model , as i only have enbled the resoning=True flag)- HERE i meant the Main agent as the one in which i enabled the reasoning flag.

Please tell me should i deine a seprate reasoning agent with the same model to be used , and i do not have to give the tools - but i thought that pat would be handled by agno itslef. ? (but when i searched in net it seemed that the tools and the strcuture output is supported by sonnet 4.5- could someone please check and see if you also see the same issue? or is it a misconfiguration on my side )- for gpt4.1 itthe same code worked without ISSUES (though the six step architecture never took place - i had opened a discussion for the smae earlier as the gpt4.1 was a miscalssified model - i see that the changes are commit when it is released in nextversions - will the same issue occur there just a concern -#7543)

Actual Behavior

The chat completions say error as providing both the tools and the strcutred output not supported it seems with calude sonnet - 4.5 (that is the error that i am gettting good if someone verifies it and is reproducable)- for addd on information i use the sonnet 4.5 model via databricks

Screenshots or Logs (if applicable)

No response

Environment

Agno version is 2.5.16

Possible Solutions (optional)

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions