arbi 0.2.1__py3-none-any.whl → 0.3.0__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.

Potentially problematic release.


This version of arbi might be problematic. Click here for more details.

Files changed (47) hide show
  1. arbi/_streaming.py +4 -6
  2. arbi/_version.py +1 -1
  3. arbi/resources/api/__init__.py +0 -14
  4. arbi/resources/api/api.py +0 -32
  5. arbi/resources/api/assistant.py +9 -1
  6. arbi/resources/api/conversation/conversation.py +87 -2
  7. arbi/resources/api/document/annotation.py +9 -1
  8. arbi/resources/api/document/document.py +39 -1
  9. arbi/resources/api/tag.py +13 -1
  10. arbi/resources/api/user/user.py +397 -134
  11. arbi/resources/api/workspace.py +202 -12
  12. arbi/types/api/__init__.py +12 -7
  13. arbi/types/api/assistant_query_params.py +22 -2
  14. arbi/types/api/assistant_retrieve_params.py +22 -2
  15. arbi/types/api/conversation_retrieve_message_response.py +99 -0
  16. arbi/types/api/conversation_retrieve_threads_response.py +16 -0
  17. arbi/types/api/document/annotation_create_params.py +5 -1
  18. arbi/types/api/document/annotation_update_params.py +5 -1
  19. arbi/types/api/document_update_params.py +2 -0
  20. arbi/types/api/document_upload_from_url_params.py +4 -1
  21. arbi/types/api/document_upload_params.py +4 -1
  22. arbi/types/api/document_view_params.py +5 -1
  23. arbi/types/api/tag_create_params.py +5 -1
  24. arbi/types/api/tag_update_params.py +5 -1
  25. arbi/types/api/user_change_password_params.py +16 -0
  26. arbi/types/api/{sso_rotate_passcode_response.py → user_change_password_response.py} +3 -3
  27. arbi/types/api/{sso_login_params.py → user_check_sso_status_params.py} +3 -6
  28. arbi/types/api/{user_response.py → user_check_sso_status_response.py} +4 -6
  29. arbi/types/api/{sso_invite_params.py → user_invite_params.py} +2 -2
  30. arbi/types/api/{sso_invite_response.py → user_invite_response.py} +2 -4
  31. arbi/types/api/user_login_params.py +4 -1
  32. arbi/types/api/user_login_response.py +8 -0
  33. arbi/types/api/user_register_params.py +5 -4
  34. arbi/types/api/workspace_copy_params.py +21 -0
  35. arbi/types/api/workspace_copy_response.py +25 -0
  36. arbi/types/api/workspace_get_stats_response.py +6 -2
  37. arbi/types/api/workspace_get_users_response.py +5 -1
  38. arbi/types/api/workspace_response.py +24 -2
  39. arbi/types/api/workspace_share_params.py +5 -1
  40. arbi/types/api/workspace_update_params.py +5 -1
  41. {arbi-0.2.1.dist-info → arbi-0.3.0.dist-info}/METADATA +1 -1
  42. {arbi-0.2.1.dist-info → arbi-0.3.0.dist-info}/RECORD +44 -42
  43. arbi/resources/api/sso.py +0 -333
  44. arbi/types/api/sso_login_response.py +0 -15
  45. arbi/types/api/token.py +0 -13
  46. {arbi-0.2.1.dist-info → arbi-0.3.0.dist-info}/WHEEL +0 -0
  47. {arbi-0.2.1.dist-info → arbi-0.3.0.dist-info}/licenses/LICENSE +0 -0
@@ -6,8 +6,8 @@ from typing import Optional
6
6
 
7
7
  import httpx
8
8
 
9
- from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
10
- from ..._utils import maybe_transform, async_maybe_transform
9
+ from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
10
+ from ..._utils import maybe_transform, strip_not_given, async_maybe_transform
11
11
  from ..._compat import cached_property
12
12
  from ..._resource import SyncAPIResource, AsyncAPIResource
