{"id":20674902,"url":"https://github.com/cheshire-cat-ai/api-client-py","last_synced_at":"2025-07-17T02:37:14.367Z","repository":{"id":184538449,"uuid":"671903772","full_name":"cheshire-cat-ai/api-client-py","owner":"cheshire-cat-ai","description":"API Client to communicate with the Cheshire Cat AI ","archived":false,"fork":false,"pushed_at":"2025-04-14T04:14:45.000Z","size":1129,"stargazers_count":18,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-14T05:25:48.850Z","etag":null,"topics":["api-client","cheshire-cat","llm","openapi-generator","pip","pydantic-models","pypi-package","python","pythonpackage"],"latest_commit_sha":null,"homepage":"https://cheshire-cat-ai.github.io/api-client-py/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cheshire-cat-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-28T12:08:31.000Z","updated_at":"2025-02-05T13:48:53.000Z","dependencies_parsed_at":"2023-11-13T21:29:15.621Z","dependency_job_id":"8c74e9bf-895a-4b11-9633-df6f4674645c","html_url":"https://github.com/cheshire-cat-ai/api-client-py","commit_stats":null,"previous_names":["cheshire-cat-ai/cheshire-cat-api","cheshire-cat-ai/api-client-py"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheshire-cat-ai%2Fapi-client-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheshire-cat-ai%2Fapi-client-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheshire-cat-ai%2Fapi-client-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheshire-cat-ai%2Fapi-client-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cheshire-cat-ai","download_url":"https://codeload.github.com/cheshire-cat-ai/api-client-py/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249794847,"owners_count":21326775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","cheshire-cat","llm","openapi-generator","pip","pydantic-models","pypi-package","python","pythonpackage"],"created_at":"2024-11-16T21:08:02.830Z","updated_at":"2025-04-19T20:33:56.628Z","avatar_url":"https://github.com/cheshire-cat-ai.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cheshire Cat API client\nAPI to develop Python clients to interact with the Cheshire Cat.\n\nThe package allows instantiating a [WebSocket](#documentation-for-websocket) client and provides the API to interact with all the [endpoints](#documentation-for-api-endpoints).\n\nA part of this Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project.\n\nFor deeper documentation about the available endpoints, please refer to the API [ReDoc](http://localhost:1865/redoc).\nThe official Cheshire Cat documentation is available [here](https://cheshire-cat-ai.github.io/docs/).\n\n## Requirements.\n\nPython 3.10\n\n## Installation \u0026 Usage\n### pip install\n\nYou can install the API with `pip`:\n\n```sh\npip install cheshire-cat-api\n```\n\nThen import the package:\n```python\nimport cheshire_cat_api as ccat\n```\n\n[//]: # (### Tests)\n\n[//]: # ()\n[//]: # (Execute `pytest` to run the tests.)\n\n### Interact with the HTTP Endpoints\n\n## Available APIs\n\nThe `CatClient` has the following attributes to easily interface with the related APis:\n\n- memory\n- plugins\n- rabbit_hole\n- status\n- embedder\n- settings\n- llm\n\n#### Instantiate connection\n\n```python\nimport cheshire_cat_api as ccat\n\n# A config is necessary to set up base parameters like\n# URL, port, user_id, etc.\nconfig = ccat.Config(user_id=\"my_user_42\")\n\n# Connect to the API\ncat_client = ccat.CatClient(\n    config=config\n)\n```\n\n#### Plugin API - Retrieve plugins\n\n```python\n# Now retrieve a list of the available plugins\nplugins = cat_client.plugins.get_available_plugins()\n```\n\n#### RabbitHole API - Upload a URL\n\n```python\nfrom cheshire_cat_api.models.body_upload_url import BodyUploadUrl\n\n# Please note that interacting with the RabbitHole to upload\n# a URL requires structuring the body like this\n\nbody_upload_url = BodyUploadUrl(\n    url=\"https://cheshire-cat-ai.github.io/docs/conceptual/cheshire_cat/rabbit_hole/\"\n)\n\n# then you can make the request as follows\nresponse = cat_client.rabbit_hole.upload_url(body_upload_url)\n```\n\n### Send a WebSocket message\n\n```python\nimport time\nimport cheshire_cat_api as ccat\n\n# A config is necessary to set up base parameters like\n# URL, port, user_id, etc.\nconfig = ccat.Config(user_id=\"my_user_42\")\ncat_client = ccat.CatClient(config=config)\n\n# Connect to the WebSocket API\ncat_client.connect_ws()\n\nwhile not cat_client.is_ws_connected: \n# A better handling is strongly advised to avoid an infinite loop \n    time.sleep(1)\n    \n# Send the message\ncat_client.send(message=\"Hello Cat!\")\n\n# Close connection\ncat_client.close()\n```\n\n## Documentation for Config\n\nBoth the classes are available with:\n```python\nfrom cheshire_cat_api import Config\n```\n\n| Class    | Name                | Default     | Description                               |\n|----------|---------------------|-------------|-------------------------------------------|\n| *Config* | `base_url`          | \"localhost\" | base URL where the Cat is hosted          |\n| *Config* | `port`              | 1865        | port for the connection                   |\n| *Config* | `user_id`           | \"user\"      | id of the client                          |\n| *Config* | `auth_key`          | \"\"          | authentication key for the http endpoints |\n| *Config* | `secure_connection` | False       | if to use secure protocol                 |\n\n## Low-level API\n\nFor a more advanced usage, you can directly interact with the auto-generated client.\nFor documentation see [here](mkdocs/)\n\n[//]: # (## Documentation for API Endpoints)\n\n[//]: # ()\n[//]: # (All URIs are relative to *http://localhost*)\n\n[//]: # ()\n[//]: # (| Class                           | Method        | HTTP request                                            | Description                 |)\n\n[//]: # (|---------------------------------|---------------|---------------------------------------------------------|-----------------------------|)\n\n[//]: # (| *MemoryApi*                     | **wipe_memory_point** | **DELETE** /memory/point/{collection_id}/{memory_id}/   | Delete Element In Memory    |)\n\n[//]: # (| *MemoryApi*                     | **get_collections** | **GET** /memory/collections/                            | Get Collections             |)\n\n[//]: # (| *MemoryApi*                     | **recall_memories_from_text** | **GET** /memory/recall/                                 | Recall Memories From Text   |)\n\n[//]: # (| *MemoryApi*                     | **wipe_collections** | **DELETE** /memory/wipe-collections/                    | Wipe Collections            |)\n\n[//]: # (| *MemoryApi*                     | **wipe_conversation_history** | **DELETE** /memory/working-memory/conversation-history/ | Wipe Conversation History   |)\n\n[//]: # (| *MemoryApi*                     | **wipe_single_collection** | **DELETE** /memory/collections/{collection_id}          | Wipe Single Collection      |)\n\n[//]: # (| *MemoryApi*                    | **get_conversation_history** | **GET** /memory/conversation_history/ |)\n\n[//]: # (| **Memory**)\n\n[//]: # (| *PluginsApi*                    | **delete_plugin** | **DELETE** /plugins/{plugin_id}                         | Delete Plugin               |)\n\n[//]: # (| *PluginsApi*                    | **get_plugin_details** | **GET** /plugins/{plugin_id}                            | Get Plugin Details          |)\n\n[//]: # (| *PluginsApi*                    | **get_plugin_settings** | **GET** /plugins/settings/{plugin_id}                   | Get Plugin Settings         |)\n\n[//]: # (| *PluginsApi*                    | **install_plugin** | **POST** /plugins/upload/                               | Install Plugin              |)\n\n[//]: # (| *PluginsApi*                    | **list_available_plugins** | **GET** /plugins/                                       | List Available Plugins      |)\n\n[//]: # (| *PluginsApi*                    | **toggle_plugin** | **PUT** /plugins/toggle/{plugin_id}                     | Toggle Plugin               |)\n\n[//]: # (| *PluginsApi*                    | **upsert_plugin_settings** | **PUT** /plugins/settings/{plugin_id}                   | Upsert Plugin Settings      |)\n\n[//]: # (| *RabbitHoleApi*                 | **upload_file** | **POST** /rabbithole/                                   | Upload File                 |)\n\n[//]: # (| *RabbitHoleApi*                 | **upload_memory** | **POST** /rabbithole/memory/                            | Upload Memory               |)\n\n[//]: # (| *RabbitHoleApi*                 | **upload_url** | **POST** /rabbithole/web/                               | Upload Url                  |)\n\n[//]: # (| *SettingsEmbedderApi*           | **get_embedder_settings** | **GET** /settings/embedder/                             | Get Embedder Settings       |)\n\n[//]: # (| *SettingsEmbedderApi*           | **upsert_embedder_setting** | **PUT** /settings/embedder/{languageEmbedderName}       | Upsert Embedder Setting     |)\n\n[//]: # (| *SettingsGeneralApi*            | **create_setting** | **POST** /settings/                                     | Create Setting              |)\n\n[//]: # (| *SettingsGeneralApi*            | **delete_setting** | **DELETE** /settings/{settingId}                        | Delete Setting              |)\n\n[//]: # (| *SettingsGeneralApi*            | **get_setting** | **GET** /settings/{settingId}                           | Get Setting                 |)\n\n[//]: # (| *SettingsGeneralApi*            | **get_settings** | **GET** /settings/                                      | Get Settings                |)\n\n[//]: # (| *SettingsGeneralApi*            | **update_setting** | **PUT** /settings/{settingId}                           | Update Setting              |)\n\n[//]: # (| *SettingsLargeLanguageModelApi* | **get_llm_settings** | **GET** /settings/llm/                                  | Get Llm Settings            |)\n\n[//]: # (| *SettingsLargeLanguageModelApi* | **upsert_llm_setting** | **PUT** /settings/llm/{languageModelName}               | Upsert Llm Setting          |)\n\n[//]: # (| *SettingsPromptApi*             | **get_default_prompt_settings** | **GET** /settings/prompt/                               | Get Default Prompt Settings |)\n\n[//]: # (| *StatusApi*                     | **home**      | **GET** /                                               | Home                        |)\n\n[//]: # (## Documentation For Models)\n\n[//]: # ()\n[//]: # ( - [BodyUploadUrl]\u0026#40;docs/BodyUploadUrl.md\u0026#41;)\n\n[//]: # ( - [HTTPValidationError]\u0026#40;docs/HTTPValidationError.md\u0026#41;)\n\n[//]: # ( - [LocationInner]\u0026#40;docs/LocationInner.md\u0026#41;)\n\n[//]: # ( - [SettingBody]\u0026#40;docs/SettingBody.md\u0026#41;)\n\n[//]: # ( - [ValidationError]\u0026#40;docs/ValidationError.md\u0026#41;)\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheshire-cat-ai%2Fapi-client-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcheshire-cat-ai%2Fapi-client-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheshire-cat-ai%2Fapi-client-py/lists"}