cheshirecat-python-sdk 1.8.5__tar.gz → 1.8.6__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.
Files changed (53) hide show
  1. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/PKG-INFO +1 -1
  2. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/endpoints/users.py +1 -4
  3. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/endpoints/utils.py +43 -18
  4. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/models/api/admins.py +11 -2
  5. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/pyproject.toml +1 -1
  6. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/.gitignore +0 -0
  7. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/LICENSE +0 -0
  8. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/Makefile +0 -0
  9. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/README.md +0 -0
  10. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/__init__.py +0 -0
  11. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/builders/__init__.py +0 -0
  12. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/builders/base.py +0 -0
  13. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/builders/memory.py +0 -0
  14. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/builders/settings_input.py +0 -0
  15. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/builders/why.py +0 -0
  16. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/client.py +0 -0
  17. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/clients/__init__.py +0 -0
  18. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/clients/http_client.py +0 -0
  19. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/clients/websocket_client.py +0 -0
  20. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/configuration.py +0 -0
  21. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/endpoints/__init__.py +0 -0
  22. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/endpoints/admins.py +0 -0
  23. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/endpoints/agentic_workflow.py +0 -0
  24. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/endpoints/auth.py +0 -0
  25. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/endpoints/auth_handler.py +0 -0
  26. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/endpoints/base.py +0 -0
  27. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/endpoints/chunker.py +0 -0
  28. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/endpoints/conversation.py +0 -0
  29. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/endpoints/custom_endpoint.py +0 -0
  30. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/endpoints/embedder.py +0 -0
  31. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/endpoints/file_manager.py +0 -0
  32. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/endpoints/health_check.py +0 -0
  33. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/endpoints/large_language_model.py +0 -0
  34. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/endpoints/memory.py +0 -0
  35. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/endpoints/message.py +0 -0
  36. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/endpoints/plugins.py +0 -0
  37. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/endpoints/rabbit_hole.py +0 -0
  38. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/endpoints/vector_database.py +0 -0
  39. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/enums.py +0 -0
  40. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/models/api/conversations.py +0 -0
  41. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/models/api/factories.py +0 -0
  42. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/models/api/file_managers.py +0 -0
  43. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/models/api/memories.py +0 -0
  44. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/models/api/messages.py +0 -0
  45. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/models/api/nested/memories.py +0 -0
  46. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/models/api/nested/plugins.py +0 -0
  47. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/models/api/plugins.py +0 -0
  48. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/models/api/rabbit_holes.py +0 -0
  49. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/models/api/tokens.py +0 -0
  50. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/models/api/users.py +0 -0
  51. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/models/dtos.py +0 -0
  52. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/cheshirecat_python_sdk/utils.py +0 -0
  53. {cheshirecat_python_sdk-1.8.5 → cheshirecat_python_sdk-1.8.6}/requirements.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cheshirecat-python-sdk
3
- Version: 1.8.5
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
@@ -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
- result = []
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 ResetOutput, ClonedOutput, CreatedOutput
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[str]:
26
+ def get_agents(self) -> List[AgentOutput]:
21
27
  """
22
28
  Get a list of all agents.
23
- :return: List[str], the IDs of the agents.
29
+ :return: List[AgentOutput], the ID and the metadata of the agents.
24
30
  """
25
- return self.get(self.format_url("/agents/"), self.system_id)
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) -> CreatedOutput:
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
- :return: CreatedOutput, the details of the agent.
40
+ :param metadata: The metadata of the agent.
41
+ :return: AgentCreatedOutput, the details of the agent.
32
42
  """
33
- response = self.get_http_client().post(
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
- json={
36
- "agent_id": agent_id,
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) -> ClonedOutput:
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: ClonedOutput, the details of the cloning.
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=ClonedOutput
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 CreatedOutput(BaseModel):
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 ClonedOutput(BaseModel):
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,7 +1,7 @@
1
1
  [project]
2
2
  name = "cheshirecat-python-sdk"
3
3
  description = "Python SDK for the Cloud-ready fork of the Cheshire Cat"
4
- version = "1.8.5"
4
+ version = "1.8.6"
5
5
  requires-python = ">=3.10"
6
6
  license = { file = "LICENSE" }
7
7
  authors = [