feat: Add initial structured output for agent#1466
feat: Add initial structured output for agent#1466ryans-posthog wants to merge 11 commits intomainfrom
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
34bdfcd to
bad7053
Compare
jonathanlab
left a comment
There was a problem hiding this comment.
The Claude SDK supports structured outputs via output_config, which can even be typed via Zod. Could we use that instead? Then we also would not need an output MCP server right? Also note the possibility to use strict: true.
Source: https://platform.claude.com/docs/en/build-with-claude/structured-outputs
I like it! Updated with the new changes. |

Problem
Currently, users cannot execute a AI Task and expect a structured output from it.
Changes
The PR adds a new tool for accepting and verifying structured output and wires it to fire on the
onOutputevent. Currently it is only available for Anthropic Claude based executions. The implementation for Codex will follow as it requires a more complex method of interaction.How did you test this?
Build the agent and start the Posthog system locally. Rebuild the agent docker image with the new code and execute a task via the console with a json schema set. Verify that the task calls the structured output endpoint and the task completes successfully.