aidial-client 0.12.0.dev1__tar.gz → 0.12.0.dev3__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 (71) hide show
  1. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/PKG-INFO +66 -3
  2. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/README.md +65 -2
  3. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/__init__.py +2 -0
  4. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/_client.py +2 -0
  5. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/resources/__init__.py +3 -0
  6. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/resources/files.py +18 -2
  7. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/resources/metadata.py +45 -6
  8. aidial_client-0.12.0.dev3/aidial_client/resources/user.py +19 -0
  9. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/types/metadata.py +1 -0
  10. aidial_client-0.12.0.dev3/aidial_client/types/user.py +11 -0
  11. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/pyproject.toml +1 -1
  12. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/LICENSE +0 -0
  13. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/_auth.py +0 -0
  14. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/_client_pool.py +0 -0
  15. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/_compatibility/__init__.py +0 -0
  16. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/_compatibility/openai.py +0 -0
  17. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/_compatibility/pydantic.py +0 -0
  18. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/_compatibility/pydantic_v1.py +0 -0
  19. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/_constants.py +0 -0
  20. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/_exception.py +0 -0
  21. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/_http_client/__init__.py +0 -0
  22. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/_http_client/_async.py +0 -0
  23. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/_http_client/_base.py +0 -0
  24. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/_http_client/_sse.py +0 -0
  25. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/_http_client/_sync.py +0 -0
  26. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/_internal_types/__init__.py +0 -0
  27. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/_internal_types/_defaults.py +0 -0
  28. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/_internal_types/_generic.py +0 -0
  29. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/_internal_types/_http_request.py +0 -0
  30. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/_internal_types/_json_rpc.py +0 -0
  31. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/_internal_types/_model.py +0 -0
  32. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/_log.py +0 -0
  33. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/_utils/__init__.py +0 -0
  34. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/_utils/_alias.py +0 -0
  35. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/_utils/_dict.py +0 -0
  36. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/_utils/_openai.py +0 -0
  37. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/_utils/_response_processing.py +0 -0
  38. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/_utils/_type_guard.py +0 -0
  39. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/helpers/__init__.py +0 -0
  40. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/helpers/_url.py +0 -0
  41. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/helpers/storage_resource.py +0 -0
  42. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/py.typed +0 -0
  43. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/resources/application.py +0 -0
  44. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/resources/base.py +0 -0
  45. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/resources/bucket.py +0 -0
  46. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/resources/chat/__init__.py +0 -0
  47. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/resources/chat/completions.py +0 -0
  48. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/resources/client_channel.py +0 -0
  49. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/resources/deployments.py +0 -0
  50. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/resources/model.py +0 -0
  51. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/resources/prompts.py +0 -0
  52. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/resources/resource_permissions.py +0 -0
  53. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/resources/toolset.py +0 -0
  54. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/types/__init__.py +0 -0
  55. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/types/application.py +0 -0
  56. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/types/bucket.py +0 -0
  57. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/types/chat/__init__.py +0 -0
  58. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/types/chat/function.py +0 -0
  59. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/types/chat/legacy/__init__.py +0 -0
  60. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/types/chat/legacy/application_request.py +0 -0
  61. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/types/chat/legacy/chat_completion.py +0 -0
  62. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/types/chat/request.py +0 -0
  63. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/types/chat/request_param.py +0 -0
  64. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/types/chat/response.py +0 -0
  65. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/types/chat/tool.py +0 -0
  66. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/types/client_channel.py +0 -0
  67. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/types/deployment.py +0 -0
  68. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/types/file.py +0 -0
  69. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/types/model.py +0 -0
  70. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/types/prompt.py +0 -0
  71. {aidial_client-0.12.0.dev1 → aidial_client-0.12.0.dev3}/aidial_client/types/toolset.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aidial-client
3
- Version: 0.12.0.dev1
3
+ Version: 0.12.0.dev3
4
4
  Summary: A Python client library for the AI DIAL API
5
5
  License-Expression: Apache-2.0
6
6
  License-File: LICENSE
@@ -61,6 +61,8 @@ Description-Content-Type: text/markdown
61
61
  - [Get Application by Id](#get-application-by-id)
62
62
  - [Models](#models)
63
63
  - [Get Model by Name](#get-model-by-name)
64
+ - [User](#user)
65
+ - [Get Authenticated User Info](#get-authenticated-user-info)
64
66
  - [Toolsets](#toolsets)
65
67
  - [Get Toolset by Id](#get-toolset-by-id)
66
68
  - [Resource Permissions](#resource-permissions)
@@ -643,14 +645,32 @@ Both methods return `None` on success. `source` and `destination` must point to
643
645
 
644
646
  #### Accessing Metadata
645
647
 
646
- Use `metadata()` to access metadata of a file:
648
+ Use `get_metadata()` to access metadata of a file or folder:
647
649
 
648
650
  ```python
649
- metadata = await async_client.files.metadata(
651
+ # Sync client
652
+ metadata = sync_client.files.get_metadata(
653
+ url=sync_client.my_files_home() / "relative_folder/my-file.txt"
654
+ )
655
+
656
+ # Async client
657
+ metadata = await async_client.files.get_metadata(
650
658
  url=await async_client.my_files_home() / "relative_folder/my-file.txt"
651
659
  )
652
660
  ```
653
661
 
662
+ Folder metadata can be paginated with `limit` and `token`:
663
+
664
+ ```python
665
+ metadata = await async_client.files.get_metadata(
666
+ url=await async_client.my_files_home() / "relative_folder/",
667
+ limit=100,
668
+ token=next_token,
669
+ )
670
+ next_token = metadata.next_token
671
+ items = metadata.items
672
+ ```
673
+
654
674
  Example of metadata:
655
675
 
656
676
  ```python
@@ -663,6 +683,7 @@ FileMetadata(
663
683
  resource_type="FILE",
664
684
  content_length=12,
665
685
  content_type="application/octet-stream",
686
+ next_token=None,
666
687
  items=None,
667
688
  updatedAt=1724836248936,
668
689
  etag="9749fad13d6e7092a6337c4af9d83764",
@@ -878,6 +899,48 @@ ModelInfo(
878
899
  )
879
900
  ```
880
901
 
902
+ ### User
903
+
904
+ #### Get Authenticated User Info
905
+
906
+ To retrieve information about the currently authenticated user:
907
+
908
+ ```python
909
+ # Sync
910
+ user_info = client.user.info()
911
+
912
+ # Async
913
+ user_info = await async_client.user.info()
914
+ ```
915
+
916
+ As a result, you will receive a `UserInfo` object. When authenticated with an
917
+ API key:
918
+
919
+ ```python
920
+ UserInfo(
921
+ roles=["default"],
922
+ project="PROJECT-NAME",
923
+ userClaims=None,
924
+ )
925
+ ```
926
+
927
+ When authenticated with an access token:
928
+
929
+ ```python
930
+ UserInfo(
931
+ roles=["BA"],
932
+ project=None,
933
+ userClaims={
934
+ "email": ["user_email"],
935
+ "sub": ["user_sub"],
936
+ },
937
+ )
938
+ ```
939
+
940
+ `userClaims` is returned as an opaque `dict` because its contents depend on the
941
+ identity provider. `UserInfo` also preserves any additional fields the DIAL
942
+ deployment may return, so forward compatibility is retained.
943
+
881
944
  ### Toolsets
882
945
 
883
946
  #### Get Toolset by Id
@@ -39,6 +39,8 @@
39
39
  - [Get Application by Id](#get-application-by-id)
40
40
  - [Models](#models)
41
41
  - [Get Model by Name](#get-model-by-name)
42
+ - [User](#user)
43
+ - [Get Authenticated User Info](#get-authenticated-user-info)
42
44
  - [Toolsets](#toolsets)
43
45
  - [Get Toolset by Id](#get-toolset-by-id)
44
46
  - [Resource Permissions](#resource-permissions)
@@ -621,14 +623,32 @@ Both methods return `None` on success. `source` and `destination` must point to
621
623
 
622
624
  #### Accessing Metadata
623
625
 
624
- Use `metadata()` to access metadata of a file:
626
+ Use `get_metadata()` to access metadata of a file or folder:
625
627
 
626
628
  ```python
627
- metadata = await async_client.files.metadata(
629
+ # Sync client
630
+ metadata = sync_client.files.get_metadata(
631
+ url=sync_client.my_files_home() / "relative_folder/my-file.txt"
632
+ )
633
+
634
+ # Async client
635
+ metadata = await async_client.files.get_metadata(
628
636
  url=await async_client.my_files_home() / "relative_folder/my-file.txt"
629
637
  )
630
638
  ```
631
639
 
640
+ Folder metadata can be paginated with `limit` and `token`:
641
+
642
+ ```python
643
+ metadata = await async_client.files.get_metadata(
644
+ url=await async_client.my_files_home() / "relative_folder/",
645
+ limit=100,
646
+ token=next_token,
647
+ )
648
+ next_token = metadata.next_token
649
+ items = metadata.items
650
+ ```
651
+
632
652
  Example of metadata:
633
653
 
634
654
  ```python
@@ -641,6 +661,7 @@ FileMetadata(
641
661
  resource_type="FILE",
642
662
  content_length=12,
643
663
  content_type="application/octet-stream",
664
+ next_token=None,
644
665
  items=None,
645
666
  updatedAt=1724836248936,
646
667
  etag="9749fad13d6e7092a6337c4af9d83764",
@@ -856,6 +877,48 @@ ModelInfo(
856
877
  )
857
878
  ```
858
879
 
880
+ ### User
881
+
882
+ #### Get Authenticated User Info
883
+
884
+ To retrieve information about the currently authenticated user:
885
+
886
+ ```python
887
+ # Sync
888
+ user_info = client.user.info()
889
+
890
+ # Async
891
+ user_info = await async_client.user.info()
892
+ ```
893
+
894
+ As a result, you will receive a `UserInfo` object. When authenticated with an
895
+ API key:
896
+
897
+ ```python
898
+ UserInfo(
899
+ roles=["default"],
900
+ project="PROJECT-NAME",
901
+ userClaims=None,
902
+ )
903
+ ```
904
+
905
+ When authenticated with an access token:
906
+
907
+ ```python
908
+ UserInfo(
909
+ roles=["BA"],
910
+ project=None,
911
+ userClaims={
912
+ "email": ["user_email"],
913
+ "sub": ["user_sub"],
914
+ },
915
+ )
916
+ ```
917
+
918
+ `userClaims` is returned as an opaque `dict` because its contents depend on the
919
+ identity provider. `UserInfo` also preserves any additional fields the DIAL
920
+ deployment may return, so forward compatibility is retained.
921
+
859
922
  ### Toolsets
860
923
 
861
924
  #### Get Toolset by Id
@@ -12,6 +12,7 @@ from aidial_client._exception import (
12
12
  from aidial_client.types.client_channel import SigninResult
13
13
  from aidial_client.types.model import ModelInfo, ModelLimits, ModelPricing
14
14
  from aidial_client.types.toolset import ToolsetInfo
15
+ from aidial_client.types.user import UserInfo
15
16
 
16
17
  __all__ = [
17
18
  "Dial",
@@ -32,4 +33,5 @@ __all__ = [
32
33
  "ModelPricing",
33
34
  "ModelLimits",
34
35
  "SigninResult",
36
+ "UserInfo",
35
37
  ]
@@ -120,6 +120,7 @@ class Dial(BaseDialClient[SyncHTTPClient, SyncAuthValue]):
120
120
  self.client_channel = resources.ClientChannel(
121
121
  http_client=self._http_client
122
122
  )
123
+ self.user = resources.User(http_client=self._http_client)
123
124
 
124
125
  def _create_http_client(self) -> SyncHTTPClient:
125
126
  return SyncHTTPClient(
@@ -224,6 +225,7 @@ class AsyncDial(BaseDialClient[AsyncHTTPClient, AsyncAuthValue]):
224
225
  self.client_channel = resources.AsyncClientChannel(
225
226
  http_client=self._http_client
226
227
  )
228
+ self.user = resources.AsyncUser(http_client=self._http_client)
227
229
 
228
230
  def _create_http_client(self) -> AsyncHTTPClient:
229
231
  return AsyncHTTPClient(
@@ -10,6 +10,7 @@ from aidial_client.resources.resource_permissions import (
10
10
  ResourcePermissions,
11
11
  )
12
12
  from aidial_client.resources.toolset import AsyncToolset, Toolset
13
+ from aidial_client.resources.user import AsyncUser, User
13
14
 
14
15
  from .application import Application, AsyncApplication
15
16
  from .bucket import AsyncBucket, Bucket
@@ -40,4 +41,6 @@ __all__ = [
40
41
  "AsyncResourcePermissions",
41
42
  "ClientChannel",
42
43
  "AsyncClientChannel",
44
+ "User",
45
+ "AsyncUser",
43
46
  ]
@@ -138,10 +138,18 @@ class Files(Resource, DialStorageResourceMixin):
138
138
  on_http_error=_files_error_processor,
139
139
  )
140
140
 
141
- def get_metadata(self, url: str | PurePosixPath) -> FileMetadata:
141
+ def get_metadata(
142
+ self,
143
+ url: str | PurePosixPath,
144
+ *,
145
+ limit: int | None = None,
146
+ token: str | None = None,
147
+ ) -> FileMetadata:
142
148
  return self.metadata.get(
143
149
  resource="files",
144
150
  relative_url=self.get_api_path(str(url)),
151
+ limit=limit,
152
+ token=token,
145
153
  )
146
154
 
147
155
 
@@ -257,8 +265,16 @@ class AsyncFiles(AsyncResource, DialStorageResourceMixin):
257
265
  on_http_error=_files_error_processor,
258
266
  )
259
267
 
260
- async def get_metadata(self, url: str | PurePosixPath) -> FileMetadata:
268
+ async def get_metadata(
269
+ self,
270
+ url: str | PurePosixPath,
271
+ *,
272
+ limit: int | None = None,
273
+ token: str | None = None,
274
+ ) -> FileMetadata:
261
275
  return await self.metadata.get(
262
276
  resource="files",
263
277
  relative_url=self.get_api_path(str(url)),
278
+ limit=limit,
279
+ token=token,
264
280
  )
@@ -5,6 +5,7 @@ from typing_extensions import assert_never
5
5
 
6
6
  from aidial_client._constants import METADATA_PREFIX
7
7
  from aidial_client._internal_types._http_request import FinalRequestOptions
8
+ from aidial_client._utils._dict import remove_none
8
9
  from aidial_client.helpers.storage_resource import StorageResourceType
9
10
  from aidial_client.resources.base import AsyncResource, Resource
10
11
  from aidial_client.types.metadata import (
@@ -30,29 +31,48 @@ def _get_cast_to(
30
31
  class Metadata(Resource):
31
32
  @overload
32
33
  def get(
33
- self, resource: Literal["files"], relative_url: str
34
+ self,
35
+ resource: Literal["files"],
36
+ relative_url: str,
37
+ *,
38
+ limit: int | None = None,
39
+ token: str | None = None,
34
40
  ) -> FileMetadata: ...
35
41
 
36
42
  @overload
37
43
  def get(
38
- self, resource: Literal["conversations"], relative_url: str
44
+ self,
45
+ resource: Literal["conversations"],
46
+ relative_url: str,
47
+ *,
48
+ limit: int | None = None,
49
+ token: str | None = None,
39
50
  ) -> ConversationMetadata: ...
40
51
 
41
52
  @overload
42
53
  def get(
43
- self, resource: Literal["prompts"], relative_url: str
54
+ self,
55
+ resource: Literal["prompts"],
56
+ relative_url: str,
57
+ *,
58
+ limit: int | None = None,
59
+ token: str | None = None,
44
60
  ) -> PromptMetadata: ...
45
61
 
46
62
  def get(
47
63
  self,
48
64
  resource: StorageResourceType,
49
65
  relative_url: str,
66
+ *,
67
+ limit: int | None = None,
68
+ token: str | None = None,
50
69
  ) -> FileMetadata | ConversationMetadata | PromptMetadata:
51
70
  return self.http_client.request(
52
71
  cast_to=_get_cast_to(resource),
53
72
  options=FinalRequestOptions(
54
73
  method="GET",
55
74
  url=urljoin(METADATA_PREFIX, relative_url),
75
+ params=remove_none({"limit": limit, "token": token}),
56
76
  ),
57
77
  )
58
78
 
@@ -60,28 +80,47 @@ class Metadata(Resource):
60
80
  class AsyncMetadata(AsyncResource):
61
81
  @overload
62
82
  async def get(
63
- self, resource: Literal["files"], relative_url: str
83
+ self,
84
+ resource: Literal["files"],
85
+ relative_url: str,
86
+ *,
87
+ limit: int | None = None,
88
+ token: str | None = None,
64
89
  ) -> FileMetadata: ...
65
90
 
66
91
  @overload
67
92
  async def get(
68
- self, resource: Literal["conversations"], relative_url: str
93
+ self,
94
+ resource: Literal["conversations"],
95
+ relative_url: str,
96
+ *,
97
+ limit: int | None = None,
98
+ token: str | None = None,
69
99
  ) -> ConversationMetadata: ...
70
100
 
71
101
  @overload
72
102
  async def get(
73
- self, resource: Literal["prompts"], relative_url: str
103
+ self,
104
+ resource: Literal["prompts"],
105
+ relative_url: str,
106
+ *,
107
+ limit: int | None = None,
108
+ token: str | None = None,
74
109
  ) -> PromptMetadata: ...
75
110
 
76
111
  async def get(
77
112
  self,
78
113
  resource: StorageResourceType,
79
114
  relative_url: str,
115
+ *,
116
+ limit: int | None = None,
117
+ token: str | None = None,
80
118
  ) -> FileMetadata | ConversationMetadata | PromptMetadata:
81
119
  return await self.http_client.request(
82
120
  cast_to=_get_cast_to(resource),
83
121
  options=FinalRequestOptions(
84
122
  method="GET",
85
123
  url=urljoin(METADATA_PREFIX, relative_url),
124
+ params=remove_none({"limit": limit, "token": token}),
86
125
  ),
87
126
  )
@@ -0,0 +1,19 @@
1
+ from aidial_client._internal_types._http_request import FinalRequestOptions
2
+ from aidial_client.resources.base import AsyncResource, Resource
3
+ from aidial_client.types.user import UserInfo
4
+
5
+
6
+ class User(Resource):
7
+ def info(self) -> UserInfo:
8
+ return self.http_client.request(
9
+ cast_to=UserInfo,
10
+ options=FinalRequestOptions(method="GET", url="v1/user/info"),
11
+ )
12
+
13
+
14
+ class AsyncUser(AsyncResource):
15
+ async def info(self) -> UserInfo:
16
+ return await self.http_client.request(
17
+ cast_to=UserInfo,
18
+ options=FinalRequestOptions(method="GET", url="v1/user/info"),
19
+ )
@@ -37,6 +37,7 @@ class FileMetadata(BaseMetadata):
37
37
  resource_type: Literal["FILE"]
38
38
  content_length: int | None = None
39
39
  content_type: str | None = None
40
+ next_token: str | None = None
40
41
  items: list[FileItem] | None = None
41
42
  etag: str | None = None
42
43
 
@@ -0,0 +1,11 @@
1
+ from typing import Any
2
+
3
+ from aidial_client._internal_types._model import ExtraAllowModel
4
+
5
+
6
+ class UserInfo(ExtraAllowModel):
7
+ """Information about the authenticated user or API key."""
8
+
9
+ roles: list[str]
10
+ project: str | None = None
11
+ userClaims: dict[str, Any] | None = None # depends on the IdP, so opaque
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "aidial-client"
3
- version = "0.12.0.dev1"
3
+ version = "0.12.0.dev3"
4
4
  description = "A Python client library for the AI DIAL API"
5
5
  readme = "README.md"
6
6
  license = "Apache-2.0"