| Name | ai-chat-chain JSON |
| Version |
0.2.3
JSON |
| download |
| home_page | |
| Summary | maintain chat conversation state |
| upload_time | 2023-08-02 04:17:30 |
| maintainer | |
| docs_url | None |
| author | erik aronesty |
| requires_python | >=3.9,<4.0 |
| license | MIT |
| keywords |
|
| VCS |
|
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# simple chat context manager
- override everything
- works with any model
- works with any prompt recovery system (simple history, embedding search, whatever)
- chains functions well
- uses ai-functions and executes them
## install
poetry add or pip install this repo, for now
## example:
```python
from ai_chat import AiConfig
# only supports openai for now, todo: add other models
from ai_chat.openai import OpenaiChat
from ai_chat.store import SupabaseStore
from ai_functions import AIFunctions
# supports SqliteStore() as well as MemoryStore() for storing the chain of prompts
store = SupabaseStore()
conf = AiConfig(id="persona-id-1", system="You are a silly friend.")
session = OpenaiChat(store=store, ai=conf, thread_id="session-1")
def search_google():
...
def get_calendar():
...
def add_calendar():
...
session.functions = AIFunctions([search_google, get_calendar, add_calendar])
print(session.chat("hello").content)
# this contains the hello, and the reply in the context
print(session.chat("cool").content)
```
Raw data
{
"_id": null,
"home_page": "",
"name": "ai-chat-chain",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "erik aronesty",
"author_email": "erik@q32.com",
"download_url": "https://files.pythonhosted.org/packages/15/fa/0e96dd5089467d0a3ab8cb24dff72f0374ebf08756f4fead46ead238d9f2/ai_chat_chain-0.2.3.tar.gz",
"platform": null,
"description": "# simple chat context manager\n\n- override everything\n- works with any model\n- works with any prompt recovery system (simple history, embedding search, whatever)\n- chains functions well\n- uses ai-functions and executes them\n\n## install\n\npoetry add or pip install this repo, for now\n\n## example:\n\n\n```python\nfrom ai_chat import AiConfig\n\n# only supports openai for now, todo: add other models\nfrom ai_chat.openai import OpenaiChat\nfrom ai_chat.store import SupabaseStore\nfrom ai_functions import AIFunctions\n\n# supports SqliteStore() as well as MemoryStore() for storing the chain of prompts\n\nstore = SupabaseStore()\nconf = AiConfig(id=\"persona-id-1\", system=\"You are a silly friend.\")\nsession = OpenaiChat(store=store, ai=conf, thread_id=\"session-1\")\n\ndef search_google():\n ...\n\ndef get_calendar():\n ...\n\ndef add_calendar():\n ...\n\nsession.functions = AIFunctions([search_google, get_calendar, add_calendar])\n\nprint(session.chat(\"hello\").content)\n\n# this contains the hello, and the reply in the context\nprint(session.chat(\"cool\").content)\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "maintain chat conversation state",
"version": "0.2.3",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0afda3f62614d9fb78835765172d180b1e51e6be470a71887a982a0b811a7145",
"md5": "3df33bda11774a1b202312d1181fc508",
"sha256": "083b4a35f148cf941939f2310fa44bc40a4837cbc8c3162ffc065b13026edef9"
},
"downloads": -1,
"filename": "ai_chat_chain-0.2.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3df33bda11774a1b202312d1181fc508",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9,<4.0",
"size": 8973,
"upload_time": "2023-08-02T04:17:29",
"upload_time_iso_8601": "2023-08-02T04:17:29.133860Z",
"url": "https://files.pythonhosted.org/packages/0a/fd/a3f62614d9fb78835765172d180b1e51e6be470a71887a982a0b811a7145/ai_chat_chain-0.2.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "15fa0e96dd5089467d0a3ab8cb24dff72f0374ebf08756f4fead46ead238d9f2",
"md5": "908d544af45b67515cb128eed7c0267a",
"sha256": "67b0bbe4afed4b4e963403f5c39602211bcea65da389031b1c1d59ea378eddbf"
},
"downloads": -1,
"filename": "ai_chat_chain-0.2.3.tar.gz",
"has_sig": false,
"md5_digest": "908d544af45b67515cb128eed7c0267a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9,<4.0",
"size": 6586,
"upload_time": "2023-08-02T04:17:30",
"upload_time_iso_8601": "2023-08-02T04:17:30.041879Z",
"url": "https://files.pythonhosted.org/packages/15/fa/0e96dd5089467d0a3ab8cb24dff72f0374ebf08756f4fead46ead238d9f2/ai_chat_chain-0.2.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-02 04:17:30",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "ai-chat-chain"
}