Skip to main content

This is a simple Tree based database to store chats logs for a large language model. to save ollama or any other llm app chat history

Project description

chatlogger

chatlogger is a simple Tree based database to store chats logs for a large language model. to save ollama or any other llm app chat history

Install Using pip install chatlogger-db

DEMO

from chatlogger-db import DataBase, Message, Chat, RESPONSE, PROMPT
if __name__ == '__main__':
    db = DataBase()
    # db.load(r"dataset.bin")
    # db.save(r"main.bin")
    # print(db)
    # chat = db[2]
    idx = db.new_chat()
    chat = db[idx]
    print(chat)
    chat.new_message("Hello", "World!")
    chat.regenerate_last("hey")
    chat.edit_last("ss", "you!")
    chat.edit_last("i", "you!")
    chat.new_message("Hello", "World!")
    chat.new_message("Hello", "World!")
    chat.edit_last("i", "you!")
    chat.prev_prompt_last()
    chat.regenerate_last("hey2")
    chat.next_prompt_last()
    chat.prev_prompt_last()
    chat.edit(3, "asd", "res")
    chat.regenerate(2, "res2")
    chat.modify(2, "ajasd")
    chat.regenerate(2, "res2")
    chat.prev(2)
    chat.prev(2)
    chat.prev(1)
    chat.set_next_idx(0, 2)
    print(repr(chat))
    print(chat.curr_neighbours(1))
    print(chat.__len__())
    print(chat[0])
    print(chat[1])

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chatlogger-db-0.1.2.tar.gz (3.5 kB view details)

Uploaded Source

File details

Details for the file chatlogger-db-0.1.2.tar.gz.

File metadata

  • Download URL: chatlogger-db-0.1.2.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for chatlogger-db-0.1.2.tar.gz
Algorithm Hash digest
SHA256 aed87d4b6f2d1e1c5741e919b014bb33f1a9f2ef740467c1ecdac8fb1577abec
MD5 9f3e754daa4596b5cb3ec85cd4e4fd18
BLAKE2b-256 7d64b83691a01f6f44e46e9f8868bff61d0a5ed89569a80841795a60de7f2b9a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page