cheshirecat-python-sdk 1.7.1__py3-none-any.whl → 1.7.2__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,7 +2,7 @@ from typing import Callable
2
2
  import json
3
3
 
4
4
  from cheshirecat_python_sdk.endpoints.base import AbstractEndpoint
5
- from cheshirecat_python_sdk.models.api.messages import MessageOutput
5
+ from cheshirecat_python_sdk.models.api.messages import ChatOutput
6
6
  from cheshirecat_python_sdk.models.dtos import Message
7
7
  from cheshirecat_python_sdk.utils import deserialize
8
8
 
@@ -14,19 +14,19 @@ class MessageEndpoint(AbstractEndpoint):
14
14
  agent_id: str,
15
15
  user_id: str,
16
16
  chat_id: str | None = None,
17
- ) -> MessageOutput:
17
+ ) -> ChatOutput:
18
18
  """
19
19
  This endpoint sends a message to the agent identified by the agentId parameter. The message is sent via HTTP.
20
20
  :param message: Message object, the message to send
21
21
  :param agent_id: the agent id
22
22
  :param user_id: the user id
23
23
  :param chat_id: the chat id (optional)
24
- :return: MessageOutput object
24
+ :return: ChatOutput object
25
25
  """
26
26
  return self.post_json(
27
27
  '/message',
28
28
  agent_id,
29
- output_class=MessageOutput,
29
+ output_class=ChatOutput,
30
30
  payload=message.model_dump(),
31
31
  user_id=user_id,
32
32
  chat_id=chat_id,
@@ -39,7 +39,7 @@ class MessageEndpoint(AbstractEndpoint):
39
39
  user_id: str,
40
40
  chat_id: str | None = None,
41
41
  callback: Callable[[str], None] | None = None
42
- ) -> MessageOutput:
42
+ ) -> ChatOutput:
43
43
  """
44
44
  This endpoint sends a message to the agent identified by the agentId parameter. The message is sent via WebSocket.
45
45
  :param message: Message object, the message to send
@@ -47,7 +47,7 @@ class MessageEndpoint(AbstractEndpoint):
47
47
  :param user_id: the user id
48
48
  :param chat_id: the chat id
49
49
  :param callback: callable, a callback function that will be called for each message received
50
- :return: MessageOutput object
50
+ :return: ChatOutput object
51
51
  """
52
52
  try:
53
53
  json_data = json.dumps(message.model_dump())
@@ -74,4 +74,4 @@ class MessageEndpoint(AbstractEndpoint):
74
74
  raise Exception(f"WebSocket error: {str(e)}")
75
75
 
76
76
  await client.close()
77
- return deserialize(json.loads(response), MessageOutput)
77
+ return deserialize(json.loads(response), ChatOutput)
@@ -1,4 +1,4 @@
1
- from pydantic import Field
1
+ from pydantic import Field, BaseModel
2
2
 
3
3
  from cheshirecat_python_sdk.models.dtos import MessageBase, Why
4
4
 
@@ -12,3 +12,10 @@ class MessageOutput(MessageBase):
12
12
  def __init__(self, **data):
13
13
  super().__init__(**data)
14
14
  self.content = self.text
15
+
16
+
17
+ class ChatOutput(BaseModel):
18
+ agent_id: str
19
+ user_id: str
20
+ chat_id: str
21
+ message: MessageOutput
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cheshirecat-python-sdk
3
- Version: 1.7.1
3
+ Version: 1.7.2
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
@@ -23,7 +23,7 @@ cheshirecat_python_sdk/endpoints/file_manager.py,sha256=qzMzvSt3eBYNb5VstQq8MdV1
23
23
  cheshirecat_python_sdk/endpoints/health_check.py,sha256=cLhjNuuP7v28Gft6N6xATtpX6iSjYBbnp_E5Bzg3h7s,391
24
24
  cheshirecat_python_sdk/endpoints/large_language_model.py,sha256=SS787ZKMZQ7KQNvl7a7rfBCm6s1j3ifDfWQcrM4tn-k,2109
25
25
  cheshirecat_python_sdk/endpoints/memory.py,sha256=dEnQ2Hb_VG907p7T9oQgPCWWFHAUwkgwpVVJ1bLsWGw,8959