13
13
  from ..._response import (
@@ -17,6 +17,7 @@ from ..._response import (
17
17
  async_to_streamed_response_wrapper,
18
18
  )
19
19
  from ...types.api import (
20
+ workspace_copy_params,
20
21
  workspace_share_params,
21
22
  workspace_update_params,
22
23
  workspace_remove_user_params,
@@ -24,6 +25,7 @@ from ...types.api import (
24
25
  )
25
26
  from ..._base_client import make_request_options
26
27
  from ...types.api.workspace_response import WorkspaceResponse
28
+ from ...types.api.workspace_copy_response import WorkspaceCopyResponse
27
29
  from ...types.api.workspace_share_response import WorkspaceShareResponse
28
30
  from ...types.api.workspace_delete_response import WorkspaceDeleteResponse
29
31
  from ...types.api.workspace_get_tags_response import WorkspaceGetTagsResponse
@@ -64,6 +66,7 @@ class WorkspaceResource(SyncAPIResource):
64
66
  description: Optional[str] | Omit = omit,
65
67
  is_public: Optional[bool] | Omit = omit,
66
68
  name: Optional[str] | Omit = omit,
69
+ workspace_key: str | Omit = omit,
67
70
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
68
71
  # The extra values given here take precedence over values defined on the client or passed to this method.
69
72
  extra_headers: Headers | None = None,
@@ -76,7 +79,8 @@ class WorkspaceResource(SyncAPIResource):
76
79
  Changes
77
80
  are persisted to the database.
78
81
 
79
- Only developers can change the is_public field.
82
+ Only developers can change the is_public field. When making a workspace public,
83
+ the backend uses the Workspace-Key header to get the workspace key.
80
84
 
81
85
  Args:
82
86
  extra_headers: Send extra headers
@@ -89,6 +93,7 @@ class WorkspaceResource(SyncAPIResource):
89
93
  """
90
94
  if not workspace_ext_id:
91
95
  raise ValueError(f"Expected a non-empty value for `workspace_ext_id` but received {workspace_ext_id!r}")
96
+ extra_headers = {**strip_not_given({"workspace-key": workspace_key}), **(extra_headers or {})}
92
97
  return self._patch(
93
98
  f"/api/workspace/{workspace_ext_id}",
94
99
  body=maybe_transform(
@@ -142,6 +147,75 @@ class WorkspaceResource(SyncAPIResource):
142
147
  cast_to=WorkspaceDeleteResponse,
143
148
  )
144
149
 
150
+ def copy(
151
+ self,
152
+ workspace_ext_id: str,
153
+ *,
154
+ items: SequenceNotStr[str],
155
+ target_workspace_ext_id: str,
156
+ target_workspace_key: str | Omit = omit,
157
+ workspace_key: str | Omit = omit,
158
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
159
+ # The extra values given here take precedence over values defined on the client or passed to this method.
160
+ extra_headers: Headers | None = None,
161
+ extra_query: Query | None = None,
162
+ extra_body: Body | None = None,
163
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
164
+ ) -> WorkspaceCopyResponse:
165
+ """
166
+ Copy documents from source workspace to target workspace.
167
+
168
+ Requires:
169
+
170
+ - User must have access to source workspace (RLS enforced)
171
+ - Target workspace must exist and user must have access
172
+ - Workspace-Key header with source workspace key (optional for public
173
+ workspaces, required for private)
174
+ - Target-Workspace-Key header with target workspace key (required)
175
+
176
+ Copies:
177
+
178
+ - Document metadata (title, doc_date, shared status, etc.)
179
+ - MinIO encrypted files (downloaded to server memory, re-encrypted, uploaded)
180
+ - Qdrant vectors (with updated doc_ext_id and chunk_ext_id references)
181
+
182
+ Args:
183
+ items: List of document external IDs to copy (e.g., ['doc-a1b2c3d4', 'doc-e5f6g7h8'])
184
+
185
+ extra_headers: Send extra headers
186
+
187
+ extra_query: Add additional query parameters to the request
188
+
189
+ extra_body: Add additional JSON properties to the request
190
+
191
+ timeout: Override the client-level default timeout for this request, in seconds
192
+ """
193
+ if not workspace_ext_id:
194
+ raise ValueError(f"Expected a non-empty value for `workspace_ext_id` but received {workspace_ext_id!r}")
195
+ extra_headers = {
196
+ **strip_not_given(
197
+ {
198
+ "target-workspace-key": target_workspace_key,
199
+ "workspace-key": workspace_key,
200
+ }
201
+ ),
202
+ **(extra_headers or {}),
203
+ }
204
+ return self._post(
205
+ f"/api/workspace/{workspace_ext_id}/copy",
206
+ body=maybe_transform(
207
+ {
208
+ "items": items,
209
+ "target_workspace_ext_id": target_workspace_ext_id,
210
+ },
211
+ workspace_copy_params.WorkspaceCopyParams,
212
+ ),
213
+ options=make_request_options(
214
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
215
+ ),
216
+ cast_to=WorkspaceCopyResponse,
217
+ )
218
+
145
219
  def create_protected(
146
220
  self,
147
221
  *,
@@ -160,6 +234,9 @@ class WorkspaceResource(SyncAPIResource):
160
234
  Sets up vector
161
235
  storage and associates the creator as the initial workspace user.
162
236
 
237
+ Server generates the workspace symmetric key and wraps it with the user's public
238
+ key. The wrapped key is returned in the response for client-side storage.
239
+
163
240
  Public workspaces are visible to all users and grant non-members limited access:
164
241
 
165
242
  - Non-members can view shared documents and tags
@@ -242,6 +319,7 @@ class WorkspaceResource(SyncAPIResource):
242
319
  self,
243
320
  workspace_ext_id: str,
244
321
  *,
322
+ workspace_key: str | Omit = omit,
245
323
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
246
324
  # The extra values given here take precedence over values defined on the client or passed to this method.
247
325
  extra_headers: Headers | None = None,
@@ -265,6 +343,7 @@ class WorkspaceResource(SyncAPIResource):
265
343
  """
266
344
  if not workspace_ext_id:
267
345
  raise ValueError(f"Expected a non-empty value for `workspace_ext_id` but received {workspace_ext_id!r}")
346
+ extra_headers = {**strip_not_given({"workspace-key": workspace_key}), **(extra_headers or {})}
268
347
  return self._get(
269
348
  f"/api/workspace/{workspace_ext_id}/doctags",
270
349
  options=make_request_options(
@@ -277,6 +356,7 @@ class WorkspaceResource(SyncAPIResource):
277
356
  self,
278
357
  workspace_ext_id: str,
279
358
  *,
359
+ workspace_key: str | Omit = omit,
280
360
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
281
361
  # The extra values given here take precedence over values defined on the client or passed to this method.
282
362
  extra_headers: Headers | None = None,
@@ -300,6 +380,7 @@ class WorkspaceResource(SyncAPIResource):
300
380
  """
301
381
  if not workspace_ext_id:
302
382
  raise ValueError(f"Expected a non-empty value for `workspace_ext_id` but received {workspace_ext_id!r}")
383
+ extra_headers = {**strip_not_given({"workspace-key": workspace_key}), **(extra_headers or {})}
303
384
  return self._get(
304
385
  f"/api/workspace/{workspace_ext_id}/documents",
305
386
  options=make_request_options(
@@ -320,7 +401,11 @@ class WorkspaceResource(SyncAPIResource):
320
401
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
321
402
  ) -> WorkspaceGetStatsResponse:
322
403
  """
323
- Retrieves conversation and document counts for a specific workspace.
404
+ Retrieves conversation and document counts with shared/private breakdown for a
405
+ specific workspace.
406
+
407
+ - Conversations are "shared" if they have at least one shared message
408
+ - Documents are "shared" if their shared field is True
324
409
 
325
410
  Args:
326
411
  extra_headers: Send extra headers
@@ -345,6 +430,7 @@ class WorkspaceResource(SyncAPIResource):
345
430
  self,
346
431
  workspace_ext_id: str,
347
432
  *,
433
+ workspace_key: str | Omit = omit,
348
434
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
349
435
  # The extra values given here take precedence over values defined on the client or passed to this method.
350
436
  extra_headers: Headers | None = None,
@@ -366,6 +452,7 @@ class WorkspaceResource(SyncAPIResource):
366
452
  """
367
453
  if not workspace_ext_id:
368
454
  raise ValueError(f"Expected a non-empty value for `workspace_ext_id` but received {workspace_ext_id!r}")
455
+ extra_headers = {**strip_not_given({"workspace-key": workspace_key}), **(extra_headers or {})}
369
456
  return self._get(
370
457
  f"/api/workspace/{workspace_ext_id}/tags",
371
458
  options=make_request_options(
@@ -451,6 +538,7 @@ class WorkspaceResource(SyncAPIResource):
451
538
  workspace_ext_id: str,
452
539
  *,
453
540
  recipient_email: str,
541
+ workspace_key: str | Omit = omit,
454
542
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
455
543
  # The extra values given here take precedence over values defined on the client or passed to this method.
456
544
  extra_headers: Headers | None = None,
@@ -458,10 +546,11 @@ class WorkspaceResource(SyncAPIResource):
458
546
  extra_body: Body | None = None,
459
547
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
460
548
  ) -> WorkspaceShareResponse:
461
- """Share a workspace with another user via their email address.
549
+ """
550
+ Share a workspace with another user via their email address.
462
551
 
463
- Securely transfers
464
- workspace encryption keys to the recipient.
552
+ Client provides SealedBox-encrypted workspace key via Workspace-Key header.
553
+ Server decrypts it using session key, then wraps it with recipient's public key.
465
554
 
466
555
  Args:
467
556
  extra_headers: Send extra headers
@@ -474,6 +563,7 @@ class WorkspaceResource(SyncAPIResource):
474
563
  """
475
564
  if not workspace_ext_id:
476
565
  raise ValueError(f"Expected a non-empty value for `workspace_ext_id` but received {workspace_ext_id!r}")
566
+ extra_headers = {**strip_not_given({"workspace-key": workspace_key}), **(extra_headers or {})}
477
567
  return self._post(
478
568
  f"/api/workspace/{workspace_ext_id}/share",
479
569
  body=maybe_transform({"recipient_email": recipient_email}, workspace_share_params.WorkspaceShareParams),
@@ -511,6 +601,7 @@ class AsyncWorkspaceResource(AsyncAPIResource):
511
601
  description: Optional[str] | Omit = omit,
512
602
  is_public: Optional[bool] | Omit = omit,
513
603
  name: Optional[str] | Omit = omit,
604
+ workspace_key: str | Omit = omit,
514
605
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
515
606
  # The extra values given here take precedence over values defined on the client or passed to this method.
516
607
  extra_headers: Headers | None = None,
@@ -523,7 +614,8 @@ class AsyncWorkspaceResource(AsyncAPIResource):
523
614
  Changes
524
615
  are persisted to the database.
525
616
 
526
- Only developers can change the is_public field.
617
+ Only developers can change the is_public field. When making a workspace public,
618
+ the backend uses the Workspace-Key header to get the workspace key.
527
619
 
528
620
  Args:
529
621
  extra_headers: Send extra headers
@@ -536,6 +628,7 @@ class AsyncWorkspaceResource(AsyncAPIResource):
536
628
  """
537
629
  if not workspace_ext_id:
538
630
  raise ValueError(f"Expected a non-empty value for `workspace_ext_id` but received {workspace_ext_id!r}")
631
+ extra_headers = {**strip_not_given({"workspace-key": workspace_key}), **(extra_headers or {})}
539
632
  return await self._patch(
540
633
  f"/api/workspace/{workspace_ext_id}",
541
634
  body=await async_maybe_transform(
@@ -589,6 +682,75 @@ class AsyncWorkspaceResource(AsyncAPIResource):
589
682
  cast_to=WorkspaceDeleteResponse,
590
683
  )
591
684
 
685
+ async def copy(
686
+ self,
687
+ workspace_ext_id: str,
688
+ *,
689
+ items: SequenceNotStr[str],
690
+ target_workspace_ext_id: str,
691
+ target_workspace_key: str | Omit = omit,
692
+ workspace_key: str | Omit = omit,
693
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
694
+ # The extra values given here take precedence over values defined on the client or passed to this method.
695
+ extra_headers: Headers | None = None,
696
+ extra_query: Query | None = None,
697
+ extra_body: Body | None = None,
698
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
699
+ ) -> WorkspaceCopyResponse:
700
+ """
701
+ Copy documents from source workspace to target workspace.
702
+
703
+ Requires:
704
+
705
+ - User must have access to source workspace (RLS enforced)
706
+ - Target workspace must exist and user must have access
707
+ - Workspace-Key header with source workspace key (optional for public
708
+ workspaces, required for private)
709
+ - Target-Workspace-Key header with target workspace key (required)
710
+
711
+ Copies:
712
+
713
+ - Document metadata (title, doc_date, shared status, etc.)
714
+ - MinIO encrypted files (downloaded to server memory, re-encrypted, uploaded)
715
+ - Qdrant vectors (with updated doc_ext_id and chunk_ext_id references)
716
+
717
+ Args:
718
+ items: List of document external IDs to copy (e.g., ['doc-a1b2c3d4', 'doc-e5f6g7h8'])
719
+
720
+ extra_headers: Send extra headers
721
+
722
+ extra_query: Add additional query parameters to the request
723
+
724
+ extra_body: Add additional JSON properties to the request
725
+
726
+ timeout: Override the client-level default timeout for this request, in seconds
727
+ """
728
+ if not workspace_ext_id:
729
+ raise ValueError(f"Expected a non-empty value for `workspace_ext_id` but received {workspace_ext_id!r}")
730
+ extra_headers = {
731
+ **strip_not_given(
732
+ {
733
+ "target-workspace-key": target_workspace_key,
734
+ "workspace-key": workspace_key,
735
+ }
736
+ ),
737
+ **(extra_headers or {}),
738
+ }
739
+ return await self._post(
740
+ f"/api/workspace/{workspace_ext_id}/copy",
741
+ body=await async_maybe_transform(
742
+ {
743
+ "items": items,
744
+ "target_workspace_ext_id": target_workspace_ext_id,
745
+ },
746
+ workspace_copy_params.WorkspaceCopyParams,
747
+ ),
748
+ options=make_request_options(
749
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
750
+ ),
751
+ cast_to=WorkspaceCopyResponse,
752
+ )
753
+
592
754
  async def create_protected(
593
755
  self,
594
756
  *,
@@ -607,6 +769,9 @@ class AsyncWorkspaceResource(AsyncAPIResource):
607
769
  Sets up vector
608
770
  storage and associates the creator as the initial workspace user.
609
771
 
772
+ Server generates the workspace symmetric key and wraps it with the user's public
773
+ key. The wrapped key is returned in the response for client-side storage.
774
+
610
775
  Public workspaces are visible to all users and grant non-members limited access:
611
776
 
612
777
  - Non-members can view shared documents and tags
@@ -689,6 +854,7 @@ class AsyncWorkspaceResource(AsyncAPIResource):
689
854
  self,
690
855
  workspace_ext_id: str,
691
856
  *,
857
+ workspace_key: str | Omit = omit,
692
858
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
693
859
  # The extra values given here take precedence over values defined on the client or passed to this method.
694
860
  extra_headers: Headers | None = None,
@@ -712,6 +878,7 @@ class AsyncWorkspaceResource(AsyncAPIResource):
712
878
  """
713
879
  if not workspace_ext_id:
714
880
  raise ValueError(f"Expected a non-empty value for `workspace_ext_id` but received {workspace_ext_id!r}")
881
+ extra_headers = {**strip_not_given({"workspace-key": workspace_key}), **(extra_headers or {})}
715
882
  return await self._get(
716
883
  f"/api/workspace/{workspace_ext_id}/doctags",
717
884
  options=make_request_options(
@@ -724,6 +891,7 @@ class AsyncWorkspaceResource(AsyncAPIResource):
724
891
  self,
725
892
  workspace_ext_id: str,
726
893
  *,
894
+ workspace_key: str | Omit = omit,
727
895
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
728
896
  # The extra values given here take precedence over values defined on the client or passed to this method.
729
897
  extra_headers: Headers | None = None,
@@ -747,6 +915,7 @@ class AsyncWorkspaceResource(AsyncAPIResource):
747
915
  """
748
916
  if not workspace_ext_id:
749
917
  raise ValueError(f"Expected a non-empty value for `workspace_ext_id` but received {workspace_ext_id!r}")
918
+ extra_headers = {**strip_not_given({"workspace-key": workspace_key}), **(extra_headers or {})}
750
919
  return await self._get(
751
920
  f"/api/workspace/{workspace_ext_id}/documents",
752
921
  options=make_request_options(
@@ -767,7 +936,11 @@ class AsyncWorkspaceResource(AsyncAPIResource):
767
936
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
768
937
  ) -> WorkspaceGetStatsResponse:
769
938
  """
770
- Retrieves conversation and document counts for a specific workspace.
939
+ Retrieves conversation and document counts with shared/private breakdown for a
940
+ specific workspace.
941
+
942
+ - Conversations are "shared" if they have at least one shared message
943
+ - Documents are "shared" if their shared field is True
771
944
 
772
945
  Args:
773
946
  extra_headers: Send extra headers
@@ -792,6 +965,7 @@ class AsyncWorkspaceResource(AsyncAPIResource):
792
965
  self,
793
966
  workspace_ext_id: str,
794
967
  *,
968
+ workspace_key: str | Omit = omit,
795
969
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
796
970
  # The extra values given here take precedence over values defined on the client or passed to this method.
797
971
  extra_headers: Headers | None = None,
@@ -813,6 +987,7 @@ class AsyncWorkspaceResource(AsyncAPIResource):
813
987
  """
814
988
  if not workspace_ext_id:
815
989
  raise ValueError(f"Expected a non-empty value for `workspace_ext_id` but received {workspace_ext_id!r}")
990
+ extra_headers = {**strip_not_given({"workspace-key": workspace_key}), **(extra_headers or {})}
816
991
  return await self._get(
817
992
  f"/api/workspace/{workspace_ext_id}/tags",
818
993
  options=make_request_options(
@@ -900,6 +1075,7 @@ class AsyncWorkspaceResource(AsyncAPIResource):
900
1075
  workspace_ext_id: str,
901
1076
  *,
902
1077
  recipient_email: str,
1078
+ workspace_key: str | Omit = omit,
903
1079
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
904
1080
  # The extra values given here take precedence over values defined on the client or passed to this method.
905
1081
  extra_headers: Headers | None = None,
@@ -907,10 +1083,11 @@ class AsyncWorkspaceResource(AsyncAPIResource):
907
1083
  extra_body: Body | None = None,
908
1084
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
909
1085
  ) -> WorkspaceShareResponse:
910
- """Share a workspace with another user via their email address.
1086
+ """
1087
+ Share a workspace with another user via their email address.
911
1088
 
912
- Securely transfers
913
- workspace encryption keys to the recipient.
1089
+ Client provides SealedBox-encrypted workspace key via Workspace-Key header.
1090
+ Server decrypts it using session key, then wraps it with recipient's public key.
914
1091
 
915
1092
  Args:
916
1093
  extra_headers: Send extra headers
@@ -923,6 +1100,7 @@ class AsyncWorkspaceResource(AsyncAPIResource):
923
1100
  """
924
1101
  if not workspace_ext_id:
925
1102
  raise ValueError(f"Expected a non-empty value for `workspace_ext_id` but received {workspace_ext_id!r}")
1103
+ extra_headers = {**strip_not_given({"workspace-key": workspace_key}), **(extra_headers or {})}
926
1104
  return await self._post(
927
1105
  f"/api/workspace/{workspace_ext_id}/share",
928
1106
  body=await async_maybe_transform(
@@ -945,6 +1123,9 @@ class WorkspaceResourceWithRawResponse:
945
1123
  self.delete = to_raw_response_wrapper(
946
1124
  workspace.delete,
947
1125
  )
1126
+ self.copy = to_raw_response_wrapper(
1127
+ workspace.copy,
1128
+ )
948
1129
  self.create_protected = to_raw_response_wrapper(
949
1130
  workspace.create_protected,
950
1131
  )
@@ -984,6 +1165,9 @@ class AsyncWorkspaceResourceWithRawResponse:
984
1165
  self.delete = async_to_raw_response_wrapper(
985
1166
  workspace.delete,
986
1167
  )
1168
+ self.copy = async_to_raw_response_wrapper(
1169
+ workspace.copy,
1170
+ )
987
1171
  self.create_protected = async_to_raw_response_wrapper(
988
1172
  workspace.create_protected,
989
1173
  )
@@ -1023,6 +1207,9 @@ class WorkspaceResourceWithStreamingResponse:
1023
1207
  self.delete = to_streamed_response_wrapper(
1024
1208
  workspace.delete,
1025
1209
  )
1210
+ self.copy = to_streamed_response_wrapper(
1211
+ workspace.copy,
1212
+ )
1026
1213
  self.create_protected = to_streamed_response_wrapper(
1027
1214
  workspace.create_protected,
1028
1215
  )
@@ -1062,6 +1249,9 @@ class AsyncWorkspaceResourceWithStreamingResponse:
1062
1249
  self.delete = async_to_streamed_response_wrapper(
1063
1250
  workspace.delete,
1064
1251
  )
1252
+ self.copy = async_to_streamed_response_wrapper(
1253
+ workspace.copy,
1254
+ )
1065
1255
  self.create_protected = async_to_streamed_response_wrapper(
1066
1256
  workspace.create_protected,
1067
1257
  )
@@ -2,35 +2,33 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from .token import Token as Token
6
5
  from .doc_response import DocResponse as DocResponse
7
- from .user_response import UserResponse as UserResponse
8
6
  from .embedder_config import EmbedderConfig as EmbedderConfig
9
7
  from .reranker_config import RerankerConfig as RerankerConfig
10
8
  from .query_llm_config import QueryLlmConfig as QueryLlmConfig
11
9
  from .retriever_config import RetrieverConfig as RetrieverConfig
12
- from .sso_login_params import SSOLoginParams as SSOLoginParams
13
10
  from .title_llm_config import TitleLlmConfig as TitleLlmConfig
14
- from .sso_invite_params import SSOInviteParams as SSOInviteParams
15
11
  from .tag_create_params import TagCreateParams as TagCreateParams
16
12
  from .tag_update_params import TagUpdateParams as TagUpdateParams
17
13
  from .user_login_params import UserLoginParams as UserLoginParams
18
- from .sso_login_response import SSOLoginResponse as SSOLoginResponse
14
+ from .user_invite_params import UserInviteParams as UserInviteParams
19
15
  from .workspace_response import WorkspaceResponse as WorkspaceResponse
20
16
  from .parser_config_param import ParserConfigParam as ParserConfigParam
21
- from .sso_invite_response import SSOInviteResponse as SSOInviteResponse
22
17
  from .tag_create_response import TagCreateResponse as TagCreateResponse
23
18
  from .tag_delete_response import TagDeleteResponse as TagDeleteResponse
24
19
  from .tag_update_response import TagUpdateResponse as TagUpdateResponse
20
+ from .user_login_response import UserLoginResponse as UserLoginResponse
25
21
  from .chunker_config_param import ChunkerConfigParam as ChunkerConfigParam
26
22
  from .config_create_params import ConfigCreateParams as ConfigCreateParams
27
23
  from .document_view_params import DocumentViewParams as DocumentViewParams
24
+ from .user_invite_response import UserInviteResponse as UserInviteResponse
28
25
  from .user_logout_response import UserLogoutResponse as UserLogoutResponse
29
26
  from .user_register_params import UserRegisterParams as UserRegisterParams
30
27
  from .embedder_config_param import EmbedderConfigParam as EmbedderConfigParam
31
28
  from .model_citation_config import ModelCitationConfig as ModelCitationConfig
32
29
  from .reranker_config_param import RerankerConfigParam as RerankerConfigParam
33
30
  from .tag_get_docs_response import TagGetDocsResponse as TagGetDocsResponse
31
+ from .workspace_copy_params import WorkspaceCopyParams as WorkspaceCopyParams
34
32
  from .assistant_query_params import AssistantQueryParams as AssistantQueryParams
35
33
  from .config_create_response import ConfigCreateResponse as ConfigCreateResponse
36
34
  from .config_delete_response import ConfigDeleteResponse as ConfigDeleteResponse
@@ -40,6 +38,7 @@ from .query_llm_config_param import QueryLlmConfigParam as QueryLlmConfigParam
40
38
  from .retriever_config_param import RetrieverConfigParam as RetrieverConfigParam
41
39
  from .title_llm_config_param import TitleLlmConfigParam as TitleLlmConfigParam
42
40
  from .workspace_share_params import WorkspaceShareParams as WorkspaceShareParams
41
+ from .workspace_copy_response import WorkspaceCopyResponse as WorkspaceCopyResponse
43
42
  from .workspace_update_params import WorkspaceUpdateParams as WorkspaceUpdateParams
44
43
  from .config_retrieve_response import ConfigRetrieveResponse as ConfigRetrieveResponse
45
44
  from .document_delete_response import DocumentDeleteResponse as DocumentDeleteResponse
@@ -57,18 +56,21 @@ from .user_verify_email_response import UserVerifyEmailResponse as UserVerifyEma
57
56
  from .conversation_share_response import ConversationShareResponse as ConversationShareResponse
58
57
  from .model_citation_config_param import ModelCitationConfigParam as ModelCitationConfigParam
59
58
  from .tag_remove_from_docs_params import TagRemoveFromDocsParams as TagRemoveFromDocsParams
59
+ from .user_change_password_params import UserChangePasswordParams as UserChangePasswordParams
60
60
  from .workspace_get_tags_response import WorkspaceGetTagsResponse as WorkspaceGetTagsResponse
61
61
  from .config_get_versions_response import ConfigGetVersionsResponse as ConfigGetVersionsResponse
62
62
  from .conversation_delete_response import ConversationDeleteResponse as ConversationDeleteResponse
63
63
  from .document_get_parsed_response import DocumentGetParsedResponse as DocumentGetParsedResponse
64
64
  from .health_check_models_response import HealthCheckModelsResponse as HealthCheckModelsResponse
65
- from .sso_rotate_passcode_response import SSORotatePasscodeResponse as SSORotatePasscodeResponse
65
+ from .user_check_sso_status_params import UserCheckSSOStatusParams as UserCheckSSOStatusParams
66
66
  from .workspace_get_stats_response import WorkspaceGetStatsResponse as WorkspaceGetStatsResponse
67
67
  from .workspace_get_users_response import WorkspaceGetUsersResponse as WorkspaceGetUsersResponse
68
68
  from .workspace_remove_user_params import WorkspaceRemoveUserParams as WorkspaceRemoveUserParams
69
69
  from .tag_remove_from_docs_response import TagRemoveFromDocsResponse as TagRemoveFromDocsResponse
70
+ from .user_change_password_response import UserChangePasswordResponse as UserChangePasswordResponse
70
71
  from .user_list_workspaces_response import UserListWorkspacesResponse as UserListWorkspacesResponse
71
72
  from .health_check_services_response import HealthCheckServicesResponse as HealthCheckServicesResponse
73
+ from .user_check_sso_status_response import UserCheckSSOStatusResponse as UserCheckSSOStatusResponse
72
74
  from .workspace_get_doctags_response import WorkspaceGetDoctagsResponse as WorkspaceGetDoctagsResponse
73
75
  from .workspace_remove_user_response import WorkspaceRemoveUserResponse as WorkspaceRemoveUserResponse
74
76
  from .document_upload_from_url_params import DocumentUploadFromURLParams as DocumentUploadFromURLParams
@@ -81,6 +83,9 @@ from .conversation_update_title_response import ConversationUpdateTitleResponse
81
83
  from .document_date_extractor_llm_config import DocumentDateExtractorLlmConfig as DocumentDateExtractorLlmConfig
82
84
  from .conversation_delete_message_response import ConversationDeleteMessageResponse as ConversationDeleteMessageResponse
83
85
  from .workspace_get_conversations_response import WorkspaceGetConversationsResponse as WorkspaceGetConversationsResponse
86
+ from .conversation_retrieve_message_response import (
87
+ ConversationRetrieveMessageResponse as ConversationRetrieveMessageResponse,
88
+ )
84
89
  from .conversation_retrieve_threads_response import (
85
90
  ConversationRetrieveThreadsResponse as ConversationRetrieveThreadsResponse,
86
91
  )
@@ -3,9 +3,10 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  from typing import Dict, Union, Iterable, Optional
6
- from typing_extensions import Literal, Required, TypeAlias, TypedDict
6
+ from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
7
7
 
8
8
  from ..._types import SequenceNotStr
9
+ from ..._utils import PropertyInfo
9
10
  from ..chunk_param import ChunkParam
10
11
 
11
12
  __all__ = [
@@ -15,6 +16,7 @@ __all__ = [
15
16
  "ToolsModelCitationToolToolResponses",
16
17
  "ToolsRetrievalChunkToolInput",
17
18
  "ToolsRetrievalFullContextToolInput",
19
+ "ToolsTraceTool",
18
20
  ]
19
21
 
20
22
 
@@ -29,6 +31,8 @@ class AssistantQueryParams(TypedDict, total=False):
29
31
 
30
32
  tools: Dict[str, Tools]
31
33
 
34
+ workspace_key: Annotated[str, PropertyInfo(alias="workspace-key")]
35
+
32
36
 
33
37
  class ToolsModelCitationToolToolResponses(TypedDict, total=False):
34
38
  chunk_ids: Required[SequenceNotStr[str]]
@@ -68,4 +72,20 @@ class ToolsRetrievalFullContextToolInput(TypedDict, total=False):
68
72
  tool_responses: Dict[str, Iterable[ChunkParam]]
69
73
 
70
74
 
71
- Tools: TypeAlias = Union[ToolsModelCitationTool, ToolsRetrievalChunkToolInput, ToolsRetrievalFullContextToolInput]
75
+ class ToolsTraceTool(TypedDict, total=False):
76
+ description: str
77
+
78
+ duration_seconds: Optional[float]
79
+
80
+ name: Literal["trace"]
81
+
82
+ start_time: Optional[float]
83
+
84
+ steps: Iterable[Dict[str, object]]
85
+
86
+ trace_id: Optional[str]
87
+
88
+
89
+ Tools: TypeAlias = Union[
90
+ ToolsModelCitationTool, ToolsRetrievalChunkToolInput, ToolsRetrievalFullContextToolInput, ToolsTraceTool
91
+ ]
@@ -3,9 +3,10 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  from typing import Dict, Union, Iterable, Optional
6
- from typing_extensions import Literal, Required, TypeAlias, TypedDict
6
+ from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
7
7
 
8
8
  from ..._types import SequenceNotStr
9
+ from ..._utils import PropertyInfo
9
10
  from ..chunk_param import ChunkParam
10
11
 
11
12
  __all__ = [
@@ -15,6 +16,7 @@ __all__ = [
15
16
  "ToolsModelCitationToolToolResponses",
16
17
  "ToolsRetrievalChunkToolInput",
17
18
  "ToolsRetrievalFullContextToolInput",
19
+ "ToolsTraceTool",
18
20
  ]
19
21
 
20
22
 
@@ -29,6 +31,8 @@ class AssistantRetrieveParams(TypedDict, total=False):
29
31
 
30
32
  tools: Dict[str, Tools]
31
33
 
34
+ workspace_key: Annotated[str, PropertyInfo(alias="workspace-key")]
35
+
32
36
 
33
37
  class ToolsModelCitationToolToolResponses(TypedDict, total=False):
34
38
  chunk_ids: Required[SequenceNotStr[str]]
@@ -68,4 +72,20 @@ class ToolsRetrievalFullContextToolInput(TypedDict, total=False):
68
72
  tool_responses: Dict[str, Iterable[ChunkParam]]
69
73
 
70
74
 
71
- Tools: TypeAlias = Union[ToolsModelCitationTool, ToolsRetrievalChunkToolInput, ToolsRetrievalFullContextToolInput]
75
+ class ToolsTraceTool(TypedDict, total=False):
76
+ description: str
77
+
78
+ duration_seconds: Optional[float]
79
+
80
+ name: Literal["trace"]
81
+
82
+ start_time: Optional[float]
83
+
84
+ steps: Iterable[Dict[str, object]]
85
+
86
+ trace_id: Optional[str]
87
+
88
+
89
+ Tools: TypeAlias = Union[
90
+ ToolsModelCitationTool, ToolsRetrievalChunkToolInput, ToolsRetrievalFullContextToolInput, ToolsTraceTool
91
+ ]