Skip to main content

Zoe LLM / ClickHouse DB helpers

Project description

Craydel Database Wrapper

is a lightweight Python SDK for storing, retrieving, and managing student–counsellor chat data in ClickHouse. It also includes AI-powered conversation summarization to make student profiles easier to understand and hand over between advisors.

Installation

Use the package manager pip to install foobar.

pip install dspy==2.6.27
pip install python-dotenv==1.1.1
google-cloud-aiplatform==1.106.0
pip install clickhouse-connect

Usage

Insert and fetch chats

from craydel_zoe_llm import ChatService, ClickhouseHelper
from datetime import datetime

# Setup database helper + chat service
db = ClickhouseHelper()
chat = ChatService(db)

# Insert a new chat message
chat.insert_chat_message(
    session_id="12345",
    speaker="Student",
    message="I want to study in Canada",
    chat_details="Web",
    message_id="msg_001",
    created_at=datetime.utcnow(),
)

# Retrieve last messages in the session
last_messages = chat.get_last_messages(session_id="12345")
print("Last messages:", last_messages)

Summarize a conversation

from craydel_zoe_llm.services.chat_summarizer import StudentConversationProcessor

summarizer = StudentConversationProcessor()

# Run summarizer for a given session
summarizer.process("12345")

print("✅ Conversation summarized and saved to ClickHouse")

env

CLICKHOUSE_DATABASE=
CLICKHOUSE_HOST=
CLICKHOUSE_USER=
CLICKHOUSE_PASSWORD=
CLICKHOUSE_PORT=8123

GOOGLE_APPLICATION_CREDENTIALS=(google credential json)
VERTEX_MODEL=
VERTEX_PROJECT_ID=
VERTEX_LOCATION=

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

craydel_database_wrapper-0.0.1.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

craydel_database_wrapper-0.0.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file craydel_database_wrapper-0.0.1.tar.gz.

File metadata

File hashes

Hashes for craydel_database_wrapper-0.0.1.tar.gz
Algorithm Hash digest
SHA256 657bfd83dd1bddc3a57d48f136c3f145d455ae5196f7c6509980ddc48988cccf
MD5 3811e91430aabb07b7e4ccc131d9516d
BLAKE2b-256 bad91e5f0f44ac4322d0c992a04231b15a2de8db6d862530f84261d3e99a2d69

See more details on using hashes here.

File details

Details for the file craydel_database_wrapper-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for craydel_database_wrapper-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6e273ac9419d8214c3de5036db2c20dd16d65b54601b773cd87906405679d566
MD5 9cd799ee93a635f564e8bcd987cfa2ca
BLAKE2b-256 42ecc8140722869d9f7da0387483a593d0fdd99ccae406c11774c34cc4ba0087

See more details on using hashes here.

Supported by

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