cheshirecat-python-sdk 1.8.2__tar.gz → 1.8.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/PKG-INFO +1 -1
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/endpoints/memory.py +28 -1
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/models/dtos.py +11 -1
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/pyproject.toml +1 -1
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/.gitignore +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/LICENSE +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/Makefile +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/README.md +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/__init__.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/builders/__init__.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/builders/base.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/builders/memory.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/builders/settings_input.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/builders/why.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/client.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/clients/__init__.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/clients/http_client.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/clients/websocket_client.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/configuration.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/endpoints/__init__.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/endpoints/admins.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/endpoints/agentic_workflow.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/endpoints/auth.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/endpoints/auth_handler.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/endpoints/base.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/endpoints/chunker.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/endpoints/conversation.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/endpoints/custom_endpoint.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/endpoints/embedder.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/endpoints/file_manager.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/endpoints/health_check.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/endpoints/large_language_model.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/endpoints/message.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/endpoints/plugins.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/endpoints/rabbit_hole.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/endpoints/users.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/endpoints/utils.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/endpoints/vector_database.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/enums.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/models/api/admins.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/models/api/conversations.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/models/api/factories.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/models/api/file_managers.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/models/api/memories.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/models/api/messages.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/models/api/nested/memories.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/models/api/nested/plugins.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/models/api/plugins.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/models/api/rabbit_holes.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/models/api/tokens.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/models/api/users.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/utils.py +0 -0
- {cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/requirements.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cheshirecat-python-sdk
|
|
3
|
-
Version: 1.8.
|
|
3
|
+
Version: 1.8.4
|
|
4
4
|
Summary: Python SDK for the Cloud-ready fork of the Cheshire Cat
|
|
5
5
|
Project-URL: Repository, https://github.com/matteocacciola/cheshirecat-python-sdk
|
|
6
6
|
Project-URL: Documentation, https://github.com/matteocacciola/cheshirecat-python-sdk#README
|
|
@@ -12,7 +12,7 @@ from cheshirecat_python_sdk.models.api.memories import (
|
|
|
12
12
|
MemoryPointsOutput,
|
|
13
13
|
)
|
|
14
14
|
from cheshirecat_python_sdk.models.api.nested.memories import CollectionsItem
|
|
15
|
-
from cheshirecat_python_sdk.models.dtos import Why, MemoryPoint
|
|
15
|
+
from cheshirecat_python_sdk.models.dtos import Why, MemoryPoint, FilterSource
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
class MemoryEndpoint(AbstractEndpoint):
|
|
@@ -242,4 +242,31 @@ class MemoryEndpoint(AbstractEndpoint):
|
|
|
242
242
|
query=query,
|
|
243
243
|
)
|
|
244
244
|
|
|
245
|
+
def has_source(self, agent_id: str, filter_source: FilterSource, chat_id: str | None = None) -> bool:
|
|
246
|
+
"""
|
|
247
|
+
Checks if the given filter source exists for a specified agent.
|
|
248
|
+
|
|
249
|
+
This method determines whether a specific source, defined by the given filter_source, is associated with the
|
|
250
|
+
provided agent in the memory database.
|
|
251
|
+
It optionally considers a specific chat ID when filtering the data. The result indicates the existence of such a
|
|
252
|
+
source.
|
|
253
|
+
|
|
254
|
+
Args:
|
|
255
|
+
agent_id: Unique identifier of the agent for which the check is performed.
|
|
256
|
+
filter_source: FilterSource object that defines the source or hash to check.
|
|
257
|
+
chat_id: An optional chat identifier to narrow the scope of the check. If not provided, the check will
|
|
258
|
+
operate in a broader context.
|
|
259
|
+
|
|
260
|
+
Returns:
|
|
261
|
+
A boolean value indicating whether the specified filter source exists in the agent's memory database.
|
|
262
|
+
"""
|
|
263
|
+
metadata = {"source": filter_source.source} if filter_source.source else {"hash": filter_source.hash}
|
|
264
|
+
if chat_id:
|
|
265
|
+
metadata["chat_id"] = chat_id
|
|
266
|
+
|
|
267
|
+
collection_name = "declarative" if chat_id is None else "episodic"
|
|
268
|
+
points = self.get_memory_points(collection_name, agent_id, metadata=metadata)
|
|
269
|
+
|
|
270
|
+
return len(points.points) > 0
|
|
271
|
+
|
|
245
272
|
# END Memory Points API
|
{cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/models/dtos.py
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from typing import Dict, List, Any
|
|
2
|
-
from pydantic import BaseModel, Field
|
|
2
|
+
from pydantic import BaseModel, Field, model_validator
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
class MemoryPoint(BaseModel):
|
|
@@ -26,3 +26,13 @@ class Why(BaseModel):
|
|
|
26
26
|
input: str | None = None
|
|
27
27
|
intermediate_steps: List | None = Field(default_factory=list)
|
|
28
28
|
memory: List | None = Field(default_factory=list)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class FilterSource(BaseModel):
|
|
32
|
+
source: str | None = None
|
|
33
|
+
hash: str | None = None
|
|
34
|
+
|
|
35
|
+
@model_validator(mode="after")
|
|
36
|
+
def validate_source_or_hash(self):
|
|
37
|
+
assert self.source or self.hash, "Either source or hash must be provided"
|
|
38
|
+
return self
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/builders/why.py
RENAMED
|
File without changes
|
{cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/enums.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cheshirecat_python_sdk-1.8.2 → cheshirecat_python_sdk-1.8.4}/cheshirecat_python_sdk/utils.py
RENAMED
|
File without changes
|
|
File without changes
|