arbi 0.1.0__py3-none-any.whl → 0.2.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 (60) hide show
  1. arbi/__init__.py +3 -1
  2. arbi/_base_client.py +12 -12
  3. arbi/_client.py +8 -8
  4. arbi/_compat.py +48 -48
  5. arbi/_models.py +51 -45
  6. arbi/_qs.py +7 -7
  7. arbi/_types.py +53 -12
  8. arbi/_utils/__init__.py +9 -2
  9. arbi/_utils/_compat.py +45 -0
  10. arbi/_utils/_datetime_parse.py +136 -0
  11. arbi/_utils/_transform.py +13 -3
  12. arbi/_utils/_typing.py +6 -1
  13. arbi/_utils/_utils.py +4 -5
  14. arbi/_version.py +1 -1
  15. arbi/resources/api/api.py +3 -3
  16. arbi/resources/api/assistant.py +17 -17
  17. arbi/resources/api/configs.py +41 -33
  18. arbi/resources/api/conversation/conversation.py +11 -11
  19. arbi/resources/api/conversation/user.py +5 -5
  20. arbi/resources/api/document/annotation.py +17 -17
  21. arbi/resources/api/document/document.py +166 -33
  22. arbi/resources/api/health.py +129 -11
  23. arbi/resources/api/sso.py +9 -9
  24. arbi/resources/api/tag.py +26 -26
  25. arbi/resources/api/user/settings.py +28 -20
  26. arbi/resources/api/user/user.py +107 -16
  27. arbi/resources/api/workspace.py +69 -39
  28. arbi/types/api/__init__.py +5 -0
  29. arbi/types/api/assistant_query_params.py +16 -4
  30. arbi/types/api/assistant_retrieve_params.py +16 -4
  31. arbi/types/api/config_create_params.py +67 -2
  32. arbi/types/api/config_retrieve_response.py +98 -2
  33. arbi/types/api/conversation_retrieve_threads_response.py +13 -2
  34. arbi/types/api/document_date_extractor_llm_config.py +3 -3
  35. arbi/types/api/document_date_extractor_llm_config_param.py +3 -3
  36. arbi/types/api/document_upload_from_url_params.py +23 -0
  37. arbi/types/api/document_upload_params.py +3 -3
  38. arbi/types/api/embedder_config.py +12 -0
  39. arbi/types/api/embedder_config_param.py +12 -0
  40. arbi/types/api/health_check_app_response.py +6 -0
  41. arbi/types/api/health_retrieve_status_response.py +45 -0
  42. arbi/types/api/health_retrieve_version_response.py +8 -0
  43. arbi/types/api/query_llm_config.py +1 -1
  44. arbi/types/api/query_llm_config_param.py +1 -1
  45. arbi/types/api/tag_apply_to_docs_params.py +3 -2
  46. arbi/types/api/tag_remove_from_docs_params.py +3 -2
  47. arbi/types/api/title_llm_config.py +1 -1
  48. arbi/types/api/title_llm_config_param.py +1 -1
  49. arbi/types/api/user/setting_retrieve_response.py +10 -1
  50. arbi/types/api/user/setting_update_params.py +8 -2
  51. arbi/types/api/user_register_params.py +2 -0
  52. arbi/types/api/user_verify_email_params.py +11 -0
  53. arbi/types/api/user_verify_email_response.py +9 -0
  54. arbi/types/api/workspace_create_protected_params.py +2 -0
  55. arbi/types/api/workspace_response.py +2 -0
  56. arbi/types/api/workspace_update_params.py +2 -0
  57. {arbi-0.1.0.dist-info → arbi-0.2.0.dist-info}/METADATA +3 -3
  58. {arbi-0.1.0.dist-info → arbi-0.2.0.dist-info}/RECORD +60 -53
  59. {arbi-0.1.0.dist-info → arbi-0.2.0.dist-info}/WHEEL +0 -0
  60. {arbi-0.1.0.dist-info → arbi-0.2.0.dist-info}/licenses/LICENSE +0 -0
arbi/resources/api/sso.py CHANGED
@@ -6,7 +6,7 @@ from typing import Optional
6
6
 
