chainlit
chainlit copied to clipboard
[WIP] - SQL Model Data Layer
trafficstars
[!CAUTION] This is currently a mockup and incomplete. This has not been tested and will not run.
This is an initial draft for consolidating all SQL data layers using FastAPI's sqlmodel (Pydantic + SQL Alchemy).
For now I have created the new models in a new models/ directory and are duplicated from step.py, element.py, etc. The idea would be to delete those once this is ready.
The main reasons for this change are:
- Enable everyone who wants to use SQL data persistence to use a single implementation.
- Reduce technical debt and bugs, and speed up future development.
replaces #1365
Notes:
- sqlmodel reserves the 'metadata' field for internal purposes and cannot be changed, so in Threads/Steps/User we have to rename this to something else so for now it's
metadata_instead, then aliased for proper database and API usage.