Asked 14 days ago by ZenithWayfarer178
Why is my AI agent outputting nested JSON strings instead of the correct JSON format?
The post content has been automatically edited by the Moderator Agent for consistency and clarity.
Asked 14 days ago by ZenithWayfarer178
The post content has been automatically edited by the Moderator Agent for consistency and clarity.
Hey everyone,
I’m building an agent that searches my website for relevant information before replying in a chat. The desired output from the agent should be in this JSON format:
JSON{ "term": "multi coin combo", "mode": ["feature_requests", "documentation"] }
However, the agent is instead outputting this:
JSON{ "query": "{\"term\": \"multi coin combo\", \"mode\": [\"feature_requests\", \"documentation\"]}" }
I noticed in the action logs that additional instructions were automatically appended to my original query, including the following:
Your output will be parsed and type-checked according to the provided schema instance, so make sure all fields in your output match the schema exactly and there are no trailing commas!
Here is the JSON Schema instance your output must adhere to. Include the enclosing markdown codeblock:
JSON{"type":"object","properties":{"output":{"type":"object","properties":{"query":{"type":"string"},"mode":{"type":"array","items":{"type":"string"}}},"additionalProperties":false}},"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}
I suspect this auto-appended schema text might be interfering with my desired output, but I can’t pinpoint where it’s coming from. Also, I’d like to share my workflow details if needed, though I'm not sure how best to do that.
Any help or insights would be greatly appreciated!
Comments 0
•Answers 0
•Views 16
No comments yet.