Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

A collection of data layers for Chainlit, persist state on your own infrastructure!

License

Notifications You must be signed in to change notification settings

aniruddha-adhikary/lit-data-layers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lit-data-layers

🔴 NOW HAVE OFFICIAL SUPPORT FOR PostgreSQL DB 🔴

👉 https://docs.chainlit.io/data-persistence/custom 👈

THIS PROJECT IS NOW DEAD!

Provides Custom Data Layer for Chainlit apps. Supports multiple databases and data stores.

Installation

PostgreSQL

Note: Make sure you have libpq-dev / postgresql installed.

pip install "lit-data-layers[postgres]"
export LIT_DATABASE_URL=postgresql+asyncpg://user:pass@localhost/test

SQLite

pip install "lit-data-layers[sqlite]"
export LIT_DATABASE_URL=sqlite+aiosqlite:///db.sqlite3

Usage

import asyncio

import chainlit.data as cl_data
from lit_data_layers.sqldb import SqlDataLayer

layer = SqlDataLayer()
asyncio.get_event_loop().run_until_complete(layer.initialize_database())
cl_data._data_layer = layer

Compatibility Chart

Features that have been tested.

Method SQLite PostgreSQL
get_user
create_user
delete_user_session
upsert_feedback
create_element
get_element
delete_element
create_step
update_step
delete_step
get_thread
get_thread_author
delete_thread
list_threads
update_thread

About

A collection of data layers for Chainlit, persist state on your own infrastructure!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages