Skip to main content

lit-data-layers

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

Release files for lit-data-layers 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lit-data-layers 0.1.4
File Size Uploaded
lit_data_layers-0.1.4.tar.gz 10.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lit-data-layers 0.1.4
File Interpreter ABI Platform
lit_data_layers-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 22.2 kB

Release files / lit_data_layers-0.1.4.tar.gz

Download URL lit_data_layers-0.1.4.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
986e4126d91adf49d1cdeacbfc5637b9932916ece98c3e65fafde6b396149fda
BLAKE2b-256 checksum
How to use checksums
f8c9e0cae230c3254b71794d965207d97597ce83f593813a097f4a9bf027dbb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.12.2 Darwin/23.3.0

Release files / lit_data_layers-0.1.4-py3-none-any.whl

Download URL lit_data_layers-0.1.4-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ae31b26f47c79657438aa246191c91cffc3bf0833373e3d962178d3fa979e9c3
BLAKE2b-256 checksum
How to use checksums
8c34568825745da0ff5cf267d97a8f85249ad9d4edb6b27e1b59c61ff97961e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.12.2 Darwin/23.3.0

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page