Jarv AI клиент и диалог-менеджер для Telegram с хранением истории в ClickHouse
Project description
tg-jarv-dialog-manager
Асинхронный клиент Jarv AI и диалог-менеджер с хранением истории в ClickHouse.
Установка
pip install tg-jarv-dialog-manager
Опционально для Telegram:
pip install tg-jarv-dialog-manager[telegram]
Быстрый старт
import asyncio
from tg_jarv_dialog_manager import JarvDialogManager
async def main():
dm = JarvDialogManager(
bot_name="DiscountBot",
model="gpt-4o-mini",
user_id="bot@synergetic",
jarv_api_key="...",
jarv_endpoint="https://api.jarv.tech/v1/chat",
clickhouse_url="http://localhost:8123",
clickhouse_database="jarv",
clickhouse_user=None,
clickhouse_password=None,
table="dialog_history",
system_prompt="Ты — дружелюбный помощник.",
pairs_limit=10,
char_soft_limit=8000,
payload_base={"temperature": 0.2},
)
answer = await dm.ask(tg_id=123456789, user_text="Привет!")
print(answer)
await dm.close()
asyncio.run(main())
Схема ClickHouse по умолчанию
CREATE TABLE IF NOT EXISTS dialog_history (
tg_id UInt64,
bot_name String,
seq_in_dialog UInt32,
role LowCardinality(String),
content String,
created_at DateTime DEFAULT now()
) ENGINE = MergeTree
ORDER BY (tg_id, bot_name, seq_in_dialog);
Поддержка
Issues и PR приветствуются.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tg_jarv_dialogue_manager-0.1.2.tar.gz.
File metadata
- Download URL: tg_jarv_dialogue_manager-0.1.2.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f89c717601102362366bbe6a6110b8925f40a2c26be5bf6edae50b585127fe63
|
|
| MD5 |
0335d13377a3a88aec544b986ff3560a
|
|
| BLAKE2b-256 |
ce52465194c65cc5d7ba117d0592e9e9d1ee6262eabfa61179f2f2f2da48bafc
|
File details
Details for the file tg_jarv_dialogue_manager-0.1.2-py3-none-any.whl.
File metadata
- Download URL: tg_jarv_dialogue_manager-0.1.2-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd548db9111356a237433ed3a2f41068b59aefac501d438ee386243ba2dd63e2
|
|
| MD5 |
b8d2ff7a9e9f6efb5a9600e82fa3f2f0
|
|
| BLAKE2b-256 |
916990c35835f29e4ca471d9e68c6290428d3150801896010d08cb47b8a39a2d
|