cheshirecat-python-sdk 1.7.8__tar.gz → 1.7.10__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.7.8 → cheshirecat_python_sdk-1.7.10}/PKG-INFO +1 -1
  2. cheshirecat_python_sdk-1.7.10/cheshirecat_python_sdk/endpoints/admins.py +100 -0
  3. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/models/api/admins.py +1 -7
  4. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/models/api/tokens.py +2 -2
  5. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/models/api/users.py +2 -0
  6. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/pyproject.toml +1 -1
  7. cheshirecat_python_sdk-1.7.8/cheshirecat_python_sdk/endpoints/admins.py +0 -179
  8. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/.gitignore +0 -0
  9. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/LICENSE +0 -0
  10. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/Makefile +0 -0
  11. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/README.md +0 -0
  12. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/__init__.py +0 -0
  13. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/builders/__init__.py +0 -0
  14. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/builders/base.py +0 -0
  15. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/builders/memory.py +0 -0
  16. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/builders/settings_input.py +0 -0
  17. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/builders/why.py +0 -0
  18. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/client.py +0 -0
  19. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/clients/__init__.py +0 -0
  20. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/clients/http_client.py +0 -0
  21. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/clients/websocket_client.py +0 -0
  22. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/configuration.py +0 -0
  23. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/endpoints/__init__.py +0 -0
  24. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/endpoints/auth.py +0 -0
  25. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/endpoints/auth_handler.py +0 -0
  26. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/endpoints/base.py +0 -0
  27. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/endpoints/chunker.py +0 -0
  28. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/endpoints/conversation.py +0 -0
  29. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/endpoints/custom_endpoint.py +0 -0
  30. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/endpoints/embedder.py +0 -0
  31. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/endpoints/file_manager.py +0 -0
  32. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/endpoints/health_check.py +0 -0
  33. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/endpoints/large_language_model.py +0 -0
  34. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/endpoints/memory.py +0 -0
  35. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/endpoints/message.py +0 -0
  36. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/endpoints/plugins.py +0 -0
  37. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/endpoints/rabbit_hole.py +0 -0
  38. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/endpoints/users.py +0 -0
  39. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/endpoints/utils.py +0 -0
  40. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/endpoints/vector_database.py +0 -0
  41. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/enums.py +0 -0
  42. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/models/api/conversations.py +0 -0
  43. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/models/api/factories.py +0 -0
  44. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/models/api/file_managers.py +0 -0
  45. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/models/api/memories.py +0 -0
  46. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/models/api/messages.py +0 -0
  47. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/models/api/nested/memories.py +0 -0
  48. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/models/api/nested/plugins.py +0 -0
  49. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/models/api/plugins.py +0 -0
  50. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/models/api/rabbit_holes.py +0 -0
  51. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/models/dtos.py +0 -0
  52. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/cheshirecat_python_sdk/utils.py +0 -0
  53. {cheshirecat_python_sdk-1.7.8 → cheshirecat_python_sdk-1.7.10}/requirements.txt +0 -0
