Hello Mohamed Hussein,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
I understand that you are having issue with passing Function output tools to AOAI assistants through logic App.
Regarding the image and the error you encountered, it is clear that:
- The
tool_outputs
expects an array of objects, not a single string or concatenated string. - When concatenating multiple outputs, they must be converted into valid objects before being included in the
tool_outputs
array.
Use this video https://youtu.be/lbb_ZrSQh_A from YouTube to see how you can address the potential challenge of ensuring the correct JSON schema for Azure OpenAI's input.
Understand this:
- Likely passed as a string, which is acceptable as
tool_outputs[0]
in some cases. - Strings cannot be concatenated directly; the API expects an array of objects, and passing concatenated strings breaks the schema.
This is a correct JSON Body for Multiple Outputs should be similar to this example:
{
"tool_call_id": "@{body('ParseJSONRunStatusLoop').required_action.submit_tool_outputs.tool_calls[variables('FuncToolIndexVar')].id}",
"tool_outputs": [
{ "output": "@{body('ParseJSONSearchBing')}" },
{ "output": "@{body('AnotherFunctionOutput')}" }
]
}
I hope this is helpful! Do not hesitate to let me know if you need more steps and have any other questions.
Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.