cheshirecat-python-sdk 1.7.8__py3-none-any.whl → 1.7.10__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.
@@ -1,8 +1,5 @@
1
- from typing import List
2
-
3
1
  from cheshirecat_python_sdk.endpoints.base import AbstractEndpoint, MultipartPayload
4
2
  from cheshirecat_python_sdk.models.api.admins import (
5
- AdminOutput,
6
3
  PluginInstallOutput,
7
4
  PluginInstallFromRegistryOutput,
8
5
  PluginDetailsOutput,
@@ -10,89 +7,13 @@ from cheshirecat_python_sdk.models.api.admins import (
10
7
  )
11
8
  from cheshirecat_python_sdk.models.api.nested.plugins import PluginSettingsOutput
12
9
  from cheshirecat_python_sdk.models.api.plugins import PluginCollectionOutput, PluginsSettingsOutput, PluginToggleOutput
13
- from cheshirecat_python_sdk.utils import deserialize, file_attributes
10
+ from cheshirecat_python_sdk.utils import file_attributes
14
11
 
15
12
 
16
13
  class AdminsEndpoint(AbstractEndpoint):
17
14
  def __init__(self, client: "CheshireCatClient"):
18
15
  super().__init__(client)
19
- self.prefix = "/admins"
20
-
21
- def post_admin(self, username: str, password: str, permissions: dict | None = None) -> AdminOutput:
22
- """
23
- Create a new admin user.
24
- :param username: The username of the user.
25
- :param password: The password of the user.
26
- :param permissions: The permissions of the user.
27
- :return: AdminOutput, the details of the user.
28
- """
29
- payload = {"username": username, "password": password}
30
- if permissions:
31
- payload["permissions"] = permissions # type: ignore
32
-
33
- return self.post_json(self.format_url("/users"), self.system_id, output_class=AdminOutput, payload=payload)
34
-
35
- def get_admins(self, limit: int | None = None, skip: int | None = None) -> List[AdminOutput]:
36
- """
37
- Get a list of all admin users.
38
- :param limit: The maximum number of users to return.
39
- :param skip: The number of users to skip.
40
- :return: List[AdminOutput], the details
41
- """
42
- query = {}
43
- if limit:
44
- query["limit"] = limit
45
- if skip:
46
- query["skip"] = skip
47
-
48
- response = self.get_http_client(self.system_id).get(self.format_url("/users"), params=query)
49
- response.raise_for_status()
50
-
51
- result = []
52
- for item in response.json():
53
- result.append(deserialize(item, AdminOutput))
54
- return result
55
-
56
- def get_admin(self, admin_id: str) -> AdminOutput:
57
- """
58
- Get the details of an admin user.
59
- :param admin_id: The ID of the user.
60
- :return: AdminOutput, the details of the user.
61
- """
62
- return self.get(self.format_url(f"/users/{admin_id}"), self.system_id, output_class=AdminOutput)
63
-
64
- def put_admin(
65
- self,
66
- admin_id: str,
67
- username: str | None = None,
68
- password: str | None = None,
69
- permissions: dict | None = None,
70
- ) -> AdminOutput:
71
- """
72
- Update the details of an admin user.
73
- :param admin_id: The ID of the user.
74
- :param username: The new username.
75
- :param password: The new password.
76
- :param permissions: The new permissions.
77
- :return: AdminOutput, the details of the user.
78
- """
79
- payload = {}
80
- if username:
81
- payload["username"] = username
82
- if password:
83
- payload["password"] = password
84
- if permissions:
85
- payload["permissions"] = permissions
86
-
87
- return self.put(self.format_url(f"/users/{admin_id}"), self.system_id, output_class=AdminOutput, payload=payload)
88
-
89
- def delete_admin(self, admin_id: str) -> AdminOutput:
90
- """
91
- Delete an admin user.
92
- :param admin_id: The ID of the user.
93
- :return: AdminOutput, the details of the user.
94
- """
95
- return self.delete(self.format_url(f"/users/{admin_id}"), self.system_id, output_class=AdminOutput)
16
+ self.prefix = "/plugins"
96
17
 
97
18
  def get_available_plugins(self, plugin_name: str | None = None) -> PluginCollectionOutput:
98
19
  """
@@ -101,7 +22,7 @@ class AdminsEndpoint(AbstractEndpoint):
101
22
  :return: PluginCollectionOutput, the details of the plugins.
102
23
  """
103
24
  return self.get(
104
- self.format_url("/plugins"),
25
+ self.format_url("/installed"),
105
26
  self.system_id,
106
27
  output_class=PluginCollectionOutput,
107
28
  query={"query": plugin_name} if plugin_name else None,
@@ -113,7 +34,7 @@ class AdminsEndpoint(AbstractEndpoint):
113
34
  with open(path_zip, "rb") as file:
114
35
  payload.files = [("file", file_attributes(path_zip, file))]
115
36
  result = self.post_multipart(
116
- self.format_url("/plugins/upload"),
37
+ self.format_url("/install/upload"),
117
38
  self.system_id,
118
39
  output_class=PluginInstallOutput,
119
40
  payload=payload,
@@ -127,7 +48,7 @@ class AdminsEndpoint(AbstractEndpoint):
127
48
  :return: PluginInstallFromRegistryOutput, the details of the installation.
128
49
  """
129
50
  return self.post_json(
130
- self.format_url("/plugins/upload/registry"),
51
+ self.format_url("/install/registry"),
131
52
  self.system_id,
132
53
  output_class=PluginInstallFromRegistryOutput,
133
54
  payload={"url": url},
@@ -138,7 +59,7 @@ class AdminsEndpoint(AbstractEndpoint):
138
59
  Get the default settings of all the plugins.
139
60
  :return: PluginsSettingsOutput, the details of the settings.
140
61
  """
141
- return self.get(self.format_url("/plugins/settings"), self.system_id, output_class=PluginsSettingsOutput)
62
+ return self.get(self.format_url("/system/settings"), self.system_id, output_class=PluginsSettingsOutput)
142
63
 
143
64
  def get_plugin_settings(self, plugin_id: str) -> PluginSettingsOutput:
144
65
  """
@@ -147,7 +68,7 @@ class AdminsEndpoint(AbstractEndpoint):
147
68
  :return: PluginSettingsOutput, the details of the settings.
148
69
  """
149
70
  return self.get(
150
- self.format_url(f"/plugins/settings/{plugin_id}"), self.system_id, output_class=PluginSettingsOutput
71
+ self.format_url(f"/system/settings/{plugin_id}"), self.system_id, output_class=PluginSettingsOutput
151
72
  )
152
73
 
153
74
  def get_plugin_details(self, plugin_id: str) -> PluginDetailsOutput:
@@ -156,7 +77,7 @@ class AdminsEndpoint(AbstractEndpoint):
156
77
  :param plugin_id: The ID of the plugin.
157
78
  :return: PluginDetailsOutput, the details of the plugin.
158
79
  """
159
- return self.get(self.format_url(f"/plugins/{plugin_id}"), self.system_id, output_class=PluginDetailsOutput)
80
+ return self.get(self.format_url(f"/system/details/{plugin_id}"), self.system_id, output_class=PluginDetailsOutput)
160
81
 
161
82
  def delete_plugin(self, plugin_id: str) -> PluginDeleteOutput:
162
83
  """
@@ -164,7 +85,7 @@ class AdminsEndpoint(AbstractEndpoint):
164
85
  :param plugin_id: The ID of the plugin.
165
86
  :return: PluginDeleteOutput, the details of the plugin.
166
87
  """
167
- return self.delete(self.format_url(f"/plugins/{plugin_id}"), self.system_id, output_class=PluginDeleteOutput)
88
+ return self.delete(self.format_url(f"/uninstall/{plugin_id}"), self.system_id, output_class=PluginDeleteOutput)
168
89
 
169
90
  def put_toggle_plugin(self, plugin_id: str) -> PluginToggleOutput:
170
91
  """
@@ -173,7 +94,7 @@ class AdminsEndpoint(AbstractEndpoint):
173
94
  :return: PluginToggleOutput, the toggled plugin
174
95
  """
175
96
  return self.put(
176
- self.format_url(f"/plugins/toggle/{plugin_id}"),
97
+ self.format_url(f"/system/toggle/{plugin_id}"),
177
98
  self.system_id,
178
99
  output_class=PluginToggleOutput,
179
100
  )
@@ -1,15 +1,9 @@
1
- from typing import Dict, List, Any
1
+ from typing import Dict, Any
2
2
  from pydantic import BaseModel
3
3
 
4
4
  from cheshirecat_python_sdk.models.api.plugins import PluginToggleOutput
5
5
 
6
6
 
7
- class AdminOutput(BaseModel):
8
- username: str
9
- permissions: Dict[str, List[str]]
10
- id: str
11
-
12
-
13
7
  class CreatedOutput(BaseModel):
14
8
  created: bool
15
9
 
@@ -10,12 +10,12 @@ class User(BaseModel):
10
10
  id: str
11
11
  username: str
12
12
  permissions: dict[str, list[str]]
13
+ created_at: float | None = None
14
+ updated_at: float | None = None
13
15
 
14
16
 
15
17
  class AgentMatch(BaseModel):
16
- agent_id: str
17
18
  agent_name: str
18
- agent_description: str | None = None
19
19
  user: User
20
20
 
21
21
 
@@ -6,3 +6,5 @@ class UserOutput(BaseModel):
6
6
  username: str
7
7
  permissions: Dict[str, List[str]]
8
8
  id: str
9
+ created_at: float | None = None
10
+ updated_at: float | None = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cheshirecat-python-sdk
3
- Version: 1.7.8
3
+ Version: 1.7.10
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 @@ cheshirecat_python_sdk/clients/__init__.py,sha256=i4Hqux9vihFRbXVK48yJ1k9gm4JeCH
12
12
  cheshirecat_python_sdk/clients/http_client.py,sha256=LnP0kr-kHRCwC-BZiysj1Zg-T3b3yuLd81wOctfcBTg,2319
13
13
  cheshirecat_python_sdk/clients/websocket_client.py,sha256=xNjkLSEZhpHzRqIZL21V0oG3srAGFaqYveMqlma2gvI,1932
14
14
  cheshirecat_python_sdk/endpoints/__init__.py,sha256=uQPclok3DdKTibR7ywDVM67eqtxEMwx_iuza37Wqkr8,1247
15
- cheshirecat_python_sdk/endpoints/admins.py,sha256=rc6jEhYF8KTTWFXLinm3xPV7Rj87iKT8Kp0zHn1qUO4,7024
15
+ cheshirecat_python_sdk/endpoints/admins.py,sha256=b4YpHO-Xqkd-PQxvQcXYAUmQkrTLTvEjf5R9pals-50,4116
16
16
  cheshirecat_python_sdk/endpoints/auth.py,sha256=_22fLGznoxo2pybcQGgcsHCpLoq76P6RplmSMMgajEQ,2031
17
17
  cheshirecat_python_sdk/endpoints/auth_handler.py,sha256=Jfi7E7L3SIzJyECbJnUenIyl6xxkJlyC31AHpAlmqSs,2117
18
18
  cheshirecat_python_sdk/endpoints/base.py,sha256=W_ynJur_cbT31KLp6F4pJ212tMaAa1BxnG75YS1UgNU,4075
@@ -31,7 +31,7 @@ cheshirecat_python_sdk/endpoints/users.py,sha256=PXlPPobLoWpiuAzi0k89YUyqSp24Sc5
31
31
  cheshirecat_python_sdk/endpoints/utils.py,sha256=yKGrFRpu6ItLnBEuc98093LbXqGYaGdgCLiWuLQJVno,2551
32
32
  cheshirecat_python_sdk/endpoints/vector_database.py,sha256=Xu6zcopjZgcFVVmyN547piiqFcaTUtF35X0QxQHycXQ,2149
33
33
  cheshirecat_python_sdk/models/dtos.py,sha256=yK6CfCGdwLvZtYFPoImDEgpV5eyHB2iwji2t6dh6gxc,668
34
- cheshirecat_python_sdk/models/api/admins.py,sha256=K1HzZrjEk--rmBSxEg3cbWm2MVQaSxTheMBhhBr54_4,767
34
+ cheshirecat_python_sdk/models/api/admins.py,sha256=sIX4NdEntjORgVACsqkBkzte4zwD6w35BdPRRG0D7uo,661
35
35
  cheshirecat_python_sdk/models/api/conversations.py,sha256=Ej8677MLBqZEME1lZFd4UhHokdja762zYNjV9ZaEg-I,505
36
36
  cheshirecat_python_sdk/models/api/factories.py,sha256=_NWz0nKhaVYEbaphxe2YZGznDIUiMKb-xqA1xymME5A,594
37
37
  cheshirecat_python_sdk/models/api/file_managers.py,sha256=V0ZBjQWmYM1t0Qpfp3W2NDI_tScOtORB0i5YMEpTiRU,301
@@ -39,11 +39,11 @@ cheshirecat_python_sdk/models/api/memories.py,sha256=4rqFuFNzNbmwIG1KGiSyfnv40nd
39
39
  cheshirecat_python_sdk/models/api/messages.py,sha256=PDojYuXUDXSek8nkg8QKoVdAJ2NMmhV4iWvbhOrekEE,441
40
40
  cheshirecat_python_sdk/models/api/plugins.py,sha256=uX8SYbcTxQSxv1IaVChEBd3rr6kc83rwq3IILnmq5EE,1996
41
41
  cheshirecat_python_sdk/models/api/rabbit_holes.py,sha256=01FcPSIG6nq9WJhL_rQopLMSD81CU9lfP-t0xtf35Gw,285
42
- cheshirecat_python_sdk/models/api/tokens.py,sha256=tJRx96ZrOS66anE9F5EvBLgd5aKNbrgn4EwpIvYaruQ,442
43
- cheshirecat_python_sdk/models/api/users.py,sha256=2l86y6ol0R0823gGl4bmc1TzGP4ZyvTm9AR8riKiatA,160
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
44
  cheshirecat_python_sdk/models/api/nested/memories.py,sha256=ddGDsmZa2refElM0sGz9QfKHGk50wsTpkwN5qDC5bF4,946
45
45
  cheshirecat_python_sdk/models/api/nested/plugins.py,sha256=7vrwgXh0csaUn11YKY_OWnGEnD8Fu_ewKxt024VOBEs,738
46
- cheshirecat_python_sdk-1.7.8.dist-info/METADATA,sha256=IXBVpmqcBTo7q_VnGFPgKsIeIpGpv4_tEhRRSt0xSAM,44136
47
- cheshirecat_python_sdk-1.7.8.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
48
- cheshirecat_python_sdk-1.7.8.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
49
- cheshirecat_python_sdk-1.7.8.dist-info/RECORD,,
46
+ cheshirecat_python_sdk-1.7.10.dist-info/METADATA,sha256=5BeA62kQ9doDPdbEQPXBufjkN9rhME7AvZh3jk_ce34,44137
47
+ cheshirecat_python_sdk-1.7.10.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
48
+ cheshirecat_python_sdk-1.7.10.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
49
+ cheshirecat_python_sdk-1.7.10.dist-info/RECORD,,