@@ -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
@@ -0,0 +1,100 @@
1
+ from cheshirecat_python_sdk.endpoints.base import AbstractEndpoint, MultipartPayload
2
+ from cheshirecat_python_sdk.models.api.admins import (
3
+ PluginInstallOutput,
4
+ PluginInstallFromRegistryOutput,
5
+ PluginDetailsOutput,
6
+ PluginDeleteOutput,
7
+ )
8
+ from cheshirecat_python_sdk.models.api.nested.plugins import PluginSettingsOutput
9
+ from cheshirecat_python_sdk.models.api.plugins import PluginCollectionOutput, PluginsSettingsOutput, PluginToggleOutput
10
+ from cheshirecat_python_sdk.utils import file_attributes
11
+
12
+
13
+ class AdminsEndpoint(AbstractEndpoint):
14
+ def __init__(self, client: "CheshireCatClient"):
15
+ super().__init__(client)
16
+ self.prefix = "/plugins"
17
+
18
+ def get_available_plugins(self, plugin_name: str | None = None) -> PluginCollectionOutput:
19
+ """
20
+ Get a list of all available plugins.
21
+ :param plugin_name: The name of the plugin.
22
+ :return: PluginCollectionOutput, the details of the plugins.
23
+ """
24
+ return self.get(
25
+ self.format_url("/installed"),
26
+ self.system_id,
27
+ output_class=PluginCollectionOutput,
28
+ query={"query": plugin_name} if plugin_name else None,
29
+ )
30
+
31
+ def post_install_plugin_from_zip(self, path_zip: str) -> PluginInstallOutput:
32
+ payload = MultipartPayload()
33
+
34
+ with open(path_zip, "rb") as file:
35
+ payload.files = [("file", file_attributes(path_zip, file))]
36
+ result = self.post_multipart(
37
+ self.format_url("/install/upload"),
38
+ self.system_id,
39
+ output_class=PluginInstallOutput,
40
+ payload=payload,
41
+ )
42
+ return result
43
+
44
+ def post_install_plugin_from_registry(self, url: str) -> PluginInstallFromRegistryOutput:
45
+ """
46
+ Install a new plugin from a registry. The plugin is installed asynchronously.
47
+ :param url: The URL of the plugin.
48
+ :return: PluginInstallFromRegistryOutput, the details of the installation.
49
+ """
50
+ return self.post_json(
51
+ self.format_url("/install/registry"),
52
+ self.system_id,
53
+ output_class=PluginInstallFromRegistryOutput,
54
+ payload={"url": url},
55
+ )
56
+
57
+ def get_plugins_settings(self) -> PluginsSettingsOutput:
58
+ """
59
+ Get the default settings of all the plugins.
60
+ :return: PluginsSettingsOutput, the details of the settings.
61
+ """
62
+ return self.get(self.format_url("/system/settings"), self.system_id, output_class=PluginsSettingsOutput)
63
+
64
+ def get_plugin_settings(self, plugin_id: str) -> PluginSettingsOutput:
65
+ """
66
+ Get the default settings of a specific plugin.
67
+ :param plugin_id: The ID of the plugin.
68
+ :return: PluginSettingsOutput, the details of the settings.
69
+ """
70
+ return self.get(
71
+ self.format_url(f"/system/settings/{plugin_id}"), self.system_id, output_class=PluginSettingsOutput
72
+ )
73
+
74
+ def get_plugin_details(self, plugin_id: str) -> PluginDetailsOutput:
75
+ """
76
+ Get the details of a specific plugin.
77
+ :param plugin_id: The ID of the plugin.
78
+ :return: PluginDetailsOutput, the details of the plugin.
79
+ """
80
+ return self.get(self.format_url(f"/system/details/{plugin_id}"), self.system_id, output_class=PluginDetailsOutput)
81
+
82
+ def delete_plugin(self, plugin_id: str) -> PluginDeleteOutput:
83
+ """
84
+ Delete a specific plugin.
85
+ :param plugin_id: The ID of the plugin.
86
+ :return: PluginDeleteOutput, the details of the plugin.
87
+ """
88
+ return self.delete(self.format_url(f"/uninstall/{plugin_id}"), self.system_id, output_class=PluginDeleteOutput)
89
+
90
+ def put_toggle_plugin(self, plugin_id: str) -> PluginToggleOutput:
91
+ """
92
+ This endpoint toggles a plugin, on a system level
93
+ :param plugin_id: The id of the plugin to toggle
94
+ :return: PluginToggleOutput, the toggled plugin
95
+ """
96
+ return self.put(
97
+ self.format_url(f"/system/toggle/{plugin_id}"),
98
+ self.system_id,
99
+ output_class=PluginToggleOutput,
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,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.7.8"
4
+ version = "1.7.10"
5
5
  requires-python = ">=3.10"
6
6
  license = { file = "LICENSE" }
7
7
  authors = [
@@ -1,179 +0,0 @@
1
- from typing import List
2
-
3
- from cheshirecat_python_sdk.endpoints.base import AbstractEndpoint, MultipartPayload
4
- from cheshirecat_python_sdk.models.api.admins import (
5
- AdminOutput,
6
- PluginInstallOutput,
7
- PluginInstallFromRegistryOutput,
8
- PluginDetailsOutput,
9
- PluginDeleteOutput,
10
- )
11
- from cheshirecat_python_sdk.models.api.nested.plugins import PluginSettingsOutput
12
- from cheshirecat_python_sdk.models.api.plugins import PluginCollectionOutput, PluginsSettingsOutput, PluginToggleOutput
13
- from cheshirecat_python_sdk.utils import deserialize, file_attributes
14
-
15
-
16
- class AdminsEndpoint(AbstractEndpoint):
17
- def __init__(self, client: "CheshireCatClient"):
18
- 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)
96
-
97
- def get_available_plugins(self, plugin_name: str | None = None) -> PluginCollectionOutput:
98
- """
99
- Get a list of all available plugins.
100
- :param plugin_name: The name of the plugin.
101
- :return: PluginCollectionOutput, the details of the plugins.
102
- """
103
- return self.get(
104
- self.format_url("/plugins"),
105
- self.system_id,
106
- output_class=PluginCollectionOutput,
107
- query={"query": plugin_name} if plugin_name else None,
108
- )
109
-
110
- def post_install_plugin_from_zip(self, path_zip: str) -> PluginInstallOutput:
111
- payload = MultipartPayload()
112
-
113
- with open(path_zip, "rb") as file:
114
- payload.files = [("file", file_attributes(path_zip, file))]
115
- result = self.post_multipart(
116
- self.format_url("/plugins/upload"),
117
- self.system_id,
118
- output_class=PluginInstallOutput,
119
- payload=payload,
120
- )
121
- return result
122
-
123
- def post_install_plugin_from_registry(self, url: str) -> PluginInstallFromRegistryOutput:
124
- """
125
- Install a new plugin from a registry. The plugin is installed asynchronously.
126
- :param url: The URL of the plugin.
127
- :return: PluginInstallFromRegistryOutput, the details of the installation.
128
- """
129
- return self.post_json(
130
- self.format_url("/plugins/upload/registry"),
131
- self.system_id,
132
- output_class=PluginInstallFromRegistryOutput,
133
- payload={"url": url},
134
- )
135
-
136
- def get_plugins_settings(self) -> PluginsSettingsOutput:
137
- """
138
- Get the default settings of all the plugins.
139
- :return: PluginsSettingsOutput, the details of the settings.
140
- """
141
- return self.get(self.format_url("/plugins/settings"), self.system_id, output_class=PluginsSettingsOutput)
142
-
143
- def get_plugin_settings(self, plugin_id: str) -> PluginSettingsOutput:
144
- """
145
- Get the default settings of a specific plugin.
146
- :param plugin_id: The ID of the plugin.
147
- :return: PluginSettingsOutput, the details of the settings.
148
- """
149
- return self.get(
150
- self.format_url(f"/plugins/settings/{plugin_id}"), self.system_id, output_class=PluginSettingsOutput
151
- )
152
-
153
- def get_plugin_details(self, plugin_id: str) -> PluginDetailsOutput:
154
- """
155
- Get the details of a specific plugin.
156
- :param plugin_id: The ID of the plugin.
157
- :return: PluginDetailsOutput, the details of the plugin.
158
- """
159
- return self.get(self.format_url(f"/plugins/{plugin_id}"), self.system_id, output_class=PluginDetailsOutput)
160
-
161
- def delete_plugin(self, plugin_id: str) -> PluginDeleteOutput:
162
- """
163
- Delete a specific plugin.
164
- :param plugin_id: The ID of the plugin.
165
- :return: PluginDeleteOutput, the details of the plugin.
166
- """
167
- return self.delete(self.format_url(f"/plugins/{plugin_id}"), self.system_id, output_class=PluginDeleteOutput)
168
-
169
- def put_toggle_plugin(self, plugin_id: str) -> PluginToggleOutput:
170
- """
171
- This endpoint toggles a plugin, on a system level
172
- :param plugin_id: The id of the plugin to toggle
173
- :return: PluginToggleOutput, the toggled plugin
174
- """
175
- return self.put(
176
- self.format_url(f"/plugins/toggle/{plugin_id}"),
177
- self.system_id,
178
- output_class=PluginToggleOutput,
179
- )