Skip to main content

Grinning Cat Python SDK


Grinning Cat Python SDK is a library to help the implementation of Grinning Cat on a Python Project

Installation

To install Grinning Cat Python SDK, run:

pip install grinning-cat-python-sdk

Usage

Initialization and usage:

from grinning_cat_python_sdk import GrinningCatClient, Configuration

configuration = Configuration(host="localhost", port=1865, auth_key="test", secure_connection=False)

cat_client = GrinningCatClient(configuration)

Send a message to the websocket:

from grinning_cat_python_sdk import GrinningCatClient, Configuration, Message

configuration = Configuration(host="localhost", port=1865, auth_key="test", secure_connection=False)
cat_client = GrinningCatClient(configuration)

notification_closure = lambda message: None # handle websocket notification, like chat token stream

# result is the result of the message
result = cat_client.message.send_websocket_message(
    Message(text="Hello world!"),  # message body
    "agent", # agent ID
    "user", # user ID
    callback=notification_closure # websocket notification closure handle
)

Load data to the rabbit hole:

import asyncio

from grinning_cat_python_sdk import GrinningCatClient, Configuration, Message

configuration = Configuration(host="localhost", port=1865, auth_key="test", secure_connection=False)
cat_client = GrinningCatClient(configuration)

# file
file = "path/to/file"
result = asyncio.run(cat_client.rabbit_hole.post_file(file, "agent"))

# url
url = "https://www.google.com"
result = asyncio.run(cat_client.rabbit_hole.post_web(url, "agent"))

Memory management utilities:

from grinning_cat_python_sdk import GrinningCatClient, Configuration, Message

configuration = Configuration(host="localhost", port=1865, auth_key="test", secure_connection=False)
cat_client = GrinningCatClient(configuration)

cat_client.memory.get_memory_collections("agent")  # get number of vectors in the working memory
cat_client.memory.get_memory_recall("HELLO", "agent", "user")  # recall memories by text

url = "https://www.google.com"

# delete memory points by metadata, like this example delete by source
cat_client.memory.delete_memory_points_by_metadata("declarative", "agent", {"source": url})

Release files for grinning-cat-python-sdk 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for grinning-cat-python-sdk 1.0.4
File Size Uploaded
grinning_cat_python_sdk-1.0.4.tar.gz 43.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for grinning-cat-python-sdk 1.0.4
File Interpreter ABI Platform
grinning_cat_python_sdk-1.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 105.5 kB

Release files / grinning_cat_python_sdk-1.0.4.tar.gz

Download URL grinning_cat_python_sdk-1.0.4.tar.gz
Size 43.3 kB
Tags Source
SHA-256 checksum
How to use checksums
21d1c6185a698c150c27ad4f92228eb927b64f8eea8259e7bc6b87c4ff2f0835
BLAKE2b-256 checksum
How to use checksums
8c2607896b404d1281c292856505a2e08a51c233cda5ecc9de3931b7559203ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / grinning_cat_python_sdk-1.0.4-py3-none-any.whl

Download URL grinning_cat_python_sdk-1.0.4-py3-none-any.whl
Size 62.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ec46706ef199cf9c75029cfddfaf103f3d7a3b10c83291b4b4b4ff8d7ecd238b
BLAKE2b-256 checksum
How to use checksums
47b546ab6ecb895d637495db85b19f2cee527f24c79f25aefd0021b6c99fc396
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

1.0.5

2 release files

This release

1.0.4 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page