- Issue created by @marcus_johansson
- 🇩🇪Germany marcus_johansson
For the initial version there will not be a YAML converter - the issue with this is if you are streaming the output, how are we supposed to react on that. So, this is pushed until later.
- 🇮🇳India Akhil Babu Chengannur
I have tested this with the math reasoning example given here.
Created a Math tutor agent with instruction 'You are a helpful math tutor. Guide the user through the solution step by step'
Enabled structured output option and gave the following schema{ "name": "math_reasoning", "schema": { "type": "object", "properties": { "steps": { "type": "array", "items": { "type": "object", "properties": { "explanation": { "type": "string" }, "output": { "type": "string" } }, "required": ["explanation", "output"], "additionalProperties": false } }, "final_answer": { "type": "string" } }, "required": ["steps", "final_answer"], "additionalProperties": false }, "strict": true }
Then using Agents explorer, asked the agent to solve 'what is x and y, if 3x + 2y = 36 and 2x - y = 17'. It gave the output in the proper json format.
{ "steps": [ { "explanation": "First, let's write down the system of equations: 3x + 2y = 36 (1), and 2x - y = 17 (2). Let's solve equation (2) for y.", "output": "2x - y = 17 => y = 2x - 17" }, { "explanation": "Now substitute y = 2x - 17 into equation (1): 3x + 2y = 36 becomes 3x + 2(2x - 17) = 36.", "output": "3x + 4x - 34 = 36" }, { "explanation": "Combine like terms: 3x + 4x = 7x, and move -34 to the other side: 7x = 36 + 34 = 70.", "output": "7x = 70" }, { "explanation": "Solve for x by dividing both sides by 7.", "output": "x = 10" }, { "explanation": "Now we substitute x = 10 into y = 2x - 17 to find y.", "output": "y = 2*10 - 17 = 20 - 17 = 3" } ], "final_answer": "x = 10, y = 3" }
-
marcus_johansson →
committed 6901c38b on 1.2.x
Resolve #3544184 "Agent structured output"
-
marcus_johansson →
committed 6901c38b on 1.2.x