cheshirecat-python-sdk 1.2.1__py3-none-any.whl → 1.7.9__py3-none-any.whl
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/__init__.py +0 -1
- cheshirecat_python_sdk/builders/memory.py +0 -12
- cheshirecat_python_sdk/builders/why.py +0 -6
- cheshirecat_python_sdk/client.py +30 -5
- cheshirecat_python_sdk/clients/http_client.py +21 -7
- cheshirecat_python_sdk/clients/websocket_client.py +21 -15
- cheshirecat_python_sdk/configuration.py +1 -1
- cheshirecat_python_sdk/endpoints/__init__.py +6 -1
- cheshirecat_python_sdk/endpoints/admins.py +37 -70
- cheshirecat_python_sdk/endpoints/auth.py +54 -0
- cheshirecat_python_sdk/endpoints/auth_handler.py +8 -8
- cheshirecat_python_sdk/endpoints/base.py +48 -17
- cheshirecat_python_sdk/endpoints/chunker.py +8 -8
- cheshirecat_python_sdk/endpoints/conversation.py +83 -0
- cheshirecat_python_sdk/endpoints/custom_endpoint.py +57 -0
- cheshirecat_python_sdk/endpoints/embedder.py +4 -4
- cheshirecat_python_sdk/endpoints/file_manager.py +59 -8
- cheshirecat_python_sdk/endpoints/health_check.py +22 -0
- cheshirecat_python_sdk/endpoints/large_language_model.py +8 -8
- cheshirecat_python_sdk/endpoints/memory.py +70 -145
- cheshirecat_python_sdk/endpoints/message.py +29 -13
- cheshirecat_python_sdk/endpoints/plugins.py +31 -26
- cheshirecat_python_sdk/endpoints/rabbit_hole.py +51 -23
- cheshirecat_python_sdk/endpoints/users.py +22 -56
- cheshirecat_python_sdk/endpoints/utils.py +71 -0
- cheshirecat_python_sdk/endpoints/vector_database.py +52 -0
- cheshirecat_python_sdk/enums.py +0 -11
- cheshirecat_python_sdk/models/api/admins.py +4 -0
- cheshirecat_python_sdk/models/api/conversations.py +24 -0
- cheshirecat_python_sdk/models/api/factories.py +6 -0
- cheshirecat_python_sdk/models/api/file_managers.py +18 -0
- cheshirecat_python_sdk/models/api/memories.py +2 -10
- cheshirecat_python_sdk/models/api/messages.py +8 -6
- cheshirecat_python_sdk/models/api/nested/memories.py +5 -5
- cheshirecat_python_sdk/models/api/nested/plugins.py +8 -2
- cheshirecat_python_sdk/models/api/plugins.py +30 -22
- cheshirecat_python_sdk/models/api/tokens.py +19 -0
- cheshirecat_python_sdk/models/api/users.py +2 -0
- cheshirecat_python_sdk/models/dtos.py +3 -13
- cheshirecat_python_sdk/utils.py +2 -1
- {cheshirecat_python_sdk-1.2.1.dist-info → cheshirecat_python_sdk-1.7.9.dist-info}/METADATA +12 -10
- cheshirecat_python_sdk-1.7.9.dist-info/RECORD +49 -0
- {cheshirecat_python_sdk-1.2.1.dist-info → cheshirecat_python_sdk-1.7.9.dist-info}/WHEEL +1 -1
- cheshirecat_python_sdk/endpoints/settings.py +0 -63
- cheshirecat_python_sdk/models/api/settings.py +0 -22
- cheshirecat_python_sdk-1.2.1.dist-info/RECORD +0 -43
- {cheshirecat_python_sdk-1.2.1.dist-info → cheshirecat_python_sdk-1.7.9.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import List
|
|
1
|
+
from typing import List, Any, Dict
|
|
2
2
|
from pydantic import BaseModel, Field
|
|
3
3
|
|
|
4
4
|
from cheshirecat_python_sdk.models.api.nested.plugins import PluginSettingsOutput
|
|
@@ -31,18 +31,20 @@ class EndpointOutput(BaseModel):
|
|
|
31
31
|
class PluginItemOutput(BaseModel):
|
|
32
32
|
id: str
|
|
33
33
|
name: str
|
|
34
|
-
description: str
|
|
35
|
-
author_name: str
|
|
36
|
-
author_url: str
|
|
37
|
-
plugin_url: str
|
|
38
|
-
tags: str
|
|
39
|
-
thumb: str
|
|
40
|
-
version: str
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
34
|
+
description: str | None = None
|
|
35
|
+
author_name: str | None = None
|
|
36
|
+
author_url: str | None = None
|
|
37
|
+
plugin_url: str | None = None
|
|
38
|
+
tags: str | None = None
|
|
39
|
+
thumb: str | None = None
|
|
40
|
+
version: str | None = None
|
|
41
|
+
local_info: Dict = Field(default_factory=dict)
|
|
42
|
+
|
|
43
|
+
def __init__(self, /, **data: Any) -> None:
|
|
44
|
+
# if tags is a list, convert it to a comma-separated string
|
|
45
|
+
if "tags" in data and isinstance(data["tags"], list):
|
|
46
|
+
data["tags"] = ", ".join(data["tags"])
|
|
47
|
+
super().__init__(**data)
|
|
46
48
|
|
|
47
49
|
|
|
48
50
|
class PluginCollectionOutput(BaseModel):
|
|
@@ -52,16 +54,22 @@ class PluginCollectionOutput(BaseModel):
|
|
|
52
54
|
|
|
53
55
|
|
|
54
56
|
class PluginItemRegistryOutput(BaseModel):
|
|
55
|
-
id: str
|
|
57
|
+
id: str | None = None
|
|
56
58
|
name: str
|
|
57
|
-
description: str
|
|
58
|
-
author_name: str
|
|
59
|
-
author_url: str
|
|
60
|
-
plugin_url: str
|
|
61
|
-
tags: str
|
|
62
|
-
thumb: str
|
|
63
|
-
version: str
|
|
64
|
-
url: str
|
|
59
|
+
description: str | None = None
|
|
60
|
+
author_name: str | None = None
|
|
61
|
+
author_url: str | None = None
|
|
62
|
+
plugin_url: str | None = None
|
|
63
|
+
tags: str | None = None
|
|
64
|
+
thumb: str | None = None
|
|
65
|
+
version: str | None = None
|
|
66
|
+
url: str | None = None
|
|
67
|
+
|
|
68
|
+
def __init__(self, /, **data: Any) -> None:
|
|
69
|
+
# if tags is a list, convert it to a comma-separated string
|
|
70
|
+
if "tags" in data and isinstance(data["tags"], list):
|
|
71
|
+
data["tags"] = ", ".join(data["tags"])
|
|
72
|
+
super().__init__(**data)
|
|
65
73
|
|
|
66
74
|
|
|
67
75
|
class PluginsSettingsOutput(BaseModel):
|
|
@@ -4,3 +4,22 @@ from pydantic import BaseModel
|
|
|
4
4
|
class TokenOutput(BaseModel):
|
|
5
5
|
access_token: str
|
|
6
6
|
token_type: str | None = "bearer"
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class User(BaseModel):
|
|
10
|
+
id: str
|
|
11
|
+
username: str
|
|
12
|
+
permissions: dict[str, list[str]]
|
|
13
|
+
created_at: float | None = None
|
|
14
|
+
updated_at: float | None = None
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class AgentMatch(BaseModel):
|
|
18
|
+
agent_name: str
|
|
19
|
+
user: User
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class MeOutput(BaseModel):
|
|
23
|
+
success : bool
|
|
24
|
+
agents: list[AgentMatch]
|
|
25
|
+
auto_selected: bool
|
|
@@ -2,17 +2,8 @@ from typing import Dict, List, Any
|
|
|
2
2
|
from pydantic import BaseModel, Field
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
class AgentOutput(BaseModel):
|
|
6
|
-
output: str | None = None
|
|
7
|
-
intermediate_steps: List[Dict[str, Any]] | None = Field(default_factory=list)
|
|
8
|
-
return_direct: bool = False
|
|
9
|
-
with_llm_error: bool = False
|
|
10
|
-
|
|
11
|
-
|
|
12
5
|
class Memory(BaseModel):
|
|
13
|
-
|
|
14
|
-
declarative: Dict[str, Any] | None = Field(default_factory=dict)
|
|
15
|
-
procedural: Dict[str, Any] | None = Field(default_factory=dict)
|
|
6
|
+
declarative: List | None = Field(default_factory=list)
|
|
16
7
|
|
|
17
8
|
|
|
18
9
|
class MemoryPoint(BaseModel):
|
|
@@ -26,7 +17,7 @@ class MessageBase(BaseModel):
|
|
|
26
17
|
|
|
27
18
|
|
|
28
19
|
class Message(MessageBase):
|
|
29
|
-
|
|
20
|
+
metadata: Dict[str, Any] | None = None
|
|
30
21
|
|
|
31
22
|
|
|
32
23
|
class SettingInput(BaseModel):
|
|
@@ -37,6 +28,5 @@ class SettingInput(BaseModel):
|
|
|
37
28
|
|
|
38
29
|
class Why(BaseModel):
|
|
39
30
|
input: str | None = None
|
|
40
|
-
intermediate_steps:
|
|
31
|
+
intermediate_steps: List | None = Field(default_factory=list)
|
|
41
32
|
memory: Memory = Field(default_factory=Memory)
|
|
42
|
-
model_interactions: Dict[str, Any] | None = Field(default_factory=dict)
|
cheshirecat_python_sdk/utils.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import os
|
|
1
2
|
from typing import Dict, Type, TypeVar, BinaryIO, Tuple
|
|
2
3
|
import magic
|
|
3
4
|
|
|
@@ -16,4 +17,4 @@ def file_attributes(filename: str, file: BinaryIO) -> Tuple[str, BinaryIO, str]:
|
|
|
16
17
|
|
|
17
18
|
file.seek(current_pos)
|
|
18
19
|
|
|
19
|
-
return filename, file, content_type
|
|
20
|
+
return os.path.basename(filename), file, content_type
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cheshirecat-python-sdk
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.7.9
|
|
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
|
|
@@ -683,7 +683,7 @@ License: GNU GENERAL PUBLIC LICENSE
|
|
|
683
683
|
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
|
684
684
|
License-File: LICENSE
|
|
685
685
|
Keywords: Cheshire-Cat,LLM,OpenAPI,OpenSource,RAG
|
|
686
|
-
Classifier: Development Status ::
|
|
686
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
687
687
|
Classifier: Framework :: FastAPI
|
|
688
688
|
Classifier: Programming Language :: Python :: 3
|
|
689
689
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -739,8 +739,10 @@ notification_closure = lambda message: None # handle websocket notification, lik
|
|
|
739
739
|
|
|
740
740
|
# result is the result of the message
|
|
741
741
|
result = cheshire_cat_client.message.send_websocket_message(
|
|
742
|
-
Message("Hello world!"
|
|
743
|
-
|
|
742
|
+
Message(text="Hello world!"), # message body
|
|
743
|
+
"agent", # agent ID
|
|
744
|
+
"user", # user ID
|
|
745
|
+
callback=notification_closure # websocket notification closure handle
|
|
744
746
|
)
|
|
745
747
|
```
|
|
746
748
|
|
|
@@ -755,26 +757,26 @@ cheshire_cat_client = CheshireCatClient(configuration)
|
|
|
755
757
|
|
|
756
758
|
# file
|
|
757
759
|
file = "path/to/file"
|
|
758
|
-
result = asyncio.run(cheshire_cat_client.rabbit_hole.post_file(file))
|
|
760
|
+
result = asyncio.run(cheshire_cat_client.rabbit_hole.post_file(file, "agent"))
|
|
759
761
|
|
|
760
762
|
# url
|
|
761
763
|
url = "https://www.google.com"
|
|
762
|
-
result = asyncio.run(cheshire_cat_client.rabbit_hole.post_web(url))
|
|
764
|
+
result = asyncio.run(cheshire_cat_client.rabbit_hole.post_web(url, "agent"))
|
|
763
765
|
```
|
|
764
766
|
|
|
765
767
|
Memory management utilities:
|
|
766
768
|
|
|
767
769
|
```python
|
|
768
|
-
from cheshirecat_python_sdk import
|
|
770
|
+
from cheshirecat_python_sdk import CheshireCatClient, Configuration, Message
|
|
769
771
|
|
|
770
772
|
configuration = Configuration(host="localhost", port=1865, auth_key="test", secure_connection=False)
|
|
771
773
|
cheshire_cat_client = CheshireCatClient(configuration)
|
|
772
774
|
|
|
773
|
-
cheshire_cat_client.memory.get_memory_collections() # get number of vectors in the working memory
|
|
774
|
-
cheshire_cat_client.memory.get_memory_recall("HELLO") # recall memories by text
|
|
775
|
+
cheshire_cat_client.memory.get_memory_collections("agent") # get number of vectors in the working memory
|
|
776
|
+
cheshire_cat_client.memory.get_memory_recall("HELLO", "agent", "user") # recall memories by text
|
|
775
777
|
|
|
776
778
|
url = "https://www.google.com"
|
|
777
779
|
|
|
778
780
|
# delete memory points by metadata, like this example delete by source
|
|
779
|
-
cheshire_cat_client.memory.delete_memory_points_by_metadata(
|
|
781
|
+
cheshire_cat_client.memory.delete_memory_points_by_metadata("declarative", "agent", {"source": url})
|
|
780
782
|
```
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
cheshirecat_python_sdk/__init__.py,sha256=59esRUsh_6xPlfoCz-gQYQdDgp2xbaINYWyDcTJlvys,284
|
|
2
|
+
cheshirecat_python_sdk/client.py,sha256=J8C8j9q-Lz3cGKyYbd9w19Ayh9muMa8s3N_gYpmLI-E,2839
|
|
3
|
+
cheshirecat_python_sdk/configuration.py,sha256=7uXebZGzCuJdpgOeN5l1YXkWVIrTk4apxvjPKZFcJTE,283
|
|
4
|
+
cheshirecat_python_sdk/enums.py,sha256=qJyhl5D_oDMHqNcIivr9pTxNrZY6XkX7lGgGydk22TY,665
|
|
5
|
+
cheshirecat_python_sdk/utils.py,sha256=2pcSCREOuIAUi5El5ou2rCm-VtmzyGVd3YHcKrFHgBM,458
|
|
6
|
+
cheshirecat_python_sdk/builders/__init__.py,sha256=sFzhmAPkKY2-9CGw5838S-2CMBosK4yCuTi9KmyetEo,223
|
|
7
|
+
cheshirecat_python_sdk/builders/base.py,sha256=YyE0pLp2iYyIFQVD1hLDeR8Wg578ebzoEEEtX9G8KZw,216
|
|
8
|
+
cheshirecat_python_sdk/builders/memory.py,sha256=vIoQADNZF51mMjPoJ-xW6DFWgUeAufiFXa-uDPb71A0,1088
|
|
9
|
+
cheshirecat_python_sdk/builders/settings_input.py,sha256=EvaCDmmYOtHWUwCgG-nWonkY6UF6g1blytBwAmH477I,762
|
|
10
|
+
cheshirecat_python_sdk/builders/why.py,sha256=liwellCzZ6EyzWcL3lNgBy9SU76zAqGufxiaZ_o3ZT4,1008
|
|
11
|
+
cheshirecat_python_sdk/clients/__init__.py,sha256=i4Hqux9vihFRbXVK48yJ1k9gm4JeCHnfPgosizQZv-g,135
|
|
12
|
+
cheshirecat_python_sdk/clients/http_client.py,sha256=LnP0kr-kHRCwC-BZiysj1Zg-T3b3yuLd81wOctfcBTg,2319
|
|
13
|
+
cheshirecat_python_sdk/clients/websocket_client.py,sha256=xNjkLSEZhpHzRqIZL21V0oG3srAGFaqYveMqlma2gvI,1932
|
|
14
|
+
cheshirecat_python_sdk/endpoints/__init__.py,sha256=uQPclok3DdKTibR7ywDVM67eqtxEMwx_iuza37Wqkr8,1247
|
|
15
|
+
cheshirecat_python_sdk/endpoints/admins.py,sha256=rc6jEhYF8KTTWFXLinm3xPV7Rj87iKT8Kp0zHn1qUO4,7024
|
|
16
|
+
cheshirecat_python_sdk/endpoints/auth.py,sha256=_22fLGznoxo2pybcQGgcsHCpLoq76P6RplmSMMgajEQ,2031
|
|
17
|
+
cheshirecat_python_sdk/endpoints/auth_handler.py,sha256=Jfi7E7L3SIzJyECbJnUenIyl6xxkJlyC31AHpAlmqSs,2117
|
|
18
|
+
cheshirecat_python_sdk/endpoints/base.py,sha256=W_ynJur_cbT31KLp6F4pJ212tMaAa1BxnG75YS1UgNU,4075
|
|
19
|
+
cheshirecat_python_sdk/endpoints/chunker.py,sha256=bgp-2gQpKt7W_B46eEb-KFRkd4eZJH0euwsf3N0jfC8,1979
|
|
20
|
+
cheshirecat_python_sdk/endpoints/conversation.py,sha256=jG1z7ivdD53H8JZe7WZWihoBWy2_-W951SwKXmnpmTk,3282
|
|
21
|
+
cheshirecat_python_sdk/endpoints/custom_endpoint.py,sha256=HVRQMqA5JfPr87gHtWpYcsXsE-TA-coXLcvsPKabqds,2791
|
|
22
|
+
cheshirecat_python_sdk/endpoints/embedder.py,sha256=4B2yc3KBThKGreq_KPTTCsxt2Ekktw_muZ5gBfxrrwY,1741
|
|
23
|
+
cheshirecat_python_sdk/endpoints/file_manager.py,sha256=qzMzvSt3eBYNb5VstQq8MdV1JC6QsUNOPrwb8yAR_OA,4226
|
|
24
|
+
cheshirecat_python_sdk/endpoints/health_check.py,sha256=qv_5imbN39PqPyuBvlNoSqXqAvTvPv7UXI4zcfH8tlg,710
|
|
25
|
+
cheshirecat_python_sdk/endpoints/large_language_model.py,sha256=SS787ZKMZQ7KQNvl7a7rfBCm6s1j3ifDfWQcrM4tn-k,2109
|
|
26
|
+
cheshirecat_python_sdk/endpoints/memory.py,sha256=dEnQ2Hb_VG907p7T9oQgPCWWFHAUwkgwpVVJ1bLsWGw,8959
|
|
27
|
+
cheshirecat_python_sdk/endpoints/message.py,sha256=QTUSUJcj52VhfnX9hdjsD2aLeFC43O4eU8ld5lRvITU,2607
|
|
28
|
+
cheshirecat_python_sdk/endpoints/plugins.py,sha256=FasjwNY2UVv7zfg9lvXEj2ATefPDOPQpJXzQ2BbQIYI,3474
|
|
29
|
+
cheshirecat_python_sdk/endpoints/rabbit_hole.py,sha256=DH5KGpk0Ur8RPi1fZIO9D925mc2D0GHQpsOeIKIa1G0,7213
|
|
30
|
+
cheshirecat_python_sdk/endpoints/users.py,sha256=PXlPPobLoWpiuAzi0k89YUyqSp24Sc5DEcDQYGRXRBA,5369
|
|
31
|
+
cheshirecat_python_sdk/endpoints/utils.py,sha256=yKGrFRpu6ItLnBEuc98093LbXqGYaGdgCLiWuLQJVno,2551
|
|
32
|
+
cheshirecat_python_sdk/endpoints/vector_database.py,sha256=Xu6zcopjZgcFVVmyN547piiqFcaTUtF35X0QxQHycXQ,2149
|
|
33
|
+
cheshirecat_python_sdk/models/dtos.py,sha256=yK6CfCGdwLvZtYFPoImDEgpV5eyHB2iwji2t6dh6gxc,668
|
|
34
|
+
cheshirecat_python_sdk/models/api/admins.py,sha256=K1HzZrjEk--rmBSxEg3cbWm2MVQaSxTheMBhhBr54_4,767
|
|
35
|
+
cheshirecat_python_sdk/models/api/conversations.py,sha256=Ej8677MLBqZEME1lZFd4UhHokdja762zYNjV9ZaEg-I,505
|
|
36
|
+
cheshirecat_python_sdk/models/api/factories.py,sha256=_NWz0nKhaVYEbaphxe2YZGznDIUiMKb-xqA1xymME5A,594
|
|
37
|
+
cheshirecat_python_sdk/models/api/file_managers.py,sha256=V0ZBjQWmYM1t0Qpfp3W2NDI_tScOtORB0i5YMEpTiRU,301
|
|
38
|
+
cheshirecat_python_sdk/models/api/memories.py,sha256=4rqFuFNzNbmwIG1KGiSyfnv40nds5g7fSkov3drj0cc,948
|
|
39
|
+
cheshirecat_python_sdk/models/api/messages.py,sha256=PDojYuXUDXSek8nkg8QKoVdAJ2NMmhV4iWvbhOrekEE,441
|
|
40
|
+
cheshirecat_python_sdk/models/api/plugins.py,sha256=uX8SYbcTxQSxv1IaVChEBd3rr6kc83rwq3IILnmq5EE,1996
|
|
41
|
+
cheshirecat_python_sdk/models/api/rabbit_holes.py,sha256=01FcPSIG6nq9WJhL_rQopLMSD81CU9lfP-t0xtf35Gw,285
|
|
42
|
+
cheshirecat_python_sdk/models/api/tokens.py,sha256=GavSaCq0-SRWjvLtDgrYBOdUELd7VoVXlykmIBT23ds,455
|
|
43
|
+
cheshirecat_python_sdk/models/api/users.py,sha256=WR6m_V_jn5YiWYSC_H4ybpooEtdMRQAbReakT4WJgWE,232
|
|
44
|
+
cheshirecat_python_sdk/models/api/nested/memories.py,sha256=ddGDsmZa2refElM0sGz9QfKHGk50wsTpkwN5qDC5bF4,946
|
|
45
|
+
cheshirecat_python_sdk/models/api/nested/plugins.py,sha256=7vrwgXh0csaUn11YKY_OWnGEnD8Fu_ewKxt024VOBEs,738
|
|
46
|
+
cheshirecat_python_sdk-1.7.9.dist-info/METADATA,sha256=pIDHH87QNazNr6DRVODRdOov4FDs5kofaCfby1QUOUA,44136
|
|
47
|
+
cheshirecat_python_sdk-1.7.9.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
48
|
+
cheshirecat_python_sdk-1.7.9.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
49
|
+
cheshirecat_python_sdk-1.7.9.dist-info/RECORD,,
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
from cheshirecat_python_sdk.endpoints.base import AbstractEndpoint
|
|
2
|
-
from cheshirecat_python_sdk.models.api.settings import SettingsOutputCollection, SettingOutputItem
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class SettingsEndpoint(AbstractEndpoint):
|
|
6
|
-
def __init__(self, client: "CheshireCatClient"):
|
|
7
|
-
super().__init__(client)
|
|
8
|
-
self.prefix = "/settings"
|
|
9
|
-
|
|
10
|
-
def get_settings(self, agent_id: str | None = None) -> SettingsOutputCollection:
|
|
11
|
-
"""
|
|
12
|
-
This endpoint returns the settings of the agent identified by the agent_id parameter (multi-agent installations)
|
|
13
|
-
You can omit the agent_id parameter in a single-agent installation. In this case, the settings of the default
|
|
14
|
-
agent are returned.
|
|
15
|
-
:param agent_id: The id of the agent to get settings for (optional)
|
|
16
|
-
:return: SettingsOutputCollection, the settings of the agent
|
|
17
|
-
"""
|
|
18
|
-
return self.get(self.prefix, SettingsOutputCollection, agent_id)
|
|
19
|
-
|
|
20
|
-
def post_setting(self, values: dict, agent_id: str | None = None) -> SettingOutputItem:
|
|
21
|
-
"""
|
|
22
|
-
This method creates a new setting for the agent identified by the agent_id parameter (multi-agent installations).
|
|
23
|
-
You can omit the agent_id parameter in a single-agent installation. In this case, the setting is created for the
|
|
24
|
-
default agent.
|
|
25
|
-
:param values: The values of the setting to create
|
|
26
|
-
:param agent_id: The id of the agent to create the setting for (optional)
|
|
27
|
-
:return: SettingOutputItem, the created setting
|
|
28
|
-
"""
|
|
29
|
-
return self.post_json(self.prefix, SettingOutputItem, values, agent_id)
|
|
30
|
-
|
|
31
|
-
def get_setting(self, setting_id: str, agent_id: str | None = None) -> SettingOutputItem:
|
|
32
|
-
"""
|
|
33
|
-
This endpoint returns the setting identified by the setting_id parameter. The setting must belong to the agent
|
|
34
|
-
identified by the agent_id parameter (multi-agent installations). You can omit the agent_id parameter in a
|
|
35
|
-
single-agent installation. In this case, the setting is looked up in the default agent.
|
|
36
|
-
:param setting_id: The id of the setting to get
|
|
37
|
-
:param agent_id: The id of the agent to get the setting for (optional)
|
|
38
|
-
:return: SettingOutputItem, the setting
|
|
39
|
-
"""
|
|
40
|
-
return self.get(self.format_url(setting_id), SettingOutputItem, agent_id)
|
|
41
|
-
|
|
42
|
-
def put_setting(self, setting_id: str, values: dict, agent_id: str | None = None) -> SettingOutputItem:
|
|
43
|
-
"""
|
|
44
|
-
This method updates the setting identified by the setting_id parameter. The setting must belong to the agent
|
|
45
|
-
identified by the agent_id parameter (multi-agent installations). You can omit the agent_id parameter in a
|
|
46
|
-
single-agent installation. In this case, the setting is updated in the default agent.
|
|
47
|
-
:param setting_id: The id of the setting to update
|
|
48
|
-
:param values: The values to update the setting with
|
|
49
|
-
:param agent_id: The id of the agent to update the setting for (optional)
|
|
50
|
-
:return: SettingOutputItem, the updated setting
|
|
51
|
-
"""
|
|
52
|
-
return self.put(self.format_url(setting_id), SettingOutputItem, values, agent_id)
|
|
53
|
-
|
|
54
|
-
def delete_setting(self, setting_id: str, agent_id: str | None = None) -> SettingOutputItem:
|
|
55
|
-
"""
|
|
56
|
-
This endpoint deletes the setting identified by the setting_id parameter. The setting must belong to the agent
|
|
57
|
-
identified by the agent_id parameter (multi-agent installations). You can omit the agent_id parameter in a
|
|
58
|
-
single-agent installation. In this case, the setting is deleted from the default agent.
|
|
59
|
-
:param setting_id: The id of the setting to delete
|
|
60
|
-
:param agent_id: The id of the agent to delete the setting for (optional)
|
|
61
|
-
:return: SettingOutputItem, the deleted setting
|
|
62
|
-
"""
|
|
63
|
-
return self.delete(self.format_url(setting_id), SettingOutputItem, agent_id)
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
from typing import Dict, List, Any
|
|
2
|
-
from pydantic import BaseModel
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class SettingDeleteOutput(BaseModel):
|
|
6
|
-
deleted: bool
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class SettingOutput(BaseModel):
|
|
10
|
-
name: str
|
|
11
|
-
value: Dict[str, Any]
|
|
12
|
-
category: str
|
|
13
|
-
setting_id: str
|
|
14
|
-
updated_at: int | str
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class SettingOutputItem(BaseModel):
|
|
18
|
-
setting: SettingOutput
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class SettingsOutputCollection(BaseModel):
|
|
22
|
-
settings: List[SettingOutput]
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
cheshirecat_python_sdk/__init__.py,sha256=dbIrMND_Am64kqSbUyw8kCHIkOLxzOjecC4HZ2eIEJc,342
|
|
2
|
-
cheshirecat_python_sdk/client.py,sha256=8YW6d1L60esh2KdBboHHIcM5tSnnXVJq2hBv47CX-ec,2330
|
|
3
|
-
cheshirecat_python_sdk/configuration.py,sha256=BHbdIipAqR-NJZsBXKqjz8sSAMckM5FODjwCQHDJS8g,274
|
|
4
|
-
cheshirecat_python_sdk/enums.py,sha256=PP05PxaF3W4vbgB_rbmmoBUYWjIgaPcne2eecC0MINo,843
|
|
5
|
-
cheshirecat_python_sdk/utils.py,sha256=RYnKEVcvH1-jHMSiZVtY1ODue2QT3-EoACJKxa4KlXk,430
|
|
6
|
-
cheshirecat_python_sdk/builders/__init__.py,sha256=sFzhmAPkKY2-9CGw5838S-2CMBosK4yCuTi9KmyetEo,223
|
|
7
|
-
cheshirecat_python_sdk/builders/base.py,sha256=YyE0pLp2iYyIFQVD1hLDeR8Wg578ebzoEEEtX9G8KZw,216
|
|
8
|
-
cheshirecat_python_sdk/builders/memory.py,sha256=WPRzkH4dRYDHM9GJGwjW87TxOZERWCsi8e6HgPZFXNw,1542
|
|
9
|
-
cheshirecat_python_sdk/builders/settings_input.py,sha256=EvaCDmmYOtHWUwCgG-nWonkY6UF6g1blytBwAmH477I,762
|
|
10
|
-
cheshirecat_python_sdk/builders/why.py,sha256=9B-MXc1CNcvJMzBBa5DzQmY7vUHEpJZekv6CwZ0Ec5Q,1304
|
|
11
|
-
cheshirecat_python_sdk/clients/__init__.py,sha256=i4Hqux9vihFRbXVK48yJ1k9gm4JeCHnfPgosizQZv-g,135
|
|
12
|
-
cheshirecat_python_sdk/clients/http_client.py,sha256=-lJeO4XfW4bjPZbN-s5n0-fCqo4Cmz7PAg8zNiustfo,1952
|
|
13
|
-
cheshirecat_python_sdk/clients/websocket_client.py,sha256=w8wlLjoy1eEznX24uD3rS3eReuzR9WJ327faWap93Ck,1769
|
|
14
|
-
cheshirecat_python_sdk/endpoints/__init__.py,sha256=jexTC4YZGsxOGdEMg5G4QsGPks0bSzluXgZMnC2woyk,873
|
|
15
|
-
cheshirecat_python_sdk/endpoints/admins.py,sha256=8zBJns-cTmOr6ZvyHDn2y4XtYJXfjlF9U_jn1HVl1ns,8576
|
|
16
|
-
cheshirecat_python_sdk/endpoints/auth_handler.py,sha256=cZGIP99XCkYog8c8pOOoHbSF49A3Vcy0GlVGJh7adqE,2112
|
|
17
|
-
cheshirecat_python_sdk/endpoints/base.py,sha256=d2THB7kAE1DxJNNpLw6_wFCeyzI5OYNb7WVsGOztz3U,3249
|
|
18
|
-
cheshirecat_python_sdk/endpoints/chunker.py,sha256=yBcaH-0KOkD57pUEH114R8IyON3ZHxSvARCFhXBcfzs,1974
|
|
19
|
-
cheshirecat_python_sdk/endpoints/embedder.py,sha256=MB6NaD_P_Bb0tOOTfA9DoO6Vj2nDxcQA-loGKwLvhRI,1694
|
|
20
|
-
cheshirecat_python_sdk/endpoints/file_manager.py,sha256=YrkVhegM8zEDOqdpNM59TtElrh3E_fJOhdpLpQRL4us,2122
|
|
21
|
-
cheshirecat_python_sdk/endpoints/large_language_model.py,sha256=4PCkShirfSM9T9NsO_VW8JCDar-CcRsbpJQjM7Mb70Q,2104
|
|
22
|
-
cheshirecat_python_sdk/endpoints/memory.py,sha256=a6XFtn3pW9pi3QC6I1wczmiqvjOlCpzwVscbIkFYJWM,14079
|
|
23
|
-
cheshirecat_python_sdk/endpoints/message.py,sha256=YHyuolsaC0zmAYh9onMXuFNBv7iSgKsI7Ys8h2CloSg,2516
|
|
24
|
-
cheshirecat_python_sdk/endpoints/plugins.py,sha256=adyntT0N7ktTqDwp91wBZmxeAOmCOd5So9eja5LaJh4,3713
|
|
25
|
-
cheshirecat_python_sdk/endpoints/rabbit_hole.py,sha256=zalY1eQb6Wro5UNVY_sLCf5zRN1KdEAFb6Qv-XlGSM0,6474
|
|
26
|
-
cheshirecat_python_sdk/endpoints/settings.py,sha256=4LVChK2faB4_EJx5ee3Bplf-yIJHoj2tfjAPyVVUXxw,3840
|
|
27
|
-
cheshirecat_python_sdk/endpoints/users.py,sha256=BIbd302LEmudnjLGwMnOiOD4tsXQE2ifb1-7PPlErxA,7331
|
|
28
|
-
cheshirecat_python_sdk/models/dtos.py,sha256=FlZah3z58lwgoy4k9xWlT_dWUWOWT4RXxYGwUYGRgSk,1116
|
|
29
|
-
cheshirecat_python_sdk/models/api/admins.py,sha256=DMDKu2zZmx5vaXSE77Z7USCwR193UgCrD2R6jo7Yt0s,709
|
|
30
|
-
cheshirecat_python_sdk/models/api/factories.py,sha256=Io6pxF-4RsNDdYvg0rnB0Tm3iQrUtLvUL4OvyVVte-A,321
|
|
31
|
-
cheshirecat_python_sdk/models/api/memories.py,sha256=93tcoileuDmist3X1AgzeNNl20SCc6pWMMu3bEC3HuA,1093
|
|
32
|
-
cheshirecat_python_sdk/models/api/messages.py,sha256=BKqNivGKYv0j2W1epmZL56Nnf04BErFAJ8F3JveDwNo,482
|
|
33
|
-
cheshirecat_python_sdk/models/api/plugins.py,sha256=TmehBJJ2cyDqAtZtZZKdCyIAbRTRucQa27eHcy0q8v8,1321
|
|
34
|
-
cheshirecat_python_sdk/models/api/rabbit_holes.py,sha256=01FcPSIG6nq9WJhL_rQopLMSD81CU9lfP-t0xtf35Gw,285
|
|
35
|
-
cheshirecat_python_sdk/models/api/settings.py,sha256=whivLS3tH0FJ7j4QbRP8XkVDdR5TTC2qzT7vZghzs1o,406
|
|
36
|
-
cheshirecat_python_sdk/models/api/tokens.py,sha256=5vzQqmcYWg593U1cTnnmLPZMNkgNNY5egQBQTE-NDoE,123
|
|
37
|
-
cheshirecat_python_sdk/models/api/users.py,sha256=2l86y6ol0R0823gGl4bmc1TzGP4ZyvTm9AR8riKiatA,160
|
|
38
|
-
cheshirecat_python_sdk/models/api/nested/memories.py,sha256=Yxhg9qingrVWwnI6hwdVhj0gG1U-rFqUX6Juzwt8h7w,864
|
|
39
|
-
cheshirecat_python_sdk/models/api/nested/plugins.py,sha256=EJ0bCC41ttG4ni_hUaFx229iBcucZflduk2jF4IxTg8,437
|
|
40
|
-
cheshirecat_python_sdk-1.2.1.dist-info/METADATA,sha256=BYjDdowLsUxmcKQsit9GCkPWKlUcYgUI807mxpzHIQk,44046
|
|
41
|
-
cheshirecat_python_sdk-1.2.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
42
|
-
cheshirecat_python_sdk-1.2.1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
43
|
-
cheshirecat_python_sdk-1.2.1.dist-info/RECORD,,
|
{cheshirecat_python_sdk-1.2.1.dist-info → cheshirecat_python_sdk-1.7.9.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|