mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-29 09:16:36 +00:00
feat: add structured output (JSON schema) support
Add outputFormat option to session.prompt() for requesting structured JSON output. When type is 'json_schema', injects a StructuredOutput tool that validates model output against the provided schema. - Add OutputFormat schema types (text, json_schema) to message-v2.ts - Add structured_output field to AssistantMessage - Add StructuredOutputError for validation failures - Implement createStructuredOutputTool helper in prompt.ts - Integrate structured output into agent loop with retry support - Regenerate OpenAPI spec with new types - Add unit tests for schema validation
This commit is contained in:
10630
packages/sdk/js/openapi.json
Normal file
10630
packages/sdk/js/openapi.json
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user