7
7
  import httpx
8
8
 
9
- from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
9
+ from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
10
10
  from ..._utils import maybe_transform, async_maybe_transform
11
11
  from ..._compat import cached_property
12
12
  from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -54,7 +54,7 @@ class SSOResource(SyncAPIResource):
54
54
  extra_headers: Headers | None = None,
55
55
  extra_query: Query | None = None,
56
56
  extra_body: Body | None = None,
57
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
57
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
58
58
  ) -> SSOInviteResponse:
59
59
  """Invite a user to the deployment via email.
60
60
 
@@ -85,13 +85,13 @@ class SSOResource(SyncAPIResource):
85
85
  *,
86
86
  token: str,
87
87
  email: str,
88
- passcode: Optional[str] | NotGiven = NOT_GIVEN,
88
+ passcode: Optional[str] | Omit = omit,
89
89
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
90
90
  # The extra values given here take precedence over values defined on the client or passed to this method.
91
91
  extra_headers: Headers | None = None,
92
92
  extra_query: Query | None = None,
93
93
  extra_body: Body | None = None,
94
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
94
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
95
95
  ) -> SSOLoginResponse:
96
96
  """Handle SSO login with JWT token authentication.
97
97
 
@@ -131,7 +131,7 @@ class SSOResource(SyncAPIResource):
131
131
  extra_headers: Headers | None = None,
132
132
  extra_query: Query | None = None,
133
133
  extra_body: Body | None = None,
134
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
134
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
135
135
  ) -> SSORotatePasscodeResponse:
136
136
  """
137
137
  Generate a new passcode for the current user.
@@ -178,7 +178,7 @@ class AsyncSSOResource(AsyncAPIResource):
178
178
  extra_headers: Headers | None = None,
179
179
  extra_query: Query | None = None,
180
180
  extra_body: Body | None = None,
181
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
181
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
182
182
  ) -> SSOInviteResponse:
183
183
  """Invite a user to the deployment via email.
184
184
 
@@ -209,13 +209,13 @@ class AsyncSSOResource(AsyncAPIResource):
209
209
  *,
210
210
  token: str,
211
211
  email: str,
212
- passcode: Optional[str] | NotGiven = NOT_GIVEN,
212
+ passcode: Optional[str] | Omit = omit,
213
213
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
214
214
  # The extra values given here take precedence over values defined on the client or passed to this method.
215
215
  extra_headers: Headers | None = None,
216
216
  extra_query: Query | None = None,
217
217
  extra_body: Body | None = None,
218
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
218
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
219
219
  ) -> SSOLoginResponse:
220
220
  """Handle SSO login with JWT token authentication.
221
221
 
@@ -255,7 +255,7 @@ class AsyncSSOResource(AsyncAPIResource):
255
255
  extra_headers: Headers | None = None,
256
256
  extra_query: Query | None = None,
257
257
  extra_body: Body | None = None,
258
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
258
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
259
259
  ) -> SSORotatePasscodeResponse:
260
260
  """
261
261
  Generate a new passcode for the current user.
arbi/resources/api/tag.py CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import List, Optional
5
+ from typing import Optional
6
6
 
7
7
  import httpx
8
8
 
9
- from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
9
+ from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
10
10
  from ..._utils import maybe_transform, async_maybe_transform
11
11
  from ..._compat import cached_property
12
12
  from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -53,14 +53,14 @@ class TagResource(SyncAPIResource):
53
53
  *,
54
54
  name: str,
55
55
  workspace_ext_id: str,
56
- parent_ext_id: Optional[str] | NotGiven = NOT_GIVEN,
57
- shared: Optional[bool] | NotGiven = NOT_GIVEN,
56
+ parent_ext_id: Optional[str] | Omit = omit,
57
+ shared: Optional[bool] | Omit = omit,
58
58
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
59
59
  # The extra values given here take precedence over values defined on the client or passed to this method.
60
60
  extra_headers: Headers | None = None,
61
61
  extra_query: Query | None = None,
62
62
  extra_body: Body | None = None,
