Skip to content

feat: add structured output validation (PydanticAI-inspired)#42

Merged
SonicBotMan merged 1 commit into
mainfrom
feat/structured-output
May 28, 2026
Merged

feat: add structured output validation (PydanticAI-inspired)#42
SonicBotMan merged 1 commit into
mainfrom
feat/structured-output

Conversation

@SonicBotMan
Copy link
Copy Markdown
Owner

Description

Add structured output validation inspired by PydanticAI.

Key Design Decisions (from PydanticAI)

  1. Typed Contract + Runtime Validation - Define schema first, validate output
  2. Retry with Error Feedback - On failure, send errors back to LLM
  3. Tools = Facts, Output = Format, Validator = Constraints

Features

  • OutputSchema: define expected output structure
  • OutputValidator: validate LLM outputs
  • validate_with_retry: automatic retry with error feedback
  • Common schemas: workflow_result, step_result, review_decision

Testing

  • 9 new tests
  • 95 total tests passing

- OutputSchema: define expected output structure
- OutputValidator: validate LLM outputs
- validate_with_retry: automatic retry with error feedback
- Common schemas: workflow_result, step_result, review_decision
- 9 new tests (95 total passing)
@SonicBotMan SonicBotMan merged commit 94430c7 into main May 28, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant