cheshirecat-python-sdk 1.7.5__py3-none-any.whl → 1.7.6__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,7 +1,7 @@
1
1
  from typing import Any
2
2
 
3
3
  from cheshirecat_python_sdk.endpoints.base import AbstractEndpoint
4
- from cheshirecat_python_sdk.models.api.tokens import TokenOutput
4
+ from cheshirecat_python_sdk.models.api.tokens import TokenOutput, MeOutput
5
5
  from cheshirecat_python_sdk.utils import deserialize
6
6
 
7
7
 
@@ -10,7 +10,7 @@ class AuthEndpoint(AbstractEndpoint):
10
10
  super().__init__(client)
11
11
  self.prefix = "/auth"
12
12
 
13
- def token(self, username: str, password: str, agent_id: str | None = None) -> TokenOutput:
13
+ def token(self, username: str, password: str) -> TokenOutput:
14
14
  """
15
15
  This endpoint is used to get a token for the user. The token is used to authenticate the user in the system. When
16
16
  the token expires, the user must request a new token.
@@ -21,7 +21,6 @@ class AuthEndpoint(AbstractEndpoint):
21
21
  "username": username,
22
22
  "password": password,
23
23
  },
24
- headers={"X-Agent-ID": agent_id} if agent_id else None,
25
24
  )
26
25
  response.raise_for_status()
27
26
 
@@ -40,3 +39,16 @@ class AuthEndpoint(AbstractEndpoint):
40
39
  response.raise_for_status()
41
40
 
42
41
  return response.json()
42
+
43
+ def me(self, token: str) -> MeOutput:
44
+ """
45
+ This endpoint is used to get the current user information. The user information includes the list of agents
46
+ the user has access to. This endpoint requires authentication.
47
+ """
48
+ self.client.add_token(token)
49
+
50
+ response = self.get_http_client().get("/me")
51
+ response.raise_for_status()
52
+
53
+ result = deserialize(response.json(), MeOutput)
54
+ return result
@@ -4,3 +4,22 @@ from pydantic import BaseModel
4
4
  class TokenOutput(BaseModel):
5
5
  access_token: str
6
6
  token_type: str | None = "bearer"
7
+
8
+
9
+ class User(BaseModel):
10
+ id: str
11
+ username: str
12
+ permissions: dict[str, list[str]]
13
+
14
+
15
+ class AgentMatch(BaseModel):
16
+ agent_id: str
17
+ agent_name: str
18
+ agent_description: str | None = None
19
+ user: User
20
+
21
+
22
+ class MeOutput(BaseModel):
23
+ success : bool
24
+ agents: list[AgentMatch]
25
+ auto_selected: bool
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cheshirecat-python-sdk
3
- Version: 1.7.5
3
+ Version: 1.7.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
@@ -13,7 +13,7 @@ cheshirecat_python_sdk/clients/http_client.py,sha256=LnP0kr-kHRCwC-BZiysj1Zg-T3b
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
15
  cheshirecat_python_sdk/endpoints/admins.py,sha256=rc6jEhYF8KTTWFXLinm3xPV7Rj87iKT8Kp0zHn1qUO4,7024
16
- cheshirecat_python_sdk/endpoints/auth.py,sha256=GcmN90uZIgeRqc_NjBhZx7bxYRSpfKL6ZOLHLom1aKQ,1658
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
19
19
  cheshirecat_python_sdk/endpoints/chunker.py,sha256=bgp-2gQpKt7W_B46eEb-KFRkd4eZJH0euwsf3N0jfC8,1979
@@ -39,11 +39,11 @@ cheshirecat_python_sdk/models/api/memories.py,sha256=4rqFuFNzNbmwIG1KGiSyfnv40nd
39
39
  cheshirecat_python_sdk/models/api/messages.py,sha256=oslVFn8sMNOZyQkOzAncI2W2WLX0Tmd8Avc81iEIpWo,609
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=5vzQqmcYWg593U1cTnnmLPZMNkgNNY5egQBQTE-NDoE,123
42
+ cheshirecat_python_sdk/models/api/tokens.py,sha256=tJRx96ZrOS66anE9F5EvBLgd5aKNbrgn4EwpIvYaruQ,442
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.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,,
46
+ cheshirecat_python_sdk-1.7.6.dist-info/METADATA,sha256=IHhoqsj7YiRvzbu-DDWoweHhwPQb7lVLmJs0t9rTKXk,44136
47
+ cheshirecat_python_sdk-1.7.6.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
48
+ cheshirecat_python_sdk-1.7.6.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
49
+ cheshirecat_python_sdk-1.7.6.dist-info/RECORD,,