Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement structured generators #19

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

JanPokorny
Copy link
Contributor

Replace generateStructured method by a separate ChatLLM polymorphic wrapper. The original functionality of generateStructured is replaced by JsonSchemaGenerator, as evidenced by the example structured.ts. Furthermore, there's JsonTypeGenerator that demonstrates the schema to the LLM as a TypeScript type instead of raw JSONSchema (some models like it better), and YamlSchemaGenerator which uses YAML for both presenting the schema and the response format.

@JanPokorny JanPokorny force-pushed the janpokorny/feat-implement-structured-generators branch from cc563ca to fca8ea8 Compare September 10, 2024 18:28
@JanPokorny JanPokorny changed the title Implement structured generators feat: implement structured generators Sep 10, 2024
@JanPokorny JanPokorny force-pushed the janpokorny/feat-implement-structured-generators branch from fca8ea8 to 2f89572 Compare September 10, 2024 18:33
examples/llms/structured.ts Outdated Show resolved Hide resolved
src/generators/baseGenerator.ts Outdated Show resolved Hide resolved
src/generators/baseGenerator.ts Outdated Show resolved Hide resolved
@JanPokorny JanPokorny force-pushed the janpokorny/feat-implement-structured-generators branch 2 times, most recently from 29b2986 to 3535206 Compare September 11, 2024 14:37
@JanPokorny JanPokorny force-pushed the janpokorny/feat-implement-structured-generators branch from 3535206 to a9038e8 Compare September 11, 2024 15:51
src/drivers/base.ts Outdated Show resolved Hide resolved
@JanPokorny JanPokorny force-pushed the janpokorny/feat-implement-structured-generators branch from a9038e8 to ecbb1e2 Compare September 11, 2024 16:30
@Tomas2D Tomas2D merged commit f38cee4 into main Sep 13, 2024
1 check passed
@Tomas2D Tomas2D deleted the janpokorny/feat-implement-structured-generators branch September 13, 2024 11:11
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.

2 participants