arbi 0.2.1__py3-none-any.whl → 0.3.1__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.
- arbi/_streaming.py +4 -6
- arbi/_version.py +1 -1
- arbi/resources/api/__init__.py +0 -14
- arbi/resources/api/api.py +0 -32
- arbi/resources/api/assistant.py +9 -1
- arbi/resources/api/conversation/conversation.py +87 -2
- arbi/resources/api/document/annotation.py +9 -1
- arbi/resources/api/document/document.py +39 -1
- arbi/resources/api/tag.py +13 -1
- arbi/resources/api/user/user.py +397 -134
- arbi/resources/api/workspace.py +202 -12
- arbi/types/api/__init__.py +12 -7
- arbi/types/api/assistant_query_params.py +22 -2
- arbi/types/api/assistant_retrieve_params.py +22 -2
- arbi/types/api/conversation_retrieve_message_response.py +99 -0
- arbi/types/api/conversation_retrieve_threads_response.py +16 -0
- arbi/types/api/document/annotation_create_params.py +5 -1
- arbi/types/api/document/annotation_update_params.py +5 -1
- arbi/types/api/document_update_params.py +2 -0
- arbi/types/api/document_upload_from_url_params.py +4 -1
- arbi/types/api/document_upload_params.py +4 -1
- arbi/types/api/document_view_params.py +5 -1
- arbi/types/api/tag_create_params.py +5 -1
- arbi/types/api/tag_update_params.py +5 -1
- arbi/types/api/user_change_password_params.py +16 -0
- arbi/types/api/{sso_rotate_passcode_response.py → user_change_password_response.py} +3 -3
- arbi/types/api/{sso_login_params.py → user_check_sso_status_params.py} +3 -6
- arbi/types/api/{user_response.py → user_check_sso_status_response.py} +4 -6
- arbi/types/api/{sso_invite_params.py → user_invite_params.py} +2 -2
- arbi/types/api/{sso_invite_response.py → user_invite_response.py} +2 -4
- arbi/types/api/user_login_params.py +4 -1
- arbi/types/api/user_login_response.py +8 -0
- arbi/types/api/user_register_params.py +5 -4
- arbi/types/api/workspace_copy_params.py +21 -0
- arbi/types/api/workspace_copy_response.py +25 -0
- arbi/types/api/workspace_get_stats_response.py +6 -2
- arbi/types/api/workspace_get_users_response.py +5 -1
- arbi/types/api/workspace_response.py +24 -2
- arbi/types/api/workspace_share_params.py +5 -1
- arbi/types/api/workspace_update_params.py +5 -1
- {arbi-0.2.1.dist-info → arbi-0.3.1.dist-info}/METADATA +1 -1
- {arbi-0.2.1.dist-info → arbi-0.3.1.dist-info}/RECORD +44 -42
- arbi/resources/api/sso.py +0 -333
- arbi/types/api/sso_login_response.py +0 -15
- arbi/types/api/token.py +0 -13
- {arbi-0.2.1.dist-info → arbi-0.3.1.dist-info}/WHEEL +0 -0
- {arbi-0.2.1.dist-info → arbi-0.3.1.dist-info}/licenses/LICENSE +0 -0
arbi/_streaming.py
CHANGED
|
@@ -57,9 +57,8 @@ class Stream(Generic[_T]):
|
|
|
57
57
|
for sse in iterator:
|
|
58
58
|
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
|
|
59
59
|
|
|
60
|
-
#
|
|
61
|
-
|
|
62
|
-
...
|
|
60
|
+
# As we might not fully consume the response stream, we need to close it explicitly
|
|
61
|
+
response.close()
|
|
63
62
|
|
|
64
63
|
def __enter__(self) -> Self:
|
|
65
64
|
return self
|
|
@@ -121,9 +120,8 @@ class AsyncStream(Generic[_T]):
|
|
|
121
120
|
async for sse in iterator:
|
|
122
121
|
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
|
|
123
122
|
|
|
124
|
-
#
|
|
125
|
-
|
|
126
|
-
...
|
|
123
|
+
# As we might not fully consume the response stream, we need to close it explicitly
|
|
124
|
+
await response.aclose()
|
|
127
125
|
|
|
128
126
|
async def __aenter__(self) -> Self:
|
|
129
127
|
return self
|
arbi/_version.py
CHANGED
arbi/resources/api/__init__.py
CHANGED
|
@@ -8,14 +8,6 @@ from .api import (
|
|
|
8
8
|
APIResourceWithStreamingResponse,
|
|
9
9
|
AsyncAPIResourceWithStreamingResponse,
|
|
10
10
|
)
|
|
11
|
-
from .sso import (
|
|
12
|
-
SSOResource,
|
|
13
|
-
AsyncSSOResource,
|
|
14
|
-
SSOResourceWithRawResponse,
|
|
15
|
-
AsyncSSOResourceWithRawResponse,
|
|
16
|
-
SSOResourceWithStreamingResponse,
|
|
17
|
-
AsyncSSOResourceWithStreamingResponse,
|
|
18
|
-
)
|
|
19
11
|
from .tag import (
|
|
20
12
|
TagResource,
|
|
21
13
|
AsyncTagResource,
|
|
@@ -88,12 +80,6 @@ __all__ = [
|
|
|
88
80
|
"AsyncUserResourceWithRawResponse",
|
|
89
81
|
"UserResourceWithStreamingResponse",
|
|
90
82
|
"AsyncUserResourceWithStreamingResponse",
|
|
91
|
-
"SSOResource",
|
|
92
|
-
"AsyncSSOResource",
|
|
93
|
-
"SSOResourceWithRawResponse",
|
|
94
|
-
"AsyncSSOResourceWithRawResponse",
|
|
95
|
-
"SSOResourceWithStreamingResponse",
|
|
96
|
-
"AsyncSSOResourceWithStreamingResponse",
|
|
97
83
|
"WorkspaceResource",
|
|
98
84
|
"AsyncWorkspaceResource",
|
|
99
85
|
"WorkspaceResourceWithRawResponse",
|
arbi/resources/api/api.py
CHANGED
|
@@ -5,14 +5,6 @@ from __future__ import annotations
|
|
|
5
5
|
import httpx
|
|
6
6
|
|
|
7
7
|
from ... import _resource
|
|
8
|
-
from .sso import (
|
|
9
|
-
SSOResource,
|
|
10
|
-
AsyncSSOResource,
|
|
11
|
-
SSOResourceWithRawResponse,
|
|
12
|
-
AsyncSSOResourceWithRawResponse,
|
|
13
|
-
SSOResourceWithStreamingResponse,
|
|
14
|
-
AsyncSSOResourceWithStreamingResponse,
|
|
15
|
-
)
|
|
16
8
|
from .tag import (
|
|
17
9
|
TagResource,
|
|
18
10
|
AsyncTagResource,
|
|
@@ -95,10 +87,6 @@ class APIResource(_resource.SyncAPIResource):
|
|
|
95
87
|
def user(self) -> UserResource:
|
|
96
88
|
return UserResource(self._client)
|
|
97
89
|
|
|
98
|
-
@cached_property
|
|
99
|
-
def sso(self) -> SSOResource:
|
|
100
|
-
return SSOResource(self._client)
|
|
101
|
-
|
|
102
90
|
@cached_property
|
|
103
91
|
def workspace(self) -> WorkspaceResource:
|
|
104
92
|
return WorkspaceResource(self._client)
|
|
@@ -171,10 +159,6 @@ class AsyncAPIResource(_resource.AsyncAPIResource):
|
|
|
171
159
|
def user(self) -> AsyncUserResource:
|
|
172
160
|
return AsyncUserResource(self._client)
|
|
173
161
|
|
|
174
|
-
@cached_property
|
|
175
|
-
def sso(self) -> AsyncSSOResource:
|
|
176
|
-
return AsyncSSOResource(self._client)
|
|
177
|
-
|
|
178
162
|
@cached_property
|
|
179
163
|
def workspace(self) -> AsyncWorkspaceResource:
|
|
180
164
|
return AsyncWorkspaceResource(self._client)
|
|
@@ -254,10 +238,6 @@ class APIResourceWithRawResponse:
|
|
|
254
238
|
def user(self) -> UserResourceWithRawResponse:
|
|
255
239
|
return UserResourceWithRawResponse(self._api.user)
|
|
256
240
|
|
|
257
|
-
@cached_property
|
|
258
|
-
def sso(self) -> SSOResourceWithRawResponse:
|
|
259
|
-
return SSOResourceWithRawResponse(self._api.sso)
|
|
260
|
-
|
|
261
241
|
@cached_property
|
|
262
242
|
def workspace(self) -> WorkspaceResourceWithRawResponse:
|
|
263
243
|
return WorkspaceResourceWithRawResponse(self._api.workspace)
|
|
@@ -299,10 +279,6 @@ class AsyncAPIResourceWithRawResponse:
|
|
|
299
279
|
def user(self) -> AsyncUserResourceWithRawResponse:
|
|
300
280
|
return AsyncUserResourceWithRawResponse(self._api.user)
|
|
301
281
|
|
|
302
|
-
@cached_property
|
|
303
|
-
def sso(self) -> AsyncSSOResourceWithRawResponse:
|
|
304
|
-
return AsyncSSOResourceWithRawResponse(self._api.sso)
|
|
305
|
-
|
|
306
282
|
@cached_property
|
|
307
283
|
def workspace(self) -> AsyncWorkspaceResourceWithRawResponse:
|
|
308
284
|
return AsyncWorkspaceResourceWithRawResponse(self._api.workspace)
|
|
@@ -344,10 +320,6 @@ class APIResourceWithStreamingResponse:
|
|
|
344
320
|
def user(self) -> UserResourceWithStreamingResponse:
|
|
345
321
|
return UserResourceWithStreamingResponse(self._api.user)
|
|
346
322
|
|
|
347
|
-
@cached_property
|
|
348
|
-
def sso(self) -> SSOResourceWithStreamingResponse:
|
|
349
|
-
return SSOResourceWithStreamingResponse(self._api.sso)
|
|
350
|
-
|
|
351
323
|
@cached_property
|
|
352
324
|
def workspace(self) -> WorkspaceResourceWithStreamingResponse:
|
|
353
325
|
return WorkspaceResourceWithStreamingResponse(self._api.workspace)
|
|
@@ -389,10 +361,6 @@ class AsyncAPIResourceWithStreamingResponse:
|
|
|
389
361
|
def user(self) -> AsyncUserResourceWithStreamingResponse:
|
|
390
362
|
return AsyncUserResourceWithStreamingResponse(self._api.user)
|
|
391
363
|
|
|
392
|
-
@cached_property
|
|
393
|
-
def sso(self) -> AsyncSSOResourceWithStreamingResponse:
|
|
394
|
-
return AsyncSSOResourceWithStreamingResponse(self._api.sso)
|
|
395
|
-
|
|
396
364
|
@cached_property
|
|
397
365
|
def workspace(self) -> AsyncWorkspaceResourceWithStreamingResponse:
|
|
398
366
|
return AsyncWorkspaceResourceWithStreamingResponse(self._api.workspace)
|
arbi/resources/api/assistant.py
CHANGED
|
@@ -7,7 +7,7 @@ from typing import Dict, Optional
|
|
|
7
7
|
import httpx
|
|
8
8
|
|
|
9
9
|
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
10
|
-
from ..._utils import maybe_transform, async_maybe_transform
|
|
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 (
|
|
@@ -50,6 +50,7 @@ class AssistantResource(SyncAPIResource):
|
|
|
50
50
|
config_ext_id: Optional[str] | Omit = omit,
|
|
51
51
|
parent_message_ext_id: Optional[str] | Omit = omit,
|
|
52
52
|
tools: Dict[str, assistant_retrieve_params.Tools] | Omit = omit,
|
|
53
|
+
workspace_key: str | Omit = omit,
|
|
53
54
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
54
55
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
55
56
|
extra_headers: Headers | None = None,
|
|
@@ -71,6 +72,7 @@ class AssistantResource(SyncAPIResource):
|
|
|
71
72
|
|
|
72
73
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
73
74
|
"""
|
|
75
|
+
extra_headers = {**strip_not_given({"workspace-key": workspace_key}), **(extra_headers or {})}
|
|
74
76
|
return self._post(
|
|
75
77
|
"/api/assistant/retrieve",
|
|
76
78
|
body=maybe_transform(
|
|
@@ -97,6 +99,7 @@ class AssistantResource(SyncAPIResource):
|
|
|
97
99
|
config_ext_id: Optional[str] | Omit = omit,
|
|
98
100
|
parent_message_ext_id: Optional[str] | Omit = omit,
|
|
99
101
|
tools: Dict[str, assistant_query_params.Tools] | Omit = omit,
|
|
102
|
+
workspace_key: str | Omit = omit,
|
|
100
103
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
101
104
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
102
105
|
extra_headers: Headers | None = None,
|
|
@@ -118,6 +121,7 @@ class AssistantResource(SyncAPIResource):
|
|
|
118
121
|
|
|
119
122
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
120
123
|
"""
|
|
124
|
+
extra_headers = {**strip_not_given({"workspace-key": workspace_key}), **(extra_headers or {})}
|
|
121
125
|
return self._post(
|
|
122
126
|
"/api/assistant/query",
|
|
123
127
|
body=maybe_transform(
|
|
@@ -165,6 +169,7 @@ class AsyncAssistantResource(AsyncAPIResource):
|
|
|
165
169
|
config_ext_id: Optional[str] | Omit = omit,
|
|
166
170
|
parent_message_ext_id: Optional[str] | Omit = omit,
|
|
167
171
|
tools: Dict[str, assistant_retrieve_params.Tools] | Omit = omit,
|
|
172
|
+
workspace_key: str | Omit = omit,
|
|
168
173
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
169
174
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
170
175
|
extra_headers: Headers | None = None,
|
|
@@ -186,6 +191,7 @@ class AsyncAssistantResource(AsyncAPIResource):
|
|
|
186
191
|
|
|
187
192
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
188
193
|
"""
|
|
194
|
+
extra_headers = {**strip_not_given({"workspace-key": workspace_key}), **(extra_headers or {})}
|
|
189
195
|
return await self._post(
|
|
190
196
|
"/api/assistant/retrieve",
|
|
191
197
|
body=await async_maybe_transform(
|
|
@@ -212,6 +218,7 @@ class AsyncAssistantResource(AsyncAPIResource):
|
|
|
212
218
|
config_ext_id: Optional[str] | Omit = omit,
|
|
213
219
|
parent_message_ext_id: Optional[str] | Omit = omit,
|
|
214
220
|
tools: Dict[str, assistant_query_params.Tools] | Omit = omit,
|
|
221
|
+
workspace_key: str | Omit = omit,
|
|
215
222
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
216
223
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
217
224
|
extra_headers: Headers | None = None,
|
|
@@ -233,6 +240,7 @@ class AsyncAssistantResource(AsyncAPIResource):
|
|
|
233
240
|
|
|
234
241
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
235
242
|
"""
|
|
243
|
+
extra_headers = {**strip_not_given({"workspace-key": workspace_key}), **(extra_headers or {})}
|
|
236
244
|
return await self._post(
|
|
237
245
|
"/api/assistant/query",
|
|
238
246
|
body=await async_maybe_transform(
|
|
@@ -12,8 +12,8 @@ from .user import (
|
|
|
12
12
|
UserResourceWithStreamingResponse,
|
|
13
13
|
AsyncUserResourceWithStreamingResponse,
|
|
14
14
|
)
|
|
15
|
-
from ...._types import Body, Query, Headers, NotGiven, not_given
|
|
16
|
-
from ...._utils import maybe_transform, async_maybe_transform
|
|
15
|
+
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
16
|
+
from ...._utils import maybe_transform, strip_not_given, async_maybe_transform
|
|
17
17
|
from ...._compat import cached_property
|
|
18
18
|
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
19
19
|
from ...._response import (
|
|
@@ -28,6 +28,7 @@ from ....types.api.conversation_share_response import ConversationShareResponse
|
|
|
28
28
|
from ....types.api.conversation_delete_response import ConversationDeleteResponse
|
|
29
29
|
from ....types.api.conversation_update_title_response import ConversationUpdateTitleResponse
|
|
30
30
|
from ....types.api.conversation_delete_message_response import ConversationDeleteMessageResponse
|
|
31
|
+
from ....types.api.conversation_retrieve_message_response import ConversationRetrieveMessageResponse
|
|
31
32
|
from ....types.api.conversation_retrieve_threads_response import ConversationRetrieveThreadsResponse
|
|
32
33
|
|
|
33
34
|
__all__ = ["ConversationResource", "AsyncConversationResource"]
|
|
@@ -128,6 +129,42 @@ class ConversationResource(SyncAPIResource):
|
|
|
128
129
|
cast_to=ConversationDeleteMessageResponse,
|
|
129
130
|
)
|
|
130
131
|
|
|
132
|
+
def retrieve_message(
|
|
133
|
+
self,
|
|
134
|
+
message_ext_id: str,
|
|
135
|
+
*,
|
|
136
|
+
workspace_key: str | Omit = omit,
|
|
137
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
138
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
139
|
+
extra_headers: Headers | None = None,
|
|
140
|
+
extra_query: Query | None = None,
|
|
141
|
+
extra_body: Body | None = None,
|
|
142
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
143
|
+
) -> ConversationRetrieveMessageResponse:
|
|
144
|
+
"""
|
|
145
|
+
Get a single message with full details including decrypted execution trace.
|
|
146
|
+
Always includes the trace with decrypted sensitive fields.
|
|
147
|
+
|
|
148
|
+
Args:
|
|
149
|
+
extra_headers: Send extra headers
|
|
150
|
+
|
|
151
|
+
extra_query: Add additional query parameters to the request
|
|
152
|
+
|
|
153
|
+
extra_body: Add additional JSON properties to the request
|
|
154
|
+
|
|
155
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
156
|
+
"""
|
|
157
|
+
if not message_ext_id:
|
|
158
|
+
raise ValueError(f"Expected a non-empty value for `message_ext_id` but received {message_ext_id!r}")
|
|
159
|
+
extra_headers = {**strip_not_given({"workspace-key": workspace_key}), **(extra_headers or {})}
|
|
160
|
+
return self._get(
|
|
161
|
+
f"/api/conversation/message/{message_ext_id}",
|
|
162
|
+
options=make_request_options(
|
|
163
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
164
|
+
),
|
|
165
|
+
cast_to=ConversationRetrieveMessageResponse,
|
|
166
|
+
)
|
|
167
|
+
|
|
131
168
|
def retrieve_threads(
|
|
132
169
|
self,
|
|
133
170
|
conversation_ext_id: str,
|
|
@@ -338,6 +375,42 @@ class AsyncConversationResource(AsyncAPIResource):
|
|
|
338
375
|
cast_to=ConversationDeleteMessageResponse,
|
|
339
376
|
)
|
|
340
377
|
|
|
378
|
+
async def retrieve_message(
|
|
379
|
+
self,
|
|
380
|
+
message_ext_id: str,
|
|
381
|
+
*,
|
|
382
|
+
workspace_key: str | Omit = omit,
|
|
383
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
384
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
385
|
+
extra_headers: Headers | None = None,
|
|
386
|
+
extra_query: Query | None = None,
|
|
387
|
+
extra_body: Body | None = None,
|
|
388
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
389
|
+
) -> ConversationRetrieveMessageResponse:
|
|
390
|
+
"""
|
|
391
|
+
Get a single message with full details including decrypted execution trace.
|
|
392
|
+
Always includes the trace with decrypted sensitive fields.
|
|
393
|
+
|
|
394
|
+
Args:
|
|
395
|
+
extra_headers: Send extra headers
|
|
396
|
+
|
|
397
|
+
extra_query: Add additional query parameters to the request
|
|
398
|
+
|
|
399
|
+
extra_body: Add additional JSON properties to the request
|
|
400
|
+
|
|
401
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
402
|
+
"""
|
|
403
|
+
if not message_ext_id:
|
|
404
|
+
raise ValueError(f"Expected a non-empty value for `message_ext_id` but received {message_ext_id!r}")
|
|
405
|
+
extra_headers = {**strip_not_given({"workspace-key": workspace_key}), **(extra_headers or {})}
|
|
406
|
+
return await self._get(
|
|
407
|
+
f"/api/conversation/message/{message_ext_id}",
|
|
408
|
+
options=make_request_options(
|
|
409
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
410
|
+
),
|
|
411
|
+
cast_to=ConversationRetrieveMessageResponse,
|
|
412
|
+
)
|
|
413
|
+
|
|
341
414
|
async def retrieve_threads(
|
|
342
415
|
self,
|
|
343
416
|
conversation_ext_id: str,
|
|
@@ -465,6 +538,9 @@ class ConversationResourceWithRawResponse:
|
|
|
465
538
|
self.delete_message = to_raw_response_wrapper(
|
|
466
539
|
conversation.delete_message,
|
|
467
540
|
)
|
|
541
|
+
self.retrieve_message = to_raw_response_wrapper(
|
|
542
|
+
conversation.retrieve_message,
|
|
543
|
+
)
|
|
468
544
|
self.retrieve_threads = to_raw_response_wrapper(
|
|
469
545
|
conversation.retrieve_threads,
|
|
470
546
|
)
|
|
@@ -490,6 +566,9 @@ class AsyncConversationResourceWithRawResponse:
|
|
|
490
566
|
self.delete_message = async_to_raw_response_wrapper(
|
|
491
567
|
conversation.delete_message,
|
|
492
568
|
)
|
|
569
|
+
self.retrieve_message = async_to_raw_response_wrapper(
|
|
570
|
+
conversation.retrieve_message,
|
|
571
|
+
)
|
|
493
572
|
self.retrieve_threads = async_to_raw_response_wrapper(
|
|
494
573
|
conversation.retrieve_threads,
|
|
495
574
|
)
|
|
@@ -515,6 +594,9 @@ class ConversationResourceWithStreamingResponse:
|
|
|
515
594
|
self.delete_message = to_streamed_response_wrapper(
|
|
516
595
|
conversation.delete_message,
|
|
517
596
|
)
|
|
597
|
+
self.retrieve_message = to_streamed_response_wrapper(
|
|
598
|
+
conversation.retrieve_message,
|
|
599
|
+
)
|
|
518
600
|
self.retrieve_threads = to_streamed_response_wrapper(
|
|
519
601
|
conversation.retrieve_threads,
|
|
520
602
|
)
|
|
@@ -540,6 +622,9 @@ class AsyncConversationResourceWithStreamingResponse:
|
|
|
540
622
|
self.delete_message = async_to_streamed_response_wrapper(
|
|
541
623
|
conversation.delete_message,
|
|
542
624
|
)
|
|
625
|
+
self.retrieve_message = async_to_streamed_response_wrapper(
|
|
626
|
+
conversation.retrieve_message,
|
|
627
|
+
)
|
|
543
628
|
self.retrieve_threads = async_to_streamed_response_wrapper(
|
|
544
629
|
conversation.retrieve_threads,
|
|
545
630
|
)
|
|
@@ -7,7 +7,7 @@ from typing import Optional
|
|
|
7
7
|
import httpx
|
|
8
8
|
|
|
9
9
|
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
10
|
-
from ...._utils import maybe_transform, async_maybe_transform
|
|
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 (
|
|
@@ -51,6 +51,7 @@ class AnnotationResource(SyncAPIResource):
|
|
|
51
51
|
note: Optional[str] | Omit = omit,
|
|
52
52
|
page_ref: Optional[int] | Omit = omit,
|
|
53
53
|
tag_name: Optional[str] | Omit = omit,
|
|
54
|
+
workspace_key: str | Omit = omit,
|
|
54
55
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
55
56
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
56
57
|
extra_headers: Headers | None = None,
|
|
@@ -76,6 +77,7 @@ class AnnotationResource(SyncAPIResource):
|
|
|
76
77
|
"""
|
|
77
78
|
if not doc_ext_id:
|
|
78
79
|
raise ValueError(f"Expected a non-empty value for `doc_ext_id` but received {doc_ext_id!r}")
|
|
80
|
+
extra_headers = {**strip_not_given({"workspace-key": workspace_key}), **(extra_headers or {})}
|
|
79
81
|
return self._post(
|
|
80
82
|
f"/api/document/{doc_ext_id}/annotation",
|
|
81
83
|
body=maybe_transform(
|
|
@@ -99,6 +101,7 @@ class AnnotationResource(SyncAPIResource):
|
|
|
99
101
|
doc_ext_id: str,
|
|
100
102
|
note: Optional[str] | Omit = omit,
|
|
101
103
|
page_ref: Optional[int] | Omit = omit,
|
|
104
|
+
workspace_key: str | Omit = omit,
|
|
102
105
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
103
106
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
104
107
|
extra_headers: Headers | None = None,
|
|
@@ -122,6 +125,7 @@ class AnnotationResource(SyncAPIResource):
|
|
|
122
125
|
raise ValueError(f"Expected a non-empty value for `doc_ext_id` but received {doc_ext_id!r}")
|
|
123
126
|
if not doctag_ext_id:
|
|
124
127
|
raise ValueError(f"Expected a non-empty value for `doctag_ext_id` but received {doctag_ext_id!r}")
|
|
128
|
+
extra_headers = {**strip_not_given({"workspace-key": workspace_key}), **(extra_headers or {})}
|
|
125
129
|
return self._patch(
|
|
126
130
|
f"/api/document/{doc_ext_id}/annotation/{doctag_ext_id}",
|
|
127
131
|
body=maybe_transform(
|
|
@@ -201,6 +205,7 @@ class AsyncAnnotationResource(AsyncAPIResource):
|
|
|
201
205
|
note: Optional[str] | Omit = omit,
|
|
202
206
|
page_ref: Optional[int] | Omit = omit,
|
|
203
207
|
tag_name: Optional[str] | Omit = omit,
|
|
208
|
+
workspace_key: str | Omit = omit,
|
|
204
209
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
205
210
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
206
211
|
extra_headers: Headers | None = None,
|
|
@@ -226,6 +231,7 @@ class AsyncAnnotationResource(AsyncAPIResource):
|
|
|
226
231
|
"""
|
|
227
232
|
if not doc_ext_id:
|
|
228
233
|
raise ValueError(f"Expected a non-empty value for `doc_ext_id` but received {doc_ext_id!r}")
|
|
234
|
+
extra_headers = {**strip_not_given({"workspace-key": workspace_key}), **(extra_headers or {})}
|
|
229
235
|
return await self._post(
|
|
230
236
|
f"/api/document/{doc_ext_id}/annotation",
|
|
231
237
|
body=await async_maybe_transform(
|
|
@@ -249,6 +255,7 @@ class AsyncAnnotationResource(AsyncAPIResource):
|
|
|
249
255
|
doc_ext_id: str,
|
|
250
256
|
note: Optional[str] | Omit = omit,
|
|
251
257
|
page_ref: Optional[int] | Omit = omit,
|
|
258
|
+
workspace_key: str | Omit = omit,
|
|
252
259
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
253
260
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
254
261
|
extra_headers: Headers | None = None,
|
|
@@ -272,6 +279,7 @@ class AsyncAnnotationResource(AsyncAPIResource):
|
|
|
272
279
|
raise ValueError(f"Expected a non-empty value for `doc_ext_id` but received {doc_ext_id!r}")
|
|
273
280
|
if not doctag_ext_id:
|
|
274
281
|
raise ValueError(f"Expected a non-empty value for `doctag_ext_id` but received {doctag_ext_id!r}")
|
|
282
|
+
extra_headers = {**strip_not_given({"workspace-key": workspace_key}), **(extra_headers or {})}
|
|
275
283
|
return await self._patch(
|
|
276
284
|
f"/api/document/{doc_ext_id}/annotation/{doctag_ext_id}",
|
|
277
285
|
body=await async_maybe_transform(
|