opencode/packages/sdk/js
Kyle Mistele 32ef11da1f 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
2026-01-12 20:09:51 -08:00
..
example docs: sdk 2025-09-01 17:35:52 -04:00
script sync 2025-12-09 21:06:57 -05:00
src chore: generate 2025-12-24 01:37:35 +00:00
openapi.json feat: add structured output (JSON schema) support 2026-01-12 20:09:51 -08:00
package.json chore: generate 2025-12-23 15:39:47 +00:00
sst-env.d.ts wip: zen 2025-12-02 18:36:15 -05:00
tsconfig.json OpenTUI is here (#2685) 2025-10-31 15:07:36 -04:00