63
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
63
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
64
64
  ) -> TagCreateResponse:
65
65
  """
66
66
  Create a new tag for a given workspace.
@@ -98,14 +98,14 @@ class TagResource(SyncAPIResource):
98
98
  self,
99
99
  tag_ext_id: str,
100
100
  *,
101
- name: Optional[str] | NotGiven = NOT_GIVEN,
102
- shared: Optional[bool] | NotGiven = NOT_GIVEN,
101
+ name: Optional[str] | Omit = omit,
102
+ shared: Optional[bool] | Omit = omit,
103
103
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
104
104
  # The extra values given here take precedence over values defined on the client or passed to this method.
105
105
  extra_headers: Headers | None = None,
106
106
  extra_query: Query | None = None,
107
107
  extra_body: Body | None = None,
108
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
108
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
109
109
  ) -> TagUpdateResponse:
110
110
  """
111
111
  Update a tag by its external ID.
@@ -145,7 +145,7 @@ class TagResource(SyncAPIResource):
145
145
  extra_headers: Headers | None = None,
146
146
  extra_query: Query | None = None,
147
147
  extra_body: Body | None = None,
148
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
148
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
149
149
  ) -> TagDeleteResponse:
150
150
  """
151
151
  Delete a tag by its external ID.
@@ -173,13 +173,13 @@ class TagResource(SyncAPIResource):
173
173
  self,
174
174
  tag_ext_id: str,
175
175
  *,
176
- doc_ids: List[str],
176
+ doc_ids: SequenceNotStr[str],
177
177
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
178
178
  # The extra values given here take precedence over values defined on the client or passed to this method.
179
179
  extra_headers: Headers | None = None,
180
180
  extra_query: Query | None = None,
181
181
  extra_body: Body | None = None,
182
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
182
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
183
183
  ) -> TagApplyToDocsResponse:
184
184
  """
185
185
  Apply a tag to a list of documents.
@@ -213,7 +213,7 @@ class TagResource(SyncAPIResource):
213
213
  extra_headers: Headers | None = None,
214
214
  extra_query: Query | None = None,
215
215
  extra_body: Body | None = None,
216
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
216
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
217
217
  ) -> TagGetDocsResponse:
218
218
  """
219
219
  Get all doctags for a given tag.
@@ -241,13 +241,13 @@ class TagResource(SyncAPIResource):
241
241
  self,
242
242
  tag_ext_id: str,
243
243
  *,
244
- doc_ids: List[str],
244
+ doc_ids: SequenceNotStr[str],
245
245
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
246
246
  # The extra values given here take precedence over values defined on the client or passed to this method.
247
247
  extra_headers: Headers | None = None,
248
248
  extra_query: Query | None = None,
249
249
  extra_body: Body | None = None,
250
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
250
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
251
251
  ) -> TagRemoveFromDocsResponse:
252
252
  """
253
253
  Remove a tag from a list of documents.
@@ -298,14 +298,14 @@ class AsyncTagResource(AsyncAPIResource):
298
298
  *,
299
299
  name: str,
300
300
  workspace_ext_id: str,
301
- parent_ext_id: Optional[str] | NotGiven = NOT_GIVEN,
302
- shared: Optional[bool] | NotGiven = NOT_GIVEN,
301
+ parent_ext_id: Optional[str] | Omit = omit,
302
+ shared: Optional[bool] | Omit = omit,
303
303
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
304
304
  # The extra values given here take precedence over values defined on the client or passed to this method.
305
305
  extra_headers: Headers | None = None,
306
306
  extra_query: Query | None = None,
307
307
  extra_body: Body | None = None,
308
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
308
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
309
309
  ) -> TagCreateResponse:
310
310
  """
311
311
  Create a new tag for a given workspace.
@@ -343,14 +343,14 @@ class AsyncTagResource(AsyncAPIResource):
343
343
  self,
344
344
  tag_ext_id: str,
345
345
  *,
346
- name: Optional[str] | NotGiven = NOT_GIVEN,
347
- shared: Optional[bool] | NotGiven = NOT_GIVEN,
346
+ name: Optional[str] | Omit = omit,
347
+ shared: Optional[bool] | Omit = omit,
348
348
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
349
349
  # The extra values given here take precedence over values defined on the client or passed to this method.
350
350
  extra_headers: Headers | None = None,
351
351
  extra_query: Query | None = None,
352
352
  extra_body: Body | None = None,
353
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
353
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
354
354
  ) -> TagUpdateResponse:
355
355
  """
356
356
  Update a tag by its external ID.
@@ -390,7 +390,7 @@ class AsyncTagResource(AsyncAPIResource):
390
390
  extra_headers: Headers | None = None,
391
391
  extra_query: Query | None = None,
392
392
  extra_body: Body | None = None,
393
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
393
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
394
394
  ) -> TagDeleteResponse:
395
395
  """
396
396
  Delete a tag by its external ID.
@@ -418,13 +418,13 @@ class AsyncTagResource(AsyncAPIResource):
418
418
  self,
419
419
  tag_ext_id: str,
420
420
  *,
421
- doc_ids: List[str],
421
+ doc_ids: SequenceNotStr[str],
422
422
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
423
423
  # The extra values given here take precedence over values defined on the client or passed to this method.
424
424
  extra_headers: Headers | None = None,
425
425
  extra_query: Query | None = None,
426
426
  extra_body: Body | None = None,
427
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
427
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
428
428
  ) -> TagApplyToDocsResponse:
429
429
  """
430
430
  Apply a tag to a list of documents.
@@ -458,7 +458,7 @@ class AsyncTagResource(AsyncAPIResource):
458
458
  extra_headers: Headers | None = None,
459
459
  extra_query: Query | None = None,
460
460
  extra_body: Body | None = None,
461
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
461
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
462
462
  ) -> TagGetDocsResponse:
463
463
  """
464
464
  Get all doctags for a given tag.
@@ -486,13 +486,13 @@ class AsyncTagResource(AsyncAPIResource):
486
486
  self,
487
487
  tag_ext_id: str,
488
488
  *,
489
- doc_ids: List[str],
489
+ doc_ids: SequenceNotStr[str],
490
490
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
491
491
  # The extra values given here take precedence over values defined on the client or passed to this method.
492
492
  extra_headers: Headers | None = None,
493
493
  extra_query: Query | None = None,
494
494
  extra_body: Body | None = None,
495
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
495
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
496
496
  ) -> TagRemoveFromDocsResponse:
497
497
  """
498
498
  Remove a tag from a list of documents.
@@ -2,11 +2,11 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import List, Optional
5
+ from typing import Optional
6
6
 
7
7
  import httpx
8
8
 
9
- from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
9
+ from ...._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given
10
10
  from ...._utils import maybe_transform, async_maybe_transform
11
11
  from ...._compat import cached_property
12
12
  from ...._resource import SyncAPIResource, AsyncAPIResource
@@ -51,7 +51,7 @@ class SettingsResource(SyncAPIResource):
51
51
  extra_headers: Headers | None = None,
52
52
  extra_query: Query | None = None,
53
53
  extra_body: Body | None = None,
54
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
54
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
55
55
  ) -> SettingRetrieveResponse:
56
56
  """Get current user's settings."""
