arbi 0.18.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.
Files changed (165) hide show
  1. arbi/__init__.py +92 -0
  2. arbi/_base_client.py +2124 -0
  3. arbi/_client.py +442 -0
  4. arbi/_compat.py +219 -0
  5. arbi/_constants.py +14 -0
  6. arbi/_exceptions.py +108 -0
  7. arbi/_files.py +123 -0
  8. arbi/_models.py +872 -0
  9. arbi/_qs.py +150 -0
  10. arbi/_resource.py +43 -0
  11. arbi/_response.py +830 -0
  12. arbi/_streaming.py +333 -0
  13. arbi/_types.py +270 -0
  14. arbi/_utils/__init__.py +64 -0
  15. arbi/_utils/_compat.py +45 -0
  16. arbi/_utils/_datetime_parse.py +136 -0
  17. arbi/_utils/_logs.py +25 -0
  18. arbi/_utils/_proxy.py +65 -0
  19. arbi/_utils/_reflection.py +42 -0
  20. arbi/_utils/_resources_proxy.py +24 -0
  21. arbi/_utils/_streams.py +12 -0
  22. arbi/_utils/_sync.py +58 -0
  23. arbi/_utils/_transform.py +457 -0
  24. arbi/_utils/_typing.py +156 -0
  25. arbi/_utils/_utils.py +421 -0
  26. arbi/_version.py +4 -0
  27. arbi/lib/.keep +4 -0
  28. arbi/py.typed +0 -0
  29. arbi/resources/__init__.py +19 -0
  30. arbi/resources/api/__init__.py +145 -0
  31. arbi/resources/api/api.py +422 -0
  32. arbi/resources/api/assistant.py +312 -0
  33. arbi/resources/api/configs.py +533 -0
  34. arbi/resources/api/conversation/__init__.py +33 -0
  35. arbi/resources/api/conversation/conversation.py +648 -0
  36. arbi/resources/api/conversation/user.py +270 -0
  37. arbi/resources/api/document/__init__.py +33 -0
  38. arbi/resources/api/document/doctag.py +516 -0
  39. arbi/resources/api/document/document.py +929 -0
  40. arbi/resources/api/health.py +253 -0
  41. arbi/resources/api/notifications.py +478 -0
  42. arbi/resources/api/tag.py +409 -0
  43. arbi/resources/api/user/__init__.py +61 -0
  44. arbi/resources/api/user/contacts.py +322 -0
  45. arbi/resources/api/user/settings.py +283 -0
  46. arbi/resources/api/user/subscription.py +230 -0
  47. arbi/resources/api/user/user.py +943 -0
  48. arbi/resources/api/workspace.py +1198 -0
  49. arbi/types/__init__.py +8 -0
  50. arbi/types/api/__init__.py +94 -0
  51. arbi/types/api/assistant_query_params.py +95 -0
  52. arbi/types/api/assistant_retrieve_params.py +95 -0
  53. arbi/types/api/chunker_config_param.py +9 -0
  54. arbi/types/api/config_create_params.py +227 -0
  55. arbi/types/api/config_create_response.py +17 -0
  56. arbi/types/api/config_delete_response.py +11 -0
  57. arbi/types/api/config_get_versions_response.py +19 -0
  58. arbi/types/api/config_retrieve_response.py +234 -0
  59. arbi/types/api/conversation/__init__.py +8 -0
  60. arbi/types/api/conversation/user_add_params.py +11 -0
  61. arbi/types/api/conversation/user_add_response.py +11 -0
  62. arbi/types/api/conversation/user_remove_params.py +11 -0
  63. arbi/types/api/conversation/user_remove_response.py +11 -0
  64. arbi/types/api/conversation_delete_message_response.py +11 -0
  65. arbi/types/api/conversation_delete_response.py +11 -0
  66. arbi/types/api/conversation_retrieve_message_response.py +105 -0
  67. arbi/types/api/conversation_retrieve_threads_response.py +124 -0
  68. arbi/types/api/conversation_share_response.py +11 -0
  69. arbi/types/api/conversation_update_title_params.py +16 -0
  70. arbi/types/api/conversation_update_title_response.py +13 -0
  71. arbi/types/api/doc_response.py +66 -0
  72. arbi/types/api/document/__init__.py +11 -0
  73. arbi/types/api/document/doc_tag_response.py +40 -0
  74. arbi/types/api/document/doctag_create_params.py +35 -0
  75. arbi/types/api/document/doctag_create_response.py +10 -0
  76. arbi/types/api/document/doctag_delete_params.py +15 -0
  77. arbi/types/api/document/doctag_generate_params.py +22 -0
  78. arbi/types/api/document/doctag_generate_response.py +20 -0
  79. arbi/types/api/document/doctag_update_params.py +35 -0
  80. arbi/types/api/document_date_extractor_llm_config.py +29 -0
  81. arbi/types/api/document_date_extractor_llm_config_param.py +28 -0
  82. arbi/types/api/document_delete_params.py +13 -0
  83. arbi/types/api/document_get_parsed_response.py +26 -0
  84. arbi/types/api/document_retrieve_params.py +16 -0
  85. arbi/types/api/document_retrieve_response.py +10 -0
  86. arbi/types/api/document_update_params.py +42 -0
  87. arbi/types/api/document_update_response.py +10 -0
  88. arbi/types/api/document_upload_from_url_params.py +26 -0
  89. arbi/types/api/document_upload_from_url_response.py +16 -0
  90. arbi/types/api/document_upload_params.py +26 -0
  91. arbi/types/api/document_upload_response.py +16 -0
  92. arbi/types/api/embedder_config.py +30 -0
  93. arbi/types/api/embedder_config_param.py +29 -0
  94. arbi/types/api/health_check_models_response.py +21 -0
  95. arbi/types/api/health_get_models_response.py +19 -0
  96. arbi/types/api/health_retrieve_status_response.py +49 -0
  97. arbi/types/api/model_citation_config.py +20 -0
  98. arbi/types/api/model_citation_config_param.py +20 -0
  99. arbi/types/api/notification_create_params.py +20 -0
  100. arbi/types/api/notification_create_response.py +47 -0
  101. arbi/types/api/notification_delete_params.py +13 -0
  102. arbi/types/api/notification_get_schemas_response.py +197 -0
  103. arbi/types/api/notification_list_response.py +47 -0
  104. arbi/types/api/notification_update_params.py +27 -0
  105. arbi/types/api/notification_update_response.py +47 -0
  106. arbi/types/api/parser_config_param.py +9 -0
  107. arbi/types/api/query_llm_config.py +30 -0
  108. arbi/types/api/query_llm_config_param.py +29 -0
  109. arbi/types/api/reranker_config.py +21 -0
  110. arbi/types/api/reranker_config_param.py +20 -0
  111. arbi/types/api/retriever_config.py +39 -0
  112. arbi/types/api/retriever_config_param.py +38 -0
  113. arbi/types/api/tag_create_params.py +49 -0
  114. arbi/types/api/tag_create_response.py +57 -0
  115. arbi/types/api/tag_delete_response.py +9 -0
  116. arbi/types/api/tag_update_params.py +22 -0
  117. arbi/types/api/tag_update_response.py +57 -0
  118. arbi/types/api/title_llm_config.py +29 -0
  119. arbi/types/api/title_llm_config_param.py +28 -0
  120. arbi/types/api/user/__init__.py +13 -0
  121. arbi/types/api/user/contact_create_params.py +13 -0
  122. arbi/types/api/user/contact_create_response.py +30 -0
  123. arbi/types/api/user/contact_delete_params.py +13 -0
  124. arbi/types/api/user/contact_list_response.py +30 -0
  125. arbi/types/api/user/setting_retrieve_response.py +89 -0
  126. arbi/types/api/user/setting_update_params.py +60 -0
  127. arbi/types/api/user/subscription_create_params.py +13 -0
  128. arbi/types/api/user/subscription_create_response.py +11 -0
  129. arbi/types/api/user/subscription_retrieve_response.py +48 -0
  130. arbi/types/api/user_change_password_params.py +18 -0
  131. arbi/types/api/user_change_password_response.py +11 -0
  132. arbi/types/api/user_check_sso_status_params.py +20 -0
  133. arbi/types/api/user_check_sso_status_response.py +25 -0
  134. arbi/types/api/user_list_products_response.py +37 -0
  135. arbi/types/api/user_list_workspaces_response.py +10 -0
  136. arbi/types/api/user_login_params.py +18 -0
  137. arbi/types/api/user_login_response.py +23 -0
  138. arbi/types/api/user_logout_response.py +9 -0
  139. arbi/types/api/user_register_params.py +22 -0
  140. arbi/types/api/user_response.py +26 -0
  141. arbi/types/api/user_verify_email_params.py +11 -0
  142. arbi/types/api/user_verify_email_response.py +9 -0
  143. arbi/types/api/workspace_copy_params.py +21 -0
  144. arbi/types/api/workspace_copy_response.py +25 -0
  145. arbi/types/api/workspace_create_protected_params.py +16 -0
  146. arbi/types/api/workspace_delete_response.py +9 -0
  147. arbi/types/api/workspace_get_conversations_response.py +30 -0
  148. arbi/types/api/workspace_get_documents_response.py +10 -0
  149. arbi/types/api/workspace_get_stats_response.py +17 -0
  150. arbi/types/api/workspace_get_tags_response.py +60 -0
  151. arbi/types/api/workspace_get_users_response.py +10 -0
  152. arbi/types/api/workspace_remove_user_params.py +11 -0
  153. arbi/types/api/workspace_remove_user_response.py +11 -0
  154. arbi/types/api/workspace_response.py +41 -0
  155. arbi/types/api/workspace_share_params.py +15 -0
  156. arbi/types/api/workspace_share_response.py +13 -0
  157. arbi/types/api/workspace_update_params.py +20 -0
  158. arbi/types/chunk.py +12 -0
  159. arbi/types/chunk_metadata.py +31 -0
  160. arbi/types/chunk_metadata_param.py +32 -0
  161. arbi/types/chunk_param.py +15 -0
  162. arbi-0.18.0.dist-info/METADATA +410 -0
  163. arbi-0.18.0.dist-info/RECORD +165 -0
  164. arbi-0.18.0.dist-info/WHEEL +4 -0
  165. arbi-0.18.0.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,516 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Dict, Optional
