Code Monkey home page Code Monkey logo

lit-data-layers's Introduction

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 โœ…

lit-data-layers's People

Contributors

aniruddha-adhikary avatar dependabot[bot] avatar

Stargazers

George Okello avatar ROHIT MISHRA avatar Beckett avatar

Watchers

 avatar Kostas Georgiou avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.