Skip to content

Conversation

mmoskal
Copy link

@mmoskal mmoskal commented Apr 24, 2025

This is a little experiment, to possibly allow using structured outputs with TypeChat.

Note that you would want to only use this as a grammar for constraining the output, not pass the schema to the model - the TypeScript file is probably much better for this, as the schema is 3x bigger than TypeScript source (with indentation; without indentation schema is 1.5x bigger). OpenAI-compatible endpoints will often pass the schema to the model using chat template.

This works for all example schemas (excluding Zod, but it can be handled natively I guess) and all schemas in TypeAgent.

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