57
57
  return self._get(
@@ -65,19 +65,21 @@ class SettingsResource(SyncAPIResource):
65
65
  def update(
66
66
  self,
67
67
  *,
68
- pinned_workspaces: Optional[List[str]] | NotGiven = NOT_GIVEN,
69
- show_document_navigator: Optional[bool] | NotGiven = NOT_GIVEN,
70
- show_help_page: Optional[bool] | NotGiven = NOT_GIVEN,
71
- show_invite_tab: Optional[bool] | NotGiven = NOT_GIVEN,
72
- show_security_settings: Optional[bool] | NotGiven = NOT_GIVEN,
73
- show_smart_search: Optional[bool] | NotGiven = NOT_GIVEN,
74
- show_thread_visualization: Optional[bool] | NotGiven = NOT_GIVEN,
68
+ ai_mode: Optional[str] | Omit = omit,
69
+ pinned_workspaces: Optional[SequenceNotStr[str]] | Omit = omit,
70
+ show_document_navigator: Optional[bool] | Omit = omit,
71
+ show_help_page: Optional[bool] | Omit = omit,
72
+ show_invite_tab: Optional[bool] | Omit = omit,
73
+ show_security_settings: Optional[bool] | Omit = omit,
74
+ show_smart_search: Optional[bool] | Omit = omit,
75
+ show_templates: Optional[bool] | Omit = omit,
76
+ show_thread_visualization: Optional[bool] | Omit = omit,
75
77
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
76
78
  # The extra values given here take precedence over values defined on the client or passed to this method.
77
79
  extra_headers: Headers | None = None,
78
80
  extra_query: Query | None = None,
79
81
  extra_body: Body | None = None,
80
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
82
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
81
83
  ) -> None:
82
84
  """
83
85
  Update user's settings (merge with existing).
@@ -96,12 +98,14 @@ class SettingsResource(SyncAPIResource):
96
98
  "/api/user/settings",
97
99
  body=maybe_transform(
98
100
  {
101
+ "ai_mode": ai_mode,
99
102
  "pinned_workspaces": pinned_workspaces,
100
103
  "show_document_navigator": show_document_navigator,
101
104
  "show_help_page": show_help_page,
102
105
  "show_invite_tab": show_invite_tab,
103
106
  "show_security_settings": show_security_settings,
104
107
  "show_smart_search": show_smart_search,
108
+ "show_templates": show_templates,
105
109
  "show_thread_visualization": show_thread_visualization,
106
110
  },
107
111
  setting_update_params.SettingUpdateParams,
@@ -141,7 +145,7 @@ class AsyncSettingsResource(AsyncAPIResource):
141
145
  extra_headers: Headers | None = None,
142
146
  extra_query: Query | None = None,
143
147
  extra_body: Body | None = None,
144
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
148
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
145
149
  ) -> SettingRetrieveResponse:
146
150
  """Get current user's settings."""
147
151
  return await self._get(
@@ -155,19 +159,21 @@ class AsyncSettingsResource(AsyncAPIResource):
155
159
  async def update(
156
160
  self,
157
161
  *,
158
- pinned_workspaces: Optional[List[str]] | NotGiven = NOT_GIVEN,
159
- show_document_navigator: Optional[bool] | NotGiven = NOT_GIVEN,
160
- show_help_page: Optional[bool] | NotGiven = NOT_GIVEN,
161
- show_invite_tab: Optional[bool] | NotGiven = NOT_GIVEN,
162
- show_security_settings: Optional[bool] | NotGiven = NOT_GIVEN,
163
- show_smart_search: Optional[bool] | NotGiven = NOT_GIVEN,
164
- show_thread_visualization: Optional[bool] | NotGiven = NOT_GIVEN,
162
+ ai_mode: Optional[str] | Omit = omit,
163
+ pinned_workspaces: Optional[SequenceNotStr[str]] | Omit = omit,
164
+ show_document_navigator: Optional[bool] | Omit = omit,
165
+ show_help_page: Optional[bool] | Omit = omit,
166
+ show_invite_tab: Optional[bool] | Omit = omit,
167
+ show_security_settings: Optional[bool] | Omit = omit,
168
+ show_smart_search: Optional[bool] | Omit = omit,
169
+ show_templates: Optional[bool] | Omit = omit,
170
+ show_thread_visualization: Optional[bool] | Omit = omit,
165
171
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
166
172
  # The extra values given here take precedence over values defined on the client or passed to this method.
167
173
  extra_headers: Headers | None = None,
168
174
  extra_query: Query | None = None,
169
175
  extra_body: Body | None = None,
170
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
176
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
171
177
  ) -> None:
172
178
  """
173
179
  Update user's settings (merge with existing).
@@ -186,12 +192,14 @@ class AsyncSettingsResource(AsyncAPIResource):
186
192
  "/api/user/settings",
187
193
  body=await async_maybe_transform(
188
194
  {
195
+ "ai_mode": ai_mode,
189
196
  "pinned_workspaces": pinned_workspaces,
190
197
  "show_document_navigator": show_document_navigator,
191
198
  "show_help_page": show_help_page,
192
199
  "show_invite_tab": show_invite_tab,
193
200
  "show_security_settings": show_security_settings,
194
201
  "show_smart_search": show_smart_search,
202
+ "show_templates": show_templates,
195
203
  "show_thread_visualization": show_thread_visualization,
196
204
  },
197
205
  setting_update_params.SettingUpdateParams,
@@ -12,7 +12,7 @@ from .settings import (
12
12
  SettingsResourceWithStreamingResponse,
13
13
  AsyncSettingsResourceWithStreamingResponse,
14
14
  )
15
- from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
15
+ from ...._types import Body, Query, Headers, NotGiven, not_given
16
16
  from ...._utils import maybe_transform, async_maybe_transform
17
17
  from ...._compat import cached_property
18
18
  from ...._resource import SyncAPIResource, AsyncAPIResource
@@ -22,11 +22,12 @@ from ...._response import (
22
22
  async_to_raw_response_wrapper,
23
23
  async_to_streamed_response_wrapper,
24
24
  )
25
- from ....types.api import user_login_params, user_register_params
25
+ from ....types.api import user_login_params, user_register_params, user_verify_email_params
26
26
  from ...._base_client import make_request_options
27
27
  from ....types.api.token import Token
28
28
  from ....types.api.user_response import UserResponse
29
29
  from ....types.api.user_logout_response import UserLogoutResponse
30
+ from ....types.api.user_verify_email_response import UserVerifyEmailResponse
30
31
  from ....types.api.user_list_workspaces_response import UserListWorkspacesResponse
31
32
 
32
33
  __all__ = ["UserResource", "AsyncUserResource"]
@@ -64,7 +65,7 @@ class UserResource(SyncAPIResource):
64
65
  extra_headers: Headers | None = None,
65
66
  extra_query: Query | None = None,
66
67
  extra_body: Body | None = None,
67
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
68
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
68
69
  ) -> UserListWorkspacesResponse:
69
70
  """
70
71
  Retrieve the list of workspaces associated with the current authenticated user.
@@ -88,7 +89,7 @@ class UserResource(SyncAPIResource):
88
89
  extra_headers: Headers | None = None,
89
90
  extra_query: Query | None = None,
90
91
  extra_body: Body | None = None,
91
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
92
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
92
93
  ) -> Token:
93
94
  """
94
95
  Login a user and return a JWT token.
@@ -125,7 +126,7 @@ class UserResource(SyncAPIResource):
125
126
  extra_headers: Headers | None = None,
126
127
  extra_query: Query | None = None,
127
128
  extra_body: Body | None = None,
128
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
129
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
129
130
  ) -> UserLogoutResponse:
130
131
  """Log out the current user by clearing cached keys and refresh token cookie."""
131
132
  return self._post(
@@ -144,7 +145,7 @@ class UserResource(SyncAPIResource):
144
145
  extra_headers: Headers | None = None,
145
146
  extra_query: Query | None = None,
146
147
  extra_body: Body | None = None,
147
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
148
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
148
149
  ) -> Token:
149
150
  """Refresh an expired access token using the refresh token cookie.
150
151
 
@@ -166,15 +167,16 @@ class UserResource(SyncAPIResource):
166
167
  last_name: str,
167
168
  name: str,
168
169
  password: str,
170
+ verification_code: str,
169
171
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
170
172
  # The extra values given here take precedence over values defined on the client or passed to this method.
171
173
  extra_headers: Headers | None = None,
172
174
  extra_query: Query | None = None,
173
175
  extra_body: Body | None = None,
174
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
176
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
175
177
  ) -> UserResponse:
176
178
  """
177
- Register a new user.
179
+ Register a new user with email verification.
178
180
 
179
181
  Args:
180
182
  extra_headers: Send extra headers
@@ -193,6 +195,7 @@ class UserResource(SyncAPIResource):
193
195
  "last_name": last_name,
194
196
  "name": name,
195
197
  "password": password,
198
+ "verification_code": verification_code,
196
199
  },
197
200
  user_register_params.UserRegisterParams,
198
201
  ),
@@ -210,7 +213,7 @@ class UserResource(SyncAPIResource):
210
213
  extra_headers: Headers | None = None,
211
214
  extra_query: Query | None = None,
212
215
  extra_body: Body | None = None,
213
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
216
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
214
217
  ) -> UserResponse:
215
218
  """Retrieve current authenticated user information.
216
219
 
@@ -225,6 +228,43 @@ class UserResource(SyncAPIResource):
225
228
  cast_to=UserResponse,
226
229
  )
227
230
 
231
+ def verify_email(
232
+ self,
233
+ *,
234
+ email: str,
235
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
236
+ # The extra values given here take precedence over values defined on the client or passed to this method.
237
+ extra_headers: Headers | None = None,
238
+ extra_query: Query | None = None,
239
+ extra_body: Body | None = None,
240
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
241
+ ) -> UserVerifyEmailResponse:
242
+ """Send verification email with 3-word code to user.
243
+
244
+ Calls central server to send
245
+ the email.
246
+
247
+ Note: Fails silently if email already exists to prevent email enumeration
248
+ attacks.
249
+
250
+ Args:
251
+ extra_headers: Send extra headers
252
+
253
+ extra_query: Add additional query parameters to the request
254
+
255
+ extra_body: Add additional JSON properties to the request
256
+
257
+ timeout: Override the client-level default timeout for this request, in seconds
258
+ """
259
+ return self._post(
260
+ "/api/user/verify-email",
261
+ body=maybe_transform({"email": email}, user_verify_email_params.UserVerifyEmailParams),
262
+ options=make_request_options(
263
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
264
+ ),
265
+ cast_to=UserVerifyEmailResponse,
266
+ )
267
+
228
268
 