26
- cheshirecat_python_sdk/endpoints/message.py,sha256=CMGNtEa7c5t8KQ9mrI2yn2wYB1lV0gTwp_WgTxXf5WY,2628
26
+ cheshirecat_python_sdk/endpoints/message.py,sha256=QTUSUJcj52VhfnX9hdjsD2aLeFC43O4eU8ld5lRvITU,2607
27
27
  cheshirecat_python_sdk/endpoints/plugins.py,sha256=FasjwNY2UVv7zfg9lvXEj2ATefPDOPQpJXzQ2BbQIYI,3474
28
28
  cheshirecat_python_sdk/endpoints/rabbit_hole.py,sha256=DH5KGpk0Ur8RPi1fZIO9D925mc2D0GHQpsOeIKIa1G0,7213
29
29
  cheshirecat_python_sdk/endpoints/users.py,sha256=Pc_Od5pNMiyEAbxs_-en4YAZOfIPa1vZOcjScsJFh04,6559
@@ -35,14 +35,14 @@ cheshirecat_python_sdk/models/api/conversations.py,sha256=K5EwO13gJssHPe7ikAq0rR
35
35
  cheshirecat_python_sdk/models/api/factories.py,sha256=_NWz0nKhaVYEbaphxe2YZGznDIUiMKb-xqA1xymME5A,594
36
36
  cheshirecat_python_sdk/models/api/file_managers.py,sha256=V0ZBjQWmYM1t0Qpfp3W2NDI_tScOtORB0i5YMEpTiRU,301
37
37
  cheshirecat_python_sdk/models/api/memories.py,sha256=4rqFuFNzNbmwIG1KGiSyfnv40nds5g7fSkov3drj0cc,948
38
- cheshirecat_python_sdk/models/api/messages.py,sha256=p9whK-XmIvZ6D_Nl305PF110Xlix8HEkUezUaRBWfas,489
38
+ cheshirecat_python_sdk/models/api/messages.py,sha256=oslVFn8sMNOZyQkOzAncI2W2WLX0Tmd8Avc81iEIpWo,609
39
39
  cheshirecat_python_sdk/models/api/plugins.py,sha256=uX8SYbcTxQSxv1IaVChEBd3rr6kc83rwq3IILnmq5EE,1996
40
40
  cheshirecat_python_sdk/models/api/rabbit_holes.py,sha256=01FcPSIG6nq9WJhL_rQopLMSD81CU9lfP-t0xtf35Gw,285
41
41
  cheshirecat_python_sdk/models/api/tokens.py,sha256=5vzQqmcYWg593U1cTnnmLPZMNkgNNY5egQBQTE-NDoE,123
42
42
  cheshirecat_python_sdk/models/api/users.py,sha256=2l86y6ol0R0823gGl4bmc1TzGP4ZyvTm9AR8riKiatA,160
43
43
  cheshirecat_python_sdk/models/api/nested/memories.py,sha256=ddGDsmZa2refElM0sGz9QfKHGk50wsTpkwN5qDC5bF4,946
44
44
  cheshirecat_python_sdk/models/api/nested/plugins.py,sha256=7vrwgXh0csaUn11YKY_OWnGEnD8Fu_ewKxt024VOBEs,738
45
- cheshirecat_python_sdk-1.7.1.dist-info/METADATA,sha256=hNVnFX61onho_1xyKMa1NNA3vK0hOwmAx-EFJmiL8AY,44136
46
- cheshirecat_python_sdk-1.7.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
47
- cheshirecat_python_sdk-1.7.1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
48
- cheshirecat_python_sdk-1.7.1.dist-info/RECORD,,
45
+ cheshirecat_python_sdk-1.7.2.dist-info/METADATA,sha256=bu7T8caLI_n4WhDV3BDrtS1smqgerd_y-59g-sFdC6s,44136
46
+ cheshirecat_python_sdk-1.7.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
47
+ cheshirecat_python_sdk-1.7.2.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
48
+ cheshirecat_python_sdk-1.7.2.dist-info/RECORD,,