All this is in context of OpenAI models. Because of big test run logs, I am putting them in pastebin and linking them here, else this description becomes too big and github does not allow too big descriptions.
Details:
As of now structured output works, but only in case if agent is not given any tools. If we give tools to an agent and also expect it to give structured output, it fails with below error: https://pastebin.com/Ckgi1YCU
As from error, we can see that OpenAI expects functions to be marked as "strict": True when structured output is enabled. This diff is to make that change. With this diff now tools along with structured output can be used.
All this is in context of OpenAI models. Because of big test run logs, I am putting them in pastebin and linking them here, else this description becomes too big and github does not allow too big descriptions.
Details:
As of now structured output works, but only in case if agent is not given any tools. If we give tools to an agent and also expect it to give structured output, it fails with below error: https://pastebin.com/Ckgi1YCU
Here is the test script: https://pastebin.com/72SgZ00j
When either tools are not provided or below two arguments are not passed (or commented) in call to
Agent()
, the test pass without any issues.As from error, we can see that OpenAI expects functions to be marked as
"strict": True
when structured output is enabled. This diff is to make that change. With this diff now tools along with structured output can be used.Here is the test run for tools with structured output: https://pastebin.com/xFYcfV8M
Here is the test run for tools without structured output (as markdown): https://pastebin.com/rEwcgrBA