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(Instructor): integrate with SQLModel, provide documentation and example #418

Merged
merged 4 commits into from
Feb 9, 2024

Conversation

shanktt
Copy link
Collaborator

@shanktt shanktt commented Feb 9, 2024

Ellipsis 🚀 This PR description was created by Ellipsis for commit eab54e6.

Summary:

This PR integrates Instructor with SQLModel, providing documentation and an example on how to define models, generate records using OpenAI, and insert the responses into a database.

Key points:

  • Added a new documentation file /docs/concepts/sqlmodel.md explaining the integration of Instructor with SQLModel.
  • Defined a Hero model in both the documentation and the example.
  • Demonstrated how to generate a Hero record using OpenAI in the create_hero function.
  • Showed how to insert the generated record into a database.
  • Included a runnable example in /examples/sqlmodel/run.py demonstrating the process.

Generated with ❤️ by ellipsis.dev

@ellipsis-dev ellipsis-dev bot changed the title ... feat(Instructor): integrate with SQLModel, provide documentation and example Feb 9, 2024
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!


Something look wrong? You can customize Ellipsis by editing the ellipsis.yaml for this repository.

Generated with ❤️ by ellipsis.dev

@jxnl
Copy link
Owner

jxnl commented Feb 9, 2024

How are you liking ...

@jxnl
Copy link
Owner

jxnl commented Feb 9, 2024

Can you move this to examples / cookbooks for now.

@shanktt
Copy link
Collaborator Author

shanktt commented Feb 9, 2024

How are you liking ...

Definitely better than what I'd write myself lol

mkdocs.yml Outdated Show resolved Hide resolved


# Define the model that will serve as a Table for the database
class Hero(SQLModel, instructor.OpenAISchema, table=True):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to name this OpenAISchema its so long.

@jxnl jxnl merged commit 805161b into jxnl:main Feb 9, 2024
6 of 7 checks passed
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