AI Agent Output format

Hello I am trying to set an output from an AI Agent node [with OpenAI model].

It is taking a request from chat as "create a block in a Notion page with pageID “123123” which says “asdasd”.

the details are exactly how I want but the format is wrong, the fields are all merged.

the output is coming as:

[ { "output": "[\n {\n "operation": "create block",\n "pageId": "123123",\n "blockId": null,\n "content": "asdasd"\n }\n]" } ]

It is coming as one single item, everything merged as a text form, I want it to come as

[

{

"operation": "create block",

"pageId": "123123",

"blockId": null,

"content": "asdasd"

}

]

I asked ChatGPT to help me enhance the prompt but nothing could change the format. I emphasized the necessity of separate fields, I connected the agent to a format parser, it fixes it if the prompt comes with one certain function such as create block but then not with delete block or order functions

Does anyone have a suggestion? thank you for your help!

Dear @Ercan_Derekoy Please give look to the following workflow.

Here I have added Stracturare Output Parsrer to output what you are looking forward to.

How to open 4th Stracture Output inside AI agent.

Let me know whether it will works or not

Happy to help…

you will need to define that the output must be in a specific structured format. Share dummy data in the exact format you’re looking for, to chatgpt, & ask it to make a sample json schema from it.

Then

  • toggle on “require specific output format” in your agent node
  • in the output parser node copy paste the schema chatgpt gave you
  • you should now get the output exactly how you wanted it

Feel free to share screenshots of any step you are stuck at :victory_hand:t3:

The following workflow is working as expected

The result in chat:

If on the other hand you are talking about the node output (instead of a chat output), then the word output is expected, as this is what the structure of the AI agent node response is.

You can further re-format the output in any way you would like.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.