6
+
7
+ import httpx
8
+
9
+ from ...._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given
10
+ from ...._utils import maybe_transform, strip_not_given, async_maybe_transform
11
+ from ...._compat import cached_property
12
+ from ...._resource import SyncAPIResource, AsyncAPIResource
13
+ from ...._response import (
14
+ to_raw_response_wrapper,
15
+ to_streamed_response_wrapper,
16
+ async_to_raw_response_wrapper,
17
+ async_to_streamed_response_wrapper,
18
+ )
19
+ from ...._base_client import make_request_options
20
+ from ....types.api.document import (
21
+ doctag_create_params,
22
+ doctag_delete_params,
23
+ doctag_update_params,
24
+ doctag_generate_params,
25
+ )
26
+ from ....types.api.document.doc_tag_response import DocTagResponse
27
+ from ....types.api.document.doctag_create_response import DoctagCreateResponse
28
+ from ....types.api.document.doctag_generate_response import DoctagGenerateResponse
29
+
30
+ __all__ = ["DoctagResource", "AsyncDoctagResource"]
31
+
32
+
33
+ class DoctagResource(SyncAPIResource):
34
+ @cached_property
35
+ def with_raw_response(self) -> DoctagResourceWithRawResponse:
36
+ """
37
+ This property can be used as a prefix for any HTTP method call to return
38
+ the raw response object instead of the parsed content.
39
+
40
+ For more information, see https://www.github.com/arbitrationcity/arbi-python#accessing-raw-response-data-eg-headers
41
+ """
42
+ return DoctagResourceWithRawResponse(self)
43
+
44
+ @cached_property
45
+ def with_streaming_response(self) -> DoctagResourceWithStreamingResponse:
46
+ """
47
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
48
+
49
+ For more information, see https://www.github.com/arbitrationcity/arbi-python#with_streaming_response
50
+ """
51
+ return DoctagResourceWithStreamingResponse(self)
52
+
53
+ def create(
54
+ self,
55
+ *,
56
+ doc_ext_ids: SequenceNotStr[str],
57
+ tag_ext_id: str,
58
+ citations: Optional[Dict[str, doctag_create_params.Citations]] | Omit = omit,
59
+ note: Optional[str] | Omit = omit,
60
+ workspace_key: str | Omit = omit,
61
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
62
+ # The extra values given here take precedence over values defined on the client or passed to this method.
63
+ extra_headers: Headers | None = None,
64
+ extra_query: Query | None = None,
65
+ extra_body: Body | None = None,
66
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
67
+ ) -> DoctagCreateResponse:
68
+ """
69
+ Apply a tag to one or more documents.
70
+
71
+ Args:
72
+ extra_headers: Send extra headers
73
+
74
+ extra_query: Add additional query parameters to the request
75
+
76
+ extra_body: Add additional JSON properties to the request
77
+
78
+ timeout: Override the client-level default timeout for this request, in seconds
79
+ """
80
+ extra_headers = {**strip_not_given({"workspace-key": workspace_key}), **(extra_headers or {})}
81
+ return self._post(
82
+ "/api/document/doctag",
83
+ body=maybe_transform(
84
+ {
85
+ "doc_ext_ids": doc_ext_ids,
86
+ "tag_ext_id": tag_ext_id,
87
+ "citations": citations,
88
+ "note": note,
89
+ },
90
+ doctag_create_params.DoctagCreateParams,
91
+ ),
92
+ options=make_request_options(
93
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
94
+ ),
95
+ cast_to=DoctagCreateResponse,
96
+ )
97
+
98
+ def update(
99
+ self,
100
+ *,
101
+ doc_ext_id: str,
102
+ tag_ext_id: str,
103
+ citations: Optional[Dict[str, doctag_update_params.Citations]] | Omit = omit,
104
+ note: Optional[str] | Omit = omit,
105
+ workspace_key: str | Omit = omit,
106
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
107
+ # The extra values given here take precedence over values defined on the client or passed to this method.
108
+ extra_headers: Headers | None = None,
109
+ extra_query: Query | None = None,
110
+ extra_body: Body | None = None,
111
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
112
+ ) -> DocTagResponse:
113
+ """
114
+ Update a doctag's note or citations.
115
+
116
+ Args:
117
+ extra_headers: Send extra headers
118
+
119
+ extra_query: Add additional query parameters to the request
120
+
121
+ extra_body: Add additional JSON properties to the request
122
+
123
+ timeout: Override the client-level default timeout for this request, in seconds
124
+ """
125
+ extra_headers = {**strip_not_given({"workspace-key": workspace_key}), **(extra_headers or {})}
126
+ return self._patch(
127
+ "/api/document/doctag",
128
+ body=maybe_transform(
129
+ {
130
+ "doc_ext_id": doc_ext_id,
131
+ "tag_ext_id": tag_ext_id,
132
+ "citations": citations,
133
+ "note": note,
134
+ },
135
+ doctag_update_params.DoctagUpdateParams,
136
+ ),
137
+ options=make_request_options(
138
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
139
+ ),
140
+ cast_to=DocTagResponse,
141
+ )
142
+
143
+ def delete(
144
+ self,
145
+ *,
146
+ doc_ext_ids: SequenceNotStr[str],
147
+ tag_ext_id: str,
148
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
149
+ # The extra values given here take precedence over values defined on the client or passed to this method.
150
+ extra_headers: Headers | None = None,
151
+ extra_query: Query | None = None,
152
+ extra_body: Body | None = None,
153
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
154
+ ) -> None:
155
+ """
156
+ Remove a tag from one or more documents.
157
+
158
+ Args:
159
+ extra_headers: Send extra headers
160
+
161
+ extra_query: Add additional query parameters to the request
162
+
163
+ extra_body: Add additional JSON properties to the request
164
+
165
+ timeout: Override the client-level default timeout for this request, in seconds
166
+ """
167
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
168
+ return self._delete(
169
+ "/api/document/doctag",
170
+ body=maybe_transform(
171
+ {
172
+ "doc_ext_ids": doc_ext_ids,
173
+ "tag_ext_id": tag_ext_id,
174
+ },
175
+ doctag_delete_params.DoctagDeleteParams,
176
+ ),
177
+ options=make_request_options(
178
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
179
+ ),
180
+ cast_to=NoneType,
181
+ )
182
+
183
+ def generate(
184
+ self,
185
+ *,
186
+ doc_ext_ids: SequenceNotStr[str],
187
+ tag_ext_ids: SequenceNotStr[str],
188
+ config_ext_id: Optional[str] | Omit = omit,
189
+ workspace_key: str | Omit = omit,
190
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
191
+ # The extra values given here take precedence over values defined on the client or passed to this method.
192
+ extra_headers: Headers | None = None,
193
+ extra_query: Query | None = None,
194
+ extra_body: Body | None = None,
195
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
196
+ ) -> DoctagGenerateResponse:
197
+ """
198
+ Generate AI annotations for documents using tag instructions.
199
+
200
+ Creates doctags with AI-generated notes and citations for each (doc, tag) pair.
201
+ Uses tag name + optional instruction as the question to answer about each
202
+ document.
203
+
204
+ Returns 202 Accepted immediately - processing happens in background. WebSocket
205
+ notification sent when complete.
206
+
207
+ Args:
208
+ config_ext_id: Configuration to use for LLM
209
+
210
+ extra_headers: Send extra headers
211
+
212
+ extra_query: Add additional query parameters to the request
213
+
214
+ extra_body: Add additional JSON properties to the request
215
+
216
+ timeout: Override the client-level default timeout for this request, in seconds
217
+ """
218
+ extra_headers = {**strip_not_given({"workspace-key": workspace_key}), **(extra_headers or {})}
219
+ return self._post(
220
+ "/api/document/doctag/generate",
221
+ body=maybe_transform(
222
+ {
223
+ "doc_ext_ids": doc_ext_ids,
224
+ "tag_ext_ids": tag_ext_ids,
225
+ },
226
+ doctag_generate_params.DoctagGenerateParams,
227
+ ),
228
+ options=make_request_options(
229
+ extra_headers=extra_headers,
230
+ extra_query=extra_query,
231
+ extra_body=extra_body,
232
+ timeout=timeout,
233
+ query=maybe_transform({"config_ext_id": config_ext_id}, doctag_generate_params.DoctagGenerateParams),
234
+ ),
235
+ cast_to=DoctagGenerateResponse,
236
+ )
237
+
238
+
239
+ class AsyncDoctagResource(AsyncAPIResource):
240
+ @cached_property
241
+ def with_raw_response(self) -> AsyncDoctagResourceWithRawResponse:
242
+ """
243
+ This property can be used as a prefix for any HTTP method call to return
244
+ the raw response object instead of the parsed content.
245
+
246
+ For more information, see https://www.github.com/arbitrationcity/arbi-python#accessing-raw-response-data-eg-headers
247
+ """
248
+ return AsyncDoctagResourceWithRawResponse(self)
249
+
250
+ @cached_property
251
+ def with_streaming_response(self) -> AsyncDoctagResourceWithStreamingResponse:
252
+ """
253
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
254
+
255
+ For more information, see https://www.github.com/arbitrationcity/arbi-python#with_streaming_response
256
+ """
257
+ return AsyncDoctagResourceWithStreamingResponse(self)
258
+
259
+ async def create(
260
+ self,
261
+ *,
262
+ doc_ext_ids: SequenceNotStr[str],
263
+ tag_ext_id: str,
264
+ citations: Optional[Dict[str, doctag_create_params.Citations]] | Omit = omit,
265
+ note: Optional[str] | Omit = omit,
266
+ workspace_key: str | Omit = omit,
267
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
268
+ # The extra values given here take precedence over values defined on the client or passed to this method.
269
+ extra_headers: Headers | None = None,
270
+ extra_query: Query | None = None,
271
+ extra_body: Body | None = None,
272
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
273
+ ) -> DoctagCreateResponse:
274
+ """
275
+ Apply a tag to one or more documents.
276
+
277
+ Args:
278
+ extra_headers: Send extra headers
279
+
280
+ extra_query: Add additional query parameters to the request
281
+
282
+ extra_body: Add additional JSON properties to the request
283
+
284
+ timeout: Override the client-level default timeout for this request, in seconds
285
+ """
286
+ extra_headers = {**strip_not_given({"workspace-key": workspace_key}), **(extra_headers or {})}
287
+ return await self._post(
288
+ "/api/document/doctag",
289
+ body=await async_maybe_transform(
290
+ {
291
+ "doc_ext_ids": doc_ext_ids,
292
+ "tag_ext_id": tag_ext_id,
293
+ "citations": citations,
294
+ "note": note,
295
+ },
296
+ doctag_create_params.DoctagCreateParams,
297
+ ),
298
+ options=make_request_options(
299
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
300
+ ),
301
+ cast_to=DoctagCreateResponse,
302
+ )
303
+
304
+ async def update(
305
+ self,
306
+ *,
307
+ doc_ext_id: str,
308
+ tag_ext_id: str,
309
+ citations: Optional[Dict[str, doctag_update_params.Citations]] | Omit = omit,
310
+ note: Optional[str] | Omit = omit,
311
+ workspace_key: str | Omit = omit,
312
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
313
+ # The extra values given here take precedence over values defined on the client or passed to this method.
314
+ extra_headers: Headers | None = None,
315
+ extra_query: Query | None = None,
316
+ extra_body: Body | None = None,
317
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
318
+ ) -> DocTagResponse:
319
+ """
320
+ Update a doctag's note or citations.
321
+
322
+ Args:
323
+ extra_headers: Send extra headers
324
+
325
+ extra_query: Add additional query parameters to the request
326
+
327
+ extra_body: Add additional JSON properties to the request
328
+
329
+ timeout: Override the client-level default timeout for this request, in seconds
330
+ """
331
+ extra_headers = {**strip_not_given({"workspace-key": workspace_key}), **(extra_headers or {})}
332
+ return await self._patch(
333
+ "/api/document/doctag",
334
+ body=await async_maybe_transform(
335
+ {
336
+ "doc_ext_id": doc_ext_id,
337
+ "tag_ext_id": tag_ext_id,
338
+ "citations": citations,
339
+ "note": note,
340
+ },
341
+ doctag_update_params.DoctagUpdateParams,
342
+ ),
343
+ options=make_request_options(
344
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
345
+ ),
346
+ cast_to=DocTagResponse,
347
+ )
348
+
349
+ async def delete(
350
+ self,
351
+ *,
352
+ doc_ext_ids: SequenceNotStr[str],
353
+ tag_ext_id: str,
354
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
355
+ # The extra values given here take precedence over values defined on the client or passed to this method.
356
+ extra_headers: Headers | None = None,
357
+ extra_query: Query | None = None,
358
+ extra_body: Body | None = None,
359
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
360
+ ) -> None:
361
+ """
362
+ Remove a tag from one or more documents.
363
+
364
+ Args:
365
+ extra_headers: Send extra headers
366
+
367
+ extra_query: Add additional query parameters to the request
368
+
369
+ extra_body: Add additional JSON properties to the request
370
+
371
+ timeout: Override the client-level default timeout for this request, in seconds
372
+ """
373
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
374
+ return await self._delete(
375
+ "/api/document/doctag",
376
+ body=await async_maybe_transform(
377
+ {
378
+ "doc_ext_ids": doc_ext_ids,
379
+ "tag_ext_id": tag_ext_id,
380
+ },
381
+ doctag_delete_params.DoctagDeleteParams,
382
+ ),
383
+ options=make_request_options(
384
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
385
+ ),
386
+ cast_to=NoneType,
387
+ )
388
+
389
+ async def generate(
390
+ self,
391
+ *,
392
+ doc_ext_ids: SequenceNotStr[str],
393
+ tag_ext_ids: SequenceNotStr[str],
394
+ config_ext_id: Optional[str] | Omit = omit,
395
+ workspace_key: str | Omit = omit,
396
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
397
+ # The extra values given here take precedence over values defined on the client or passed to this method.
398
+ extra_headers: Headers | None = None,
399
+ extra_query: Query | None = None,
400
+ extra_body: Body | None = None,
401
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
402
+ ) -> DoctagGenerateResponse:
403
+ """
404
+ Generate AI annotations for documents using tag instructions.
405
+
406
+ Creates doctags with AI-generated notes and citations for each (doc, tag) pair.
407
+ Uses tag name + optional instruction as the question to answer about each
408
+ document.
409
+
410
+ Returns 202 Accepted immediately - processing happens in background. WebSocket
411
+ notification sent when complete.
412
+
413
+ Args:
414
+ config_ext_id: Configuration to use for LLM
415
+
416
+ extra_headers: Send extra headers
417
+
418
+ extra_query: Add additional query parameters to the request
419
+
420
+ extra_body: Add additional JSON properties to the request
421
+
422
+ timeout: Override the client-level default timeout for this request, in seconds
423
+ """
424
+ extra_headers = {**strip_not_given({"workspace-key": workspace_key}), **(extra_headers or {})}
425
+ return await self._post(
426
+ "/api/document/doctag/generate",
427
+ body=await async_maybe_transform(
428
+ {
429
+ "doc_ext_ids": doc_ext_ids,
430
+ "tag_ext_ids": tag_ext_ids,
431
+ },
432
+ doctag_generate_params.DoctagGenerateParams,
433
+ ),
434
+ options=make_request_options(
435
+ extra_headers=extra_headers,
436
+ extra_query=extra_query,
437
+ extra_body=extra_body,
438
+ timeout=timeout,
439
+ query=await async_maybe_transform(
440
+ {"config_ext_id": config_ext_id}, doctag_generate_params.DoctagGenerateParams
441
+ ),
442
+ ),
443
+ cast_to=DoctagGenerateResponse,
444
+ )
445
+
446
+
447
+ class DoctagResourceWithRawResponse:
448
+ def __init__(self, doctag: DoctagResource) -> None:
449
+ self._doctag = doctag
450
+
451
+ self.create = to_raw_response_wrapper(
452
+ doctag.create,
453
+ )
454
+ self.update = to_raw_response_wrapper(
455
+ doctag.update,
456
+ )
457
+ self.delete = to_raw_response_wrapper(
458
+ doctag.delete,
459
+ )
460
+ self.generate = to_raw_response_wrapper(
461
+ doctag.generate,
462
+ )
463
+
464
+
465
+ class AsyncDoctagResourceWithRawResponse:
466
+ def __init__(self, doctag: AsyncDoctagResource) -> None:
467
+ self._doctag = doctag
468
+
469
+ self.create = async_to_raw_response_wrapper(
470
+ doctag.create,
471
+ )
472
+ self.update = async_to_raw_response_wrapper(
473
+ doctag.update,
474
+ )
475
+ self.delete = async_to_raw_response_wrapper(
476
+ doctag.delete,
477
+ )
478
+ self.generate = async_to_raw_response_wrapper(
479
+ doctag.generate,
480
+ )
481
+
482
+
483
+ class DoctagResourceWithStreamingResponse:
484
+ def __init__(self, doctag: DoctagResource) -> None:
485
+ self._doctag = doctag
486
+
487
+ self.create = to_streamed_response_wrapper(
488
+ doctag.create,
489
+ )
490
+ self.update = to_streamed_response_wrapper(
491
+ doctag.update,
492
+ )
493
+ self.delete = to_streamed_response_wrapper(
494
+ doctag.delete,
495
+ )
496
+ self.generate = to_streamed_response_wrapper(
497
+ doctag.generate,
498
+ )
499
+
500
+
501
+ class AsyncDoctagResourceWithStreamingResponse:
502
+ def __init__(self, doctag: AsyncDoctagResource) -> None:
503
+ self._doctag = doctag
504
+
505
+ self.create = async_to_streamed_response_wrapper(
506
+ doctag.create,
507
+ )
508
+ self.update = async_to_streamed_response_wrapper(
509
+ doctag.update,
510
+ )
511
+ self.delete = async_to_streamed_response_wrapper(
512
+ doctag.delete,
513
+ )
514
+ self.generate = async_to_streamed_response_wrapper(
515
+ doctag.generate,
516
+ )