@radzor/structured-output
Force LLM responses to match a JSON schema. Wraps OpenAI and Anthropic with schema-validated generation, automatic retry on parse failure, and TypeScript type inference from the schema.
Install
View source on GitHub →Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| provider* | 'openai' | 'anthropic' | — | LLM provider to use. |
| apiKey* | string | — | API key for the selected provider.OPENAI_API_KEY |
| model* | string | — | Model identifier (e.g. gpt-4o, claude-sonnet-4-20250514). |
| maxRetries | number | 3 | Number of retry attempts if the output fails schema validation. |
| temperature | number | 0 | Sampling temperature. Defaults to 0 for deterministic structured output. |