229
269
  class AsyncUserResource(AsyncAPIResource):
230
270
  @cached_property
@@ -258,7 +298,7 @@ class AsyncUserResource(AsyncAPIResource):
258
298
  extra_headers: Headers | None = None,
259
299
  extra_query: Query | None = None,
260
300
  extra_body: Body | None = None,
261
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
301
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
262
302
  ) -> UserListWorkspacesResponse:
263
303
  """
264
304
  Retrieve the list of workspaces associated with the current authenticated user.
@@ -282,7 +322,7 @@ class AsyncUserResource(AsyncAPIResource):
282
322
  extra_headers: Headers | None = None,
283
323
  extra_query: Query | None = None,
284
324
  extra_body: Body | None = None,
285
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
325
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
286
326
  ) -> Token:
287
327
  """
288
328
  Login a user and return a JWT token.
@@ -319,7 +359,7 @@ class AsyncUserResource(AsyncAPIResource):
319
359
  extra_headers: Headers | None = None,
320
360
  extra_query: Query | None = None,
321
361
  extra_body: Body | None = None,
322
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
362
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
323
363
  ) -> UserLogoutResponse:
324
364
  """Log out the current user by clearing cached keys and refresh token cookie."""
325
365
  return await self._post(
@@ -338,7 +378,7 @@ class AsyncUserResource(AsyncAPIResource):
338
378
  extra_headers: Headers | None = None,
339
379
  extra_query: Query | None = None,
340
380
  extra_body: Body | None = None,
341
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
381
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
342
382
  ) -> Token:
343
383
  """Refresh an expired access token using the refresh token cookie.
344
384
 
@@ -360,15 +400,16 @@ class AsyncUserResource(AsyncAPIResource):
360
400
  last_name: str,
361
401
  name: str,
362
402
  password: str,
403
+ verification_code: str,
363
404
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
364
405
  # The extra values given here take precedence over values defined on the client or passed to this method.
365
406
  extra_headers: Headers | None = None,
366
407
  extra_query: Query | None = None,
367
408
  extra_body: Body | None = None,
368
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
409
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
369
410
  ) -> UserResponse:
370
411
  """
