cheshirecat-python-sdk 1.7.4__py3-none-any.whl → 1.7.5__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.
@@ -2,6 +2,7 @@ from abc import ABC
2
2
  from typing import Dict, Any, List, Tuple, Type
3
3
  import requests
4
4
  from pydantic import BaseModel
5
+ from requests_toolbelt.sessions import BaseUrlSession
5
6
  from websockets import ClientConnection
6
7
 
7
8
  from cheshirecat_python_sdk.utils import T, deserialize
@@ -29,7 +30,7 @@ class AbstractEndpoint(ABC):
29
30
  ) -> requests.Session:
30
31
  return self.client.http_client.get_client(agent_id, user_id, chat_id)
31
32
 
32
- def get_http_session(self):
33
+ def get_http_session(self) -> BaseUrlSession:
33
34
  return self.client.http_client.get_base_session()
34
35
 
35
36
  async def get_ws_client(self, agent_id: str, user_id: str, chat_id: str | None = None) -> ClientConnection:
@@ -2,6 +2,7 @@ from typing import List
2
2
 
3
3
  from cheshirecat_python_sdk.endpoints.base import AbstractEndpoint
4
4
  from cheshirecat_python_sdk.models.api.admins import ResetOutput, ClonedOutput, CreatedOutput
5
+ from cheshirecat_python_sdk.utils import deserialize
5
6
 
6
7
 
7
8
  class UtilsEndpoint(AbstractEndpoint):
@@ -29,7 +30,15 @@ class UtilsEndpoint(AbstractEndpoint):
29
30
  :param agent_id: The ID of the agent.
30
31
  :return: CreatedOutput, the details of the agent.
31
32
  """
32
- return self.post_json(self.format_url("/agents/create/"), agent_id, output_class=CreatedOutput)
33
+ response = self.get_http_client().post(
34
+ self.format_url("/agents/create/"),
35
+ json={
36
+ "agent_id": agent_id,
37
+ },
38
+ )
39
+ response.raise_for_status()
40
+
41
+ return deserialize(response.json(), CreatedOutput)
33
42
 
34
43
  def post_agent_reset(self, agent_id: str) -> ResetOutput:
35
44
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cheshirecat-python-sdk
3
- Version: 1.7.4
3
+ Version: 1.7.5
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
@@ -15,7 +15,7 @@ cheshirecat_python_sdk/endpoints/__init__.py,sha256=uQPclok3DdKTibR7ywDVM67eqtxE
15
15
  cheshirecat_python_sdk/endpoints/admins.py,sha256=rc6jEhYF8KTTWFXLinm3xPV7Rj87iKT8Kp0zHn1qUO4,7024
16
16
  cheshirecat_python_sdk/endpoints/auth.py,sha256=GcmN90uZIgeRqc_NjBhZx7bxYRSpfKL6ZOLHLom1aKQ,1658
17
17
  cheshirecat_python_sdk/endpoints/auth_handler.py,sha256=Jfi7E7L3SIzJyECbJnUenIyl6xxkJlyC31AHpAlmqSs,2117
18
- cheshirecat_python_sdk/endpoints/base.py,sha256=ldayH0QxQfzD5bYqlMBH1JVBOTd11RYDWxf-6kl0fng,4003
18
+ cheshirecat_python_sdk/endpoints/base.py,sha256=W_ynJur_cbT31KLp6F4pJ212tMaAa1BxnG75YS1UgNU,4075
19
19
  cheshirecat_python_sdk/endpoints/chunker.py,sha256=bgp-2gQpKt7W_B46eEb-KFRkd4eZJH0euwsf3N0jfC8,1979
20
20
  cheshirecat_python_sdk/endpoints/conversation.py,sha256=jG1z7ivdD53H8JZe7WZWihoBWy2_-W951SwKXmnpmTk,3282
21
21
  cheshirecat_python_sdk/endpoints/custom_endpoint.py,sha256=HVRQMqA5JfPr87gHtWpYcsXsE-TA-coXLcvsPKabqds,2791
@@ -28,7 +28,7 @@ cheshirecat_python_sdk/endpoints/message.py,sha256=QTUSUJcj52VhfnX9hdjsD2aLeFC43
28
28
  cheshirecat_python_sdk/endpoints/plugins.py,sha256=FasjwNY2UVv7zfg9lvXEj2ATefPDOPQpJXzQ2BbQIYI,3474
29
29
  cheshirecat_python_sdk/endpoints/rabbit_hole.py,sha256=DH5KGpk0Ur8RPi1fZIO9D925mc2D0GHQpsOeIKIa1G0,7213
30
30
  cheshirecat_python_sdk/endpoints/users.py,sha256=PXlPPobLoWpiuAzi0k89YUyqSp24Sc5DEcDQYGRXRBA,5369
31
- cheshirecat_python_sdk/endpoints/utils.py,sha256=UhhWCC4h9c7lbPxAaV3nHjLYwod4z0tHzrE-2tuKs8M,2328
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
34
  cheshirecat_python_sdk/models/api/admins.py,sha256=K1HzZrjEk--rmBSxEg3cbWm2MVQaSxTheMBhhBr54_4,767
@@ -43,7 +43,7 @@ cheshirecat_python_sdk/models/api/tokens.py,sha256=5vzQqmcYWg593U1cTnnmLPZMNkgNN
43
43
  cheshirecat_python_sdk/models/api/users.py,sha256=2l86y6ol0R0823gGl4bmc1TzGP4ZyvTm9AR8riKiatA,160
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.4.dist-info/METADATA,sha256=R1wHR1rsC5gYTtJFJ-zM02uo_qY2S2yJa-i8Bh5i4eM,44136
47
- cheshirecat_python_sdk-1.7.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
48
- cheshirecat_python_sdk-1.7.4.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
49
- cheshirecat_python_sdk-1.7.4.dist-info/RECORD,,
46
+ cheshirecat_python_sdk-1.7.5.dist-info/METADATA,sha256=D_uTbiY6L-IzZDrsZkJaBwY2EX-D5m68IaDqm-fyeCQ,44136
47
+ cheshirecat_python_sdk-1.7.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
48
+ cheshirecat_python_sdk-1.7.5.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
49
+ cheshirecat_python_sdk-1.7.5.dist-info/RECORD,,