Name | tg-jarv-dialogue-manager JSON |
Version |
0.1.7
JSON |
| download |
home_page | None |
Summary | Jarv AI клиент и диалог-менеджер для Telegram с хранением истории в ClickHouse |
upload_time | 2025-08-21 08:34:28 |
maintainer | None |
docs_url | None |
author | Александр Гаганов |
requires_python | >=3.10 |
license | MIT License
Copyright (c) 2025
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
|
keywords |
jarv
telegram
clickhouse
dialogue
chat
asyncio
httpx
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# tg-jarv-dialogue-manager
Асинхронный клиент Jarv AI и диалог-менеджер с хранением истории в ClickHouse.
## Установка
```bash
pip install tg-jarv-dialogue-manager
```
Опционально для Telegram:
```bash
pip install "tg-jarv-dialogue-manager[telegram]"
```
## Быстрый старт
```python
import asyncio
from tg_jarv_dialogue_manager import JarvDialogueManager
async def main():
dm = JarvDialogueManager(
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="dialogue_history",
pairs_limit=10,
char_soft_limit=2000,
payload_base={"profect_id": "12abcd3e-4f5g-1111-aaaa-1111abc22de3"},
)
answer = await dm.ask(tg_id=123456789, user_text="Привет!")
print(answer)
await dm.close()
asyncio.run(main())
```
## Схема ClickHouse по умолчанию
```sql
CREATE TABLE IF NOT EXISTS dialogue_history (
tg_id UInt64,
bot_name String,
seq_in_dialogue UInt32,
role LowCardinality(String),
content String,
created_at DateTime DEFAULT now()
) ENGINE = MergeTree
ORDER BY (tg_id, bot_name, seq_in_dialogue)
TTL created_at + INTERVAL 14 DAY;
```
## Поддержка
Issues и PR приветствуются.
Raw data
{
"_id": null,
"home_page": null,
"name": "tg-jarv-dialogue-manager",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "jarv, telegram, clickhouse, dialogue, chat, asyncio, httpx",
"author": "\u0410\u043b\u0435\u043a\u0441\u0430\u043d\u0434\u0440 \u0413\u0430\u0433\u0430\u043d\u043e\u0432",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/a1/95/e0ad92c3c40ae13996943735436158784495e87b067c6913a76f2c7d2e90/tg_jarv_dialogue_manager-0.1.7.tar.gz",
"platform": null,
"description": "# tg-jarv-dialogue-manager\n\n\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442 Jarv AI \u0438 \u0434\u0438\u0430\u043b\u043e\u0433-\u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0441 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u0432 ClickHouse.\n\n## \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430\n\n```bash\npip install tg-jarv-dialogue-manager\n```\n\n\u041e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f Telegram:\n```bash\npip install \"tg-jarv-dialogue-manager[telegram]\"\n```\n\n## \u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u0442\u0430\u0440\u0442\n\n```python\nimport asyncio\nfrom tg_jarv_dialogue_manager import JarvDialogueManager\n\nasync def main():\n dm = JarvDialogueManager(\n bot_name=\"DiscountBot\",\n model=\"gpt-4o-mini\",\n user_id=\"bot@synergetic\",\n jarv_api_key=\"...\",\n jarv_endpoint=\"https://api.jarv.tech/v1/chat\",\n clickhouse_url=\"http://localhost:8123\",\n clickhouse_database=\"jarv\",\n clickhouse_user=None,\n clickhouse_password=None,\n table=\"dialogue_history\",\n pairs_limit=10,\n char_soft_limit=2000,\n payload_base={\"profect_id\": \"12abcd3e-4f5g-1111-aaaa-1111abc22de3\"},\n )\n answer = await dm.ask(tg_id=123456789, user_text=\"\u041f\u0440\u0438\u0432\u0435\u0442!\")\n print(answer)\n await dm.close()\n\nasyncio.run(main())\n```\n\n## \u0421\u0445\u0435\u043c\u0430 ClickHouse \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e\n\n```sql\nCREATE TABLE IF NOT EXISTS dialogue_history (\n tg_id UInt64,\n bot_name String,\n seq_in_dialogue UInt32,\n role LowCardinality(String),\n content String,\n created_at DateTime DEFAULT now()\n) ENGINE = MergeTree\nORDER BY (tg_id, bot_name, seq_in_dialogue)\nTTL created_at + INTERVAL 14 DAY;\n```\n\n## \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430\n\nIssues \u0438 PR \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442\u0441\u044f.\n",
"bugtrack_url": null,
"license": "MIT License\n \n Copyright (c) 2025\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n ",
"summary": "Jarv AI \u043a\u043b\u0438\u0435\u043d\u0442 \u0438 \u0434\u0438\u0430\u043b\u043e\u0433-\u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0434\u043b\u044f Telegram \u0441 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u0432 ClickHouse",
"version": "0.1.7",
"project_urls": {
"Homepage": "https://pypi.org/project/tg-jarv-dialogue-manager/",
"Issues": "https://github.com/GaganovAlexander/tg-jarv-dialogue-manager/issues",
"Repository": "https://github.com/GaganovAlexander/tg-jarv-dialogue-manager"
},
"split_keywords": [
"jarv",
" telegram",
" clickhouse",
" dialogue",
" chat",
" asyncio",
" httpx"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "92662fc376a390a13eb70161066fb896c2ee25e9f93f7be3748a4cd13a25d553",
"md5": "57f8c228b6d2e2271da1d31ddf4edd94",
"sha256": "2510ede07dd4598bf8e19deb60950d1f9f20f726d47d335a31ed6c315098d34a"
},
"downloads": -1,
"filename": "tg_jarv_dialogue_manager-0.1.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "57f8c228b6d2e2271da1d31ddf4edd94",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 8200,
"upload_time": "2025-08-21T08:34:27",
"upload_time_iso_8601": "2025-08-21T08:34:27.327588Z",
"url": "https://files.pythonhosted.org/packages/92/66/2fc376a390a13eb70161066fb896c2ee25e9f93f7be3748a4cd13a25d553/tg_jarv_dialogue_manager-0.1.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "a195e0ad92c3c40ae13996943735436158784495e87b067c6913a76f2c7d2e90",
"md5": "e94dcef99bdc7d515647d853594b05a6",
"sha256": "c99e07aebb2b7fb936a3423ea8ddfe753f12081789b7aeea204e72d83c80179c"
},
"downloads": -1,
"filename": "tg_jarv_dialogue_manager-0.1.7.tar.gz",
"has_sig": false,
"md5_digest": "e94dcef99bdc7d515647d853594b05a6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 7737,
"upload_time": "2025-08-21T08:34:28",
"upload_time_iso_8601": "2025-08-21T08:34:28.577273Z",
"url": "https://files.pythonhosted.org/packages/a1/95/e0ad92c3c40ae13996943735436158784495e87b067c6913a76f2c7d2e90/tg_jarv_dialogue_manager-0.1.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-21 08:34:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "GaganovAlexander",
"github_project": "tg-jarv-dialogue-manager",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "tg-jarv-dialogue-manager"
}