cheshirecat-python-sdk 1.8.5__py3-none-any.whl → 1.8.6__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/endpoints/users.py +1 -4
- cheshirecat_python_sdk/endpoints/utils.py +43 -18
- cheshirecat_python_sdk/models/api/admins.py +11 -2
- {cheshirecat_python_sdk-1.8.5.dist-info → cheshirecat_python_sdk-1.8.6.dist-info}/METADATA +1 -1
- {cheshirecat_python_sdk-1.8.5.dist-info → cheshirecat_python_sdk-1.8.6.dist-info}/RECORD +7 -7
- {cheshirecat_python_sdk-1.8.5.dist-info → cheshirecat_python_sdk-1.8.6.dist-info}/WHEEL +0 -0
- {cheshirecat_python_sdk-1.8.5.dist-info → cheshirecat_python_sdk-1.8.6.dist-info}/licenses/LICENSE +0 -0
|
@@ -59,10 +59,7 @@ class UsersEndpoint(AbstractEndpoint):
|
|
|
59
59
|
response = self.get_http_client(agent_id).get(self.prefix)
|
|
60
60
|
response.raise_for_status()
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
for item in response.json():
|
|
64
|
-
result.append(deserialize(item, UserOutput))
|
|
65
|
-
return result
|
|
62
|
+
return [deserialize(item, UserOutput) for item in response.json()]
|
|
66
63
|
|
|
67
64
|
def get_user(self, user_id: str, agent_id: str) -> UserOutput:
|
|
68
65
|
"""
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
from typing import List
|
|
1
|
+
from typing import List, Dict
|
|
2
2
|
|
|
3
3
|
from cheshirecat_python_sdk.endpoints.base import AbstractEndpoint
|
|
4
|
-
from cheshirecat_python_sdk.models.api.admins import
|
|
4
|
+
from cheshirecat_python_sdk.models.api.admins import (
|
|
5
|
+
ResetOutput,
|
|
6
|
+
AgentClonedOutput,
|
|
7
|
+
AgentCreatedOutput,
|
|
8
|
+
AgentOutput,
|
|
9
|
+
AgentUpdatedOutput,
|
|
10
|
+
)
|
|
5
11
|
from cheshirecat_python_sdk.utils import deserialize
|
|
6
12
|
|
|
7
13
|
|
|
@@ -17,28 +23,33 @@ class UtilsEndpoint(AbstractEndpoint):
|
|
|
17
23
|
"""
|
|
18
24
|
return self.post_json(self.format_url("/factory/reset/"), self.system_id, output_class=ResetOutput)
|
|
19
25
|
|
|
20
|
-
def get_agents(self) -> List[
|
|
26
|
+
def get_agents(self) -> List[AgentOutput]:
|
|
21
27
|
"""
|
|
22
28
|
Get a list of all agents.
|
|
23
|
-
:return: List[
|
|
29
|
+
:return: List[AgentOutput], the ID and the metadata of the agents.
|
|
24
30
|
"""
|
|
25
|
-
|
|
31
|
+
response = self.get_http_client(agent_id=self.system_id).get(self.format_url("/agents/"))
|
|
32
|
+
response.raise_for_status()
|
|
33
|
+
|
|
34
|
+
return [deserialize(item, AgentOutput) for item in response.json()]
|
|
26
35
|
|
|
27
|
-
def post_agent_create(self, agent_id: str) ->
|
|
36
|
+
def post_agent_create(self, agent_id: str, metadata: Dict | None = None) -> AgentCreatedOutput:
|
|
28
37
|
"""
|
|
29
38
|
Create a new agent.
|
|
30
39
|
:param agent_id: The ID of the agent.
|
|
31
|
-
:
|
|
40
|
+
:param metadata: The metadata of the agent.
|
|
41
|
+
:return: AgentCreatedOutput, the details of the agent.
|
|
32
42
|
"""
|
|
33
|
-
|
|
43
|
+
payload = {"agent_id": agent_id}
|
|
44
|
+
if metadata is not None:
|
|
45
|
+
payload["metadata"] = metadata # type: ignore
|
|
46
|
+
|
|
47
|
+
return self.post_json(
|
|
34
48
|
self.format_url("/agents/create/"),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
49
|
+
self.system_id,
|
|
50
|
+
output_class=AgentCreatedOutput,
|
|
51
|
+
payload=payload,
|
|
38
52
|
)
|
|
39
|
-
response.raise_for_status()
|
|
40
|
-
|
|
41
|
-
return deserialize(response.json(), CreatedOutput)
|
|
42
53
|
|
|
43
54
|
def post_agent_reset(self, agent_id: str) -> ResetOutput:
|
|
44
55
|
"""
|
|
@@ -56,16 +67,30 @@ class UtilsEndpoint(AbstractEndpoint):
|
|
|
56
67
|
"""
|
|
57
68
|
return self.post_json(self.format_url("/agents/destroy/"), agent_id, output_class=ResetOutput)
|
|
58
69
|
|
|
59
|
-
def post_agent_clone(self, agent_id: str, new_agent_id: str) ->
|
|
70
|
+
def post_agent_clone(self, agent_id: str, new_agent_id: str) -> AgentClonedOutput:
|
|
60
71
|
"""
|
|
61
72
|
Destroy an agent.
|
|
62
73
|
:param agent_id: The ID of the agent.
|
|
63
74
|
:param new_agent_id: The ID of the new cloned agent.
|
|
64
|
-
:return:
|
|
75
|
+
:return: AgentClonedOutput, the details of the cloning.
|
|
65
76
|
"""
|
|
66
77
|
return self.post_json(
|
|
67
78
|
self.format_url("/agents/clone/"),
|
|
68
79
|
agent_id,
|
|
69
80
|
payload={"agent_id": new_agent_id},
|
|
70
|
-
output_class=
|
|
71
|
-
)
|
|
81
|
+
output_class=AgentClonedOutput,
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
def put_agent(self, agent_id: str, metadata: Dict) -> AgentUpdatedOutput:
|
|
85
|
+
"""
|
|
86
|
+
Update the metadata of an agent.
|
|
87
|
+
:param agent_id: The ID of the agent.
|
|
88
|
+
:param metadata: The new metadata for the agent.
|
|
89
|
+
:return: AgentUpdatedOutput, the details of the update.
|
|
90
|
+
"""
|
|
91
|
+
return self.put(
|
|
92
|
+
self.format_url("/agents/"),
|
|
93
|
+
agent_id,
|
|
94
|
+
payload={"metadata": metadata},
|
|
95
|
+
output_class=AgentUpdatedOutput,
|
|
96
|
+
)
|
|
@@ -4,7 +4,7 @@ from pydantic import BaseModel
|
|
|
4
4
|
from cheshirecat_python_sdk.models.api.plugins import PluginToggleOutput
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
class
|
|
7
|
+
class AgentCreatedOutput(BaseModel):
|
|
8
8
|
created: bool
|
|
9
9
|
|
|
10
10
|
|
|
@@ -32,5 +32,14 @@ class ResetOutput(BaseModel):
|
|
|
32
32
|
deleted_plugin_folders: bool
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
class
|
|
35
|
+
class AgentClonedOutput(BaseModel):
|
|
36
36
|
cloned: bool = False
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class AgentUpdatedOutput(BaseModel):
|
|
40
|
+
updated: bool
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class AgentOutput(BaseModel):
|
|
44
|
+
agent_id: str
|
|
45
|
+
metadata: Dict
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cheshirecat-python-sdk
|
|
3
|
-
Version: 1.8.
|
|
3
|
+
Version: 1.8.6
|
|
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
|
|
@@ -28,11 +28,11 @@ cheshirecat_python_sdk/endpoints/memory.py,sha256=dgfoyjZH0gL3kln31gFJ42JHfL-S-o
|
|
|
28
28
|
cheshirecat_python_sdk/endpoints/message.py,sha256=QTUSUJcj52VhfnX9hdjsD2aLeFC43O4eU8ld5lRvITU,2607
|
|
29
29
|
cheshirecat_python_sdk/endpoints/plugins.py,sha256=FasjwNY2UVv7zfg9lvXEj2ATefPDOPQpJXzQ2BbQIYI,3474
|
|
30
30
|
cheshirecat_python_sdk/endpoints/rabbit_hole.py,sha256=KjF5IRG6ghGEji-Js5try-9FhmWsuiM5v04jA68VoVY,7316
|
|
31
|
-
cheshirecat_python_sdk/endpoints/users.py,sha256=
|
|
32
|
-
cheshirecat_python_sdk/endpoints/utils.py,sha256=
|
|
31
|
+
cheshirecat_python_sdk/endpoints/users.py,sha256=19kei56IDYlteq_KePgzjJne_NgJkaLDAyPVwV3_2i8,5742
|
|
32
|
+
cheshirecat_python_sdk/endpoints/utils.py,sha256=etF2lipz-rGY8CAQve0zqDIgauJGeTdGYB3PtkcAb_4,3457
|
|
33
33
|
cheshirecat_python_sdk/endpoints/vector_database.py,sha256=Xu6zcopjZgcFVVmyN547piiqFcaTUtF35X0QxQHycXQ,2149
|
|
34
34
|
cheshirecat_python_sdk/models/dtos.py,sha256=0N6Auv43Gifo0ptdZxMZXAB6QGk8NNbcf8vQGm8HClo,869
|
|
35
|
-
cheshirecat_python_sdk/models/api/admins.py,sha256=
|
|
35
|
+
cheshirecat_python_sdk/models/api/admins.py,sha256=eIzK2MFjzF3w9Sqgt1Rkei-IW06sMpBhuOea7HenvSY,797
|
|
36
36
|
cheshirecat_python_sdk/models/api/conversations.py,sha256=ifgCwbtYwPiilQ-pz1peXaR7yVDNXlmIy_eWp25LGDE,551
|
|
37
37
|
cheshirecat_python_sdk/models/api/factories.py,sha256=_NWz0nKhaVYEbaphxe2YZGznDIUiMKb-xqA1xymME5A,594
|
|
38
38
|
cheshirecat_python_sdk/models/api/file_managers.py,sha256=V0ZBjQWmYM1t0Qpfp3W2NDI_tScOtORB0i5YMEpTiRU,301
|
|
@@ -44,7 +44,7 @@ cheshirecat_python_sdk/models/api/tokens.py,sha256=GavSaCq0-SRWjvLtDgrYBOdUELd7V
|
|
|
44
44
|
cheshirecat_python_sdk/models/api/users.py,sha256=_T3-8hfmlZK9cZcqBTbNMYS74yEnDrRACRQn9PNCEiQ,280
|
|
45
45
|
cheshirecat_python_sdk/models/api/nested/memories.py,sha256=ddGDsmZa2refElM0sGz9QfKHGk50wsTpkwN5qDC5bF4,946
|
|
46
46
|
cheshirecat_python_sdk/models/api/nested/plugins.py,sha256=7vrwgXh0csaUn11YKY_OWnGEnD8Fu_ewKxt024VOBEs,738
|
|
47
|
-
cheshirecat_python_sdk-1.8.
|
|
48
|
-
cheshirecat_python_sdk-1.8.
|
|
49
|
-
cheshirecat_python_sdk-1.8.
|
|
50
|
-
cheshirecat_python_sdk-1.8.
|
|
47
|
+
cheshirecat_python_sdk-1.8.6.dist-info/METADATA,sha256=-bXe7LwP6dz8_a8LmjHqOEV8XYO9Svml0kXY6wD1DTI,44136
|
|
48
|
+
cheshirecat_python_sdk-1.8.6.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
49
|
+
cheshirecat_python_sdk-1.8.6.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
50
|
+
cheshirecat_python_sdk-1.8.6.dist-info/RECORD,,
|
|
File without changes
|
{cheshirecat_python_sdk-1.8.5.dist-info → cheshirecat_python_sdk-1.8.6.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|