371
- Register a new user.
412
+ Register a new user with email verification.
372
413
 
373
414
  Args:
374
415
  extra_headers: Send extra headers
@@ -387,6 +428,7 @@ class AsyncUserResource(AsyncAPIResource):
387
428
  "last_name": last_name,
388
429
  "name": name,
389
430
  "password": password,
431
+ "verification_code": verification_code,
390
432
  },
391
433
  user_register_params.UserRegisterParams,
392
434
  ),
@@ -404,7 +446,7 @@ class AsyncUserResource(AsyncAPIResource):
404
446
  extra_headers: Headers | None = None,
405
447
  extra_query: Query | None = None,
406
448
  extra_body: Body | None = None,
407
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
449
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
408
450
  ) -> UserResponse:
409
451
  """Retrieve current authenticated user information.
410
452
 
@@ -419,6 +461,43 @@ class AsyncUserResource(AsyncAPIResource):
419
461
  cast_to=UserResponse,
420
462
  )
421
463
 
464
+ async def verify_email(
465
+ self,
466
+ *,
467
+ email: str,
468
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
469
+ # The extra values given here take precedence over values defined on the client or passed to this method.
470
+ extra_headers: Headers | None = None,
471
+ extra_query: Query | None = None,
472
+ extra_body: Body | None = None,
473
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
474
+ ) -> UserVerifyEmailResponse:
475
+ """Send verification email with 3-word code to user.
476
+
477
+ Calls central server to send
478
+ the email.
479
+
480
+ Note: Fails silently if email already exists to prevent email enumeration
481
+ attacks.
482
+
483
+ Args:
484
+ extra_headers: Send extra headers
485
+
486
+ extra_query: Add additional query parameters to the request
487
+
488
+ extra_body: Add additional JSON properties to the request
489
+
490
+ timeout: Override the client-level default timeout for this request, in seconds
491
+ """
492
+ return await self._post(
493
+ "/api/user/verify-email",
494
+ body=await async_maybe_transform({"email": email}, user_verify_email_params.UserVerifyEmailParams),
495
+ options=make_request_options(
496
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
497
+ ),
498
+ cast_to=UserVerifyEmailResponse,
499
+ )
500
+
422
501
 
423
502
  class UserResourceWithRawResponse:
424
503
  def __init__(self, user: UserResource) -> None:
@@ -442,6 +521,9 @@ class UserResourceWithRawResponse:
442
521
  self.retrieve_me = to_raw_response_wrapper(
443
522
  user.retrieve_me,
444
523
  )
524
+ self.verify_email = to_raw_response_wrapper(
525
+ user.verify_email,
526
+ )
445
527
 
446
528
  @cached_property
447
529
  def settings(self) -> SettingsResourceWithRawResponse:
@@ -470,6 +552,9 @@ class AsyncUserResourceWithRawResponse:
470
552
  self.retrieve_me = async_to_raw_response_wrapper(
471
553
  user.retrieve_me,
472
554
  )
555
+ self.verify_email = async_to_raw_response_wrapper(
556
+ user.verify_email,
557
+ )
473
558
 
474
559
  @cached_property
475
560
  def settings(self) -> AsyncSettingsResourceWithRawResponse:
@@ -498,6 +583,9 @@ class UserResourceWithStreamingResponse:
498
583
  self.retrieve_me = to_streamed_response_wrapper(
499
584
  user.retrieve_me,
500
585
  )
586
+ self.verify_email = to_streamed_response_wrapper(
587
+ user.verify_email,
588
+ )
501
589
 
502
590
  @cached_property
503
591
  def settings(self) -> SettingsResourceWithStreamingResponse:
@@ -526,6 +614,9 @@ class AsyncUserResourceWithStreamingResponse:
526
614
  self.retrieve_me = async_to_streamed_response_wrapper(
527
615
  user.retrieve_me,
528
616
  )
617
+ self.verify_email = async_to_streamed_response_wrapper(
618
+ user.verify_email,
619
+ )
529
620
 
530
621
  @cached_property
531
622
  def settings(self) -> AsyncSettingsResourceWithStreamingResponse: