arbi 0.1.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.
- arbi/__init__.py +90 -0
- arbi/_base_client.py +1995 -0
- arbi/_client.py +394 -0
- arbi/_compat.py +219 -0
- arbi/_constants.py +14 -0
- arbi/_exceptions.py +108 -0
- arbi/_files.py +123 -0
- arbi/_models.py +829 -0
- arbi/_qs.py +150 -0
- arbi/_resource.py +43 -0
- arbi/_response.py +830 -0
- arbi/_streaming.py +333 -0
- arbi/_types.py +219 -0
- arbi/_utils/__init__.py +57 -0
- arbi/_utils/_logs.py +25 -0
- arbi/_utils/_proxy.py +65 -0
- arbi/_utils/_reflection.py +42 -0
- arbi/_utils/_resources_proxy.py +24 -0
- arbi/_utils/_streams.py +12 -0
- arbi/_utils/_sync.py +86 -0
- arbi/_utils/_transform.py +447 -0
- arbi/_utils/_typing.py +151 -0
- arbi/_utils/_utils.py +422 -0
- arbi/_version.py +4 -0
- arbi/lib/.keep +4 -0
- arbi/py.typed +0 -0
- arbi/resources/__init__.py +19 -0
- arbi/resources/api/__init__.py +145 -0
- arbi/resources/api/api.py +422 -0
- arbi/resources/api/assistant.py +300 -0
- arbi/resources/api/configs.py +499 -0
- arbi/resources/api/conversation/__init__.py +33 -0
- arbi/resources/api/conversation/conversation.py +555 -0
- arbi/resources/api/conversation/user.py +270 -0
- arbi/resources/api/document/__init__.py +33 -0
- arbi/resources/api/document/annotation.py +384 -0
- arbi/resources/api/document/document.py +873 -0
- arbi/resources/api/health.py +304 -0
- arbi/resources/api/sso.py +333 -0
- arbi/resources/api/tag.py +614 -0
- arbi/resources/api/user/__init__.py +33 -0
- arbi/resources/api/user/settings.py +251 -0
- arbi/resources/api/user/user.py +532 -0
- arbi/resources/api/workspace.py +1061 -0
- arbi/types/__init__.py +8 -0
- arbi/types/api/__init__.py +84 -0
- arbi/types/api/assistant_query_params.py +59 -0
- arbi/types/api/assistant_retrieve_params.py +59 -0
- arbi/types/api/chunker_config_param.py +9 -0
- arbi/types/api/config_create_params.py +45 -0
- arbi/types/api/config_create_response.py +15 -0
- arbi/types/api/config_delete_response.py +11 -0
- arbi/types/api/config_get_versions_response.py +19 -0
- arbi/types/api/config_retrieve_response.py +46 -0
- arbi/types/api/conversation/__init__.py +8 -0
- arbi/types/api/conversation/user_add_params.py +11 -0
- arbi/types/api/conversation/user_add_response.py +11 -0
- arbi/types/api/conversation/user_remove_params.py +11 -0
- arbi/types/api/conversation/user_remove_response.py +11 -0
- arbi/types/api/conversation_delete_message_response.py +11 -0
- arbi/types/api/conversation_delete_response.py +11 -0
- arbi/types/api/conversation_retrieve_threads_response.py +91 -0
- arbi/types/api/conversation_share_response.py +11 -0
- arbi/types/api/conversation_update_title_params.py +12 -0
- arbi/types/api/conversation_update_title_response.py +13 -0
- arbi/types/api/doc_response.py +48 -0
- arbi/types/api/document/__init__.py +8 -0
- arbi/types/api/document/annotation_create_params.py +16 -0
- arbi/types/api/document/annotation_delete_response.py +11 -0
- arbi/types/api/document/annotation_update_params.py +16 -0
- arbi/types/api/document/doc_tag_response.py +26 -0
- arbi/types/api/document_date_extractor_llm_config.py +29 -0
- arbi/types/api/document_date_extractor_llm_config_param.py +28 -0
- arbi/types/api/document_delete_response.py +11 -0
- arbi/types/api/document_get_parsed_response.py +26 -0
- arbi/types/api/document_get_tags_response.py +10 -0
- arbi/types/api/document_update_params.py +19 -0
- arbi/types/api/document_update_response.py +22 -0
- arbi/types/api/document_upload_params.py +23 -0
- arbi/types/api/document_view_params.py +13 -0
- arbi/types/api/embedder_config.py +18 -0
- arbi/types/api/embedder_config_param.py +17 -0
- arbi/types/api/health_check_app_response.py +9 -0
- arbi/types/api/health_check_models_response.py +21 -0
- arbi/types/api/health_check_services_response.py +23 -0
- arbi/types/api/health_get_models_response.py +19 -0
- arbi/types/api/model_citation_config.py +23 -0
- arbi/types/api/model_citation_config_param.py +23 -0
- arbi/types/api/parser_config_param.py +9 -0
- arbi/types/api/query_llm_config.py +30 -0
- arbi/types/api/query_llm_config_param.py +29 -0
- arbi/types/api/reranker_config.py +21 -0
- arbi/types/api/reranker_config_param.py +20 -0
- arbi/types/api/retriever_config.py +23 -0
- arbi/types/api/retriever_config_param.py +23 -0
- arbi/types/api/sso_invite_params.py +11 -0
- arbi/types/api/sso_invite_response.py +11 -0
- arbi/types/api/sso_login_params.py +16 -0
- arbi/types/api/sso_login_response.py +15 -0
- arbi/types/api/sso_rotate_passcode_response.py +11 -0
- arbi/types/api/tag_apply_to_docs_params.py +12 -0
- arbi/types/api/tag_apply_to_docs_response.py +13 -0
- arbi/types/api/tag_create_params.py +18 -0
- arbi/types/api/tag_create_response.py +11 -0
- arbi/types/api/tag_delete_response.py +9 -0
- arbi/types/api/tag_get_docs_response.py +10 -0
- arbi/types/api/tag_remove_from_docs_params.py +12 -0
- arbi/types/api/tag_remove_from_docs_response.py +13 -0
- arbi/types/api/tag_update_params.py +14 -0
- arbi/types/api/tag_update_response.py +17 -0
- arbi/types/api/title_llm_config.py +29 -0
- arbi/types/api/title_llm_config_param.py +28 -0
- arbi/types/api/token.py +13 -0
- arbi/types/api/user/__init__.py +6 -0
- arbi/types/api/user/setting_retrieve_response.py +36 -0
- arbi/types/api/user/setting_update_params.py +24 -0
- arbi/types/api/user_list_workspaces_response.py +10 -0
- arbi/types/api/user_login_params.py +13 -0
- arbi/types/api/user_logout_response.py +9 -0
- arbi/types/api/user_register_params.py +17 -0
- arbi/types/api/user_response.py +19 -0
- arbi/types/api/workspace_create_protected_params.py +14 -0
- arbi/types/api/workspace_delete_response.py +9 -0
- arbi/types/api/workspace_get_conversations_response.py +28 -0
- arbi/types/api/workspace_get_doctags_response.py +10 -0
- arbi/types/api/workspace_get_documents_response.py +10 -0
- arbi/types/api/workspace_get_stats_response.py +13 -0
- arbi/types/api/workspace_get_tags_response.py +30 -0
- arbi/types/api/workspace_get_users_response.py +17 -0
- arbi/types/api/workspace_remove_user_params.py +11 -0
- arbi/types/api/workspace_remove_user_response.py +11 -0
- arbi/types/api/workspace_response.py +24 -0
- arbi/types/api/workspace_share_params.py +11 -0
- arbi/types/api/workspace_share_response.py +21 -0
- arbi/types/api/workspace_update_params.py +14 -0
- arbi/types/chunk.py +12 -0
- arbi/types/chunk_metadata.py +31 -0
- arbi/types/chunk_metadata_param.py +32 -0
- arbi/types/chunk_param.py +15 -0
- arbi-0.1.0.dist-info/METADATA +410 -0
- arbi-0.1.0.dist-info/RECORD +143 -0
- arbi-0.1.0.dist-info/WHEEL +4 -0
- arbi-0.1.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,614 @@
|
|
|
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 List, Optional
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
10
|
+
from ..._utils import maybe_transform, 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 ...types.api import tag_create_params, tag_update_params, tag_apply_to_docs_params, tag_remove_from_docs_params
|
|
20
|
+
from ..._base_client import make_request_options
|
|
21
|
+
from ...types.api.tag_create_response import TagCreateResponse
|
|
22
|
+
from ...types.api.tag_delete_response import TagDeleteResponse
|
|
23
|
+
from ...types.api.tag_update_response import TagUpdateResponse
|
|
24
|
+
from ...types.api.tag_get_docs_response import TagGetDocsResponse
|
|
25
|
+
from ...types.api.tag_apply_to_docs_response import TagApplyToDocsResponse
|
|
26
|
+
from ...types.api.tag_remove_from_docs_response import TagRemoveFromDocsResponse
|
|
27
|
+
|
|
28
|
+
__all__ = ["TagResource", "AsyncTagResource"]
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class TagResource(SyncAPIResource):
|
|
32
|
+
@cached_property
|
|
33
|
+
def with_raw_response(self) -> TagResourceWithRawResponse:
|
|
34
|
+
"""
|
|
35
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
36
|
+
the raw response object instead of the parsed content.
|
|
37
|
+
|
|
38
|
+
For more information, see https://www.github.com/arbitrationcity/arbi-python#accessing-raw-response-data-eg-headers
|
|
39
|
+
"""
|
|
40
|
+
return TagResourceWithRawResponse(self)
|
|
41
|
+
|
|
42
|
+
@cached_property
|
|
43
|
+
def with_streaming_response(self) -> TagResourceWithStreamingResponse:
|
|
44
|
+
"""
|
|
45
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
46
|
+
|
|
47
|
+
For more information, see https://www.github.com/arbitrationcity/arbi-python#with_streaming_response
|
|
48
|
+
"""
|
|
49
|
+
return TagResourceWithStreamingResponse(self)
|
|
50
|
+
|
|
51
|
+
def create(
|
|
52
|
+
self,
|
|
53
|
+
*,
|
|
54
|
+
name: str,
|
|
55
|
+
workspace_ext_id: str,
|
|
56
|
+
parent_ext_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
57
|
+
shared: Optional[bool] | NotGiven = NOT_GIVEN,
|
|
58
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
59
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
60
|
+
extra_headers: Headers | None = None,
|
|
61
|
+
extra_query: Query | None = None,
|
|
62
|
+
extra_body: Body | None = None,
|
|
63
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
64
|
+
) -> TagCreateResponse:
|
|
65
|
+
"""
|
|
66
|
+
Create a new tag for a given workspace.
|
|
67
|
+
|
|
68
|
+
If 'shared' is provided, the tag will be set to shared or private accordingly.
|
|
69
|
+
If 'shared' is not provided, it defaults to True (shared).
|
|
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
|
+
return self._post(
|
|
81
|
+
"/api/tag/create",
|
|
82
|
+
body=maybe_transform(
|
|
83
|
+
{
|
|
84
|
+
"name": name,
|
|
85
|
+
"workspace_ext_id": workspace_ext_id,
|
|
86
|
+
"parent_ext_id": parent_ext_id,
|
|
87
|
+
"shared": shared,
|
|
88
|
+
},
|
|
89
|
+
tag_create_params.TagCreateParams,
|
|
90
|
+
),
|
|
91
|
+
options=make_request_options(
|
|
92
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
93
|
+
),
|
|
94
|
+
cast_to=TagCreateResponse,
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
def update(
|
|
98
|
+
self,
|
|
99
|
+
tag_ext_id: str,
|
|
100
|
+
*,
|
|
101
|
+
name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
102
|
+
shared: Optional[bool] | NotGiven = NOT_GIVEN,
|
|
103
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
104
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
105
|
+
extra_headers: Headers | None = None,
|
|
106
|
+
extra_query: Query | None = None,
|
|
107
|
+
extra_body: Body | None = None,
|
|
108
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
109
|
+
) -> TagUpdateResponse:
|
|
110
|
+
"""
|
|
111
|
+
Update a tag by its external ID.
|
|
112
|
+
|
|
113
|
+
Args:
|
|
114
|
+
extra_headers: Send extra headers
|
|
115
|
+
|
|
116
|
+
extra_query: Add additional query parameters to the request
|
|
117
|
+
|
|
118
|
+
extra_body: Add additional JSON properties to the request
|
|
119
|
+
|
|
120
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
121
|
+
"""
|
|
122
|
+
if not tag_ext_id:
|
|
123
|
+
raise ValueError(f"Expected a non-empty value for `tag_ext_id` but received {tag_ext_id!r}")
|
|
124
|
+
return self._patch(
|
|
125
|
+
f"/api/tag/{tag_ext_id}",
|
|
126
|
+
body=maybe_transform(
|
|
127
|
+
{
|
|
128
|
+
"name": name,
|
|
129
|
+
"shared": shared,
|
|
130
|
+
},
|
|
131
|
+
tag_update_params.TagUpdateParams,
|
|
132
|
+
),
|
|
133
|
+
options=make_request_options(
|
|
134
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
135
|
+
),
|
|
136
|
+
cast_to=TagUpdateResponse,
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
def delete(
|
|
140
|
+
self,
|
|
141
|
+
tag_ext_id: str,
|
|
142
|
+
*,
|
|
143
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
144
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
145
|
+
extra_headers: Headers | None = None,
|
|
146
|
+
extra_query: Query | None = None,
|
|
147
|
+
extra_body: Body | None = None,
|
|
148
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
149
|
+
) -> TagDeleteResponse:
|
|
150
|
+
"""
|
|
151
|
+
Delete a tag by its external ID.
|
|
152
|
+
|
|
153
|
+
Args:
|
|
154
|
+
extra_headers: Send extra headers
|
|
155
|
+
|
|
156
|
+
extra_query: Add additional query parameters to the request
|
|
157
|
+
|
|
158
|
+
extra_body: Add additional JSON properties to the request
|
|
159
|
+
|
|
160
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
161
|
+
"""
|
|
162
|
+
if not tag_ext_id:
|
|
163
|
+
raise ValueError(f"Expected a non-empty value for `tag_ext_id` but received {tag_ext_id!r}")
|
|
164
|
+
return self._delete(
|
|
165
|
+
f"/api/tag/{tag_ext_id}/delete",
|
|
166
|
+
options=make_request_options(
|
|
167
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
168
|
+
),
|
|
169
|
+
cast_to=TagDeleteResponse,
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
def apply_to_docs(
|
|
173
|
+
self,
|
|
174
|
+
tag_ext_id: str,
|
|
175
|
+
*,
|
|
176
|
+
doc_ids: List[str],
|
|
177
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
178
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
179
|
+
extra_headers: Headers | None = None,
|
|
180
|
+
extra_query: Query | None = None,
|
|
181
|
+
extra_body: Body | None = None,
|
|
182
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
183
|
+
) -> TagApplyToDocsResponse:
|
|
184
|
+
"""
|
|
185
|
+
Apply a tag to a list of documents.
|
|
186
|
+
|
|
187
|
+
Args:
|
|
188
|
+
extra_headers: Send extra headers
|
|
189
|
+
|
|
190
|
+
extra_query: Add additional query parameters to the request
|
|
191
|
+
|
|
192
|
+
extra_body: Add additional JSON properties to the request
|
|
193
|
+
|
|
194
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
195
|
+
"""
|
|
196
|
+
if not tag_ext_id:
|
|
197
|
+
raise ValueError(f"Expected a non-empty value for `tag_ext_id` but received {tag_ext_id!r}")
|
|
198
|
+
return self._post(
|
|
199
|
+
f"/api/tag/{tag_ext_id}/apply",
|
|
200
|
+
body=maybe_transform({"doc_ids": doc_ids}, tag_apply_to_docs_params.TagApplyToDocsParams),
|
|
201
|
+
options=make_request_options(
|
|
202
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
203
|
+
),
|
|
204
|
+
cast_to=TagApplyToDocsResponse,
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
def get_docs(
|
|
208
|
+
self,
|
|
209
|
+
tag_ext_id: str,
|
|
210
|
+
*,
|
|
211
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
212
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
213
|
+
extra_headers: Headers | None = None,
|
|
214
|
+
extra_query: Query | None = None,
|
|
215
|
+
extra_body: Body | None = None,
|
|
216
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
217
|
+
) -> TagGetDocsResponse:
|
|
218
|
+
"""
|
|
219
|
+
Get all doctags for a given tag.
|
|
220
|
+
|
|
221
|
+
Args:
|
|
222
|
+
extra_headers: Send extra headers
|
|
223
|
+
|
|
224
|
+
extra_query: Add additional query parameters to the request
|
|
225
|
+
|
|
226
|
+
extra_body: Add additional JSON properties to the request
|
|
227
|
+
|
|
228
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
229
|
+
"""
|
|
230
|
+
if not tag_ext_id:
|
|
231
|
+
raise ValueError(f"Expected a non-empty value for `tag_ext_id` but received {tag_ext_id!r}")
|
|
232
|
+
return self._get(
|
|
233
|
+
f"/api/tag/{tag_ext_id}/docs",
|
|
234
|
+
options=make_request_options(
|
|
235
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
236
|
+
),
|
|
237
|
+
cast_to=TagGetDocsResponse,
|
|
238
|
+
)
|
|
239
|
+
|
|
240
|
+
def remove_from_docs(
|
|
241
|
+
self,
|
|
242
|
+
tag_ext_id: str,
|
|
243
|
+
*,
|
|
244
|
+
doc_ids: List[str],
|
|
245
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
246
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
247
|
+
extra_headers: Headers | None = None,
|
|
248
|
+
extra_query: Query | None = None,
|
|
249
|
+
extra_body: Body | None = None,
|
|
250
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
251
|
+
) -> TagRemoveFromDocsResponse:
|
|
252
|
+
"""
|
|
253
|
+
Remove a tag from a list of documents.
|
|
254
|
+
|
|
255
|
+
Args:
|
|
256
|
+
extra_headers: Send extra headers
|
|
257
|
+
|
|
258
|
+
extra_query: Add additional query parameters to the request
|
|
259
|
+
|
|
260
|
+
extra_body: Add additional JSON properties to the request
|
|
261
|
+
|
|
262
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
263
|
+
"""
|
|
264
|
+
if not tag_ext_id:
|
|
265
|
+
raise ValueError(f"Expected a non-empty value for `tag_ext_id` but received {tag_ext_id!r}")
|
|
266
|
+
return self._delete(
|
|
267
|
+
f"/api/tag/{tag_ext_id}/remove",
|
|
268
|
+
body=maybe_transform({"doc_ids": doc_ids}, tag_remove_from_docs_params.TagRemoveFromDocsParams),
|
|
269
|
+
options=make_request_options(
|
|
270
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
271
|
+
),
|
|
272
|
+
cast_to=TagRemoveFromDocsResponse,
|
|
273
|
+
)
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
class AsyncTagResource(AsyncAPIResource):
|
|
277
|
+
@cached_property
|
|
278
|
+
def with_raw_response(self) -> AsyncTagResourceWithRawResponse:
|
|
279
|
+
"""
|
|
280
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
281
|
+
the raw response object instead of the parsed content.
|
|
282
|
+
|
|
283
|
+
For more information, see https://www.github.com/arbitrationcity/arbi-python#accessing-raw-response-data-eg-headers
|
|
284
|
+
"""
|
|
285
|
+
return AsyncTagResourceWithRawResponse(self)
|
|
286
|
+
|
|
287
|
+
@cached_property
|
|
288
|
+
def with_streaming_response(self) -> AsyncTagResourceWithStreamingResponse:
|
|
289
|
+
"""
|
|
290
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
291
|
+
|
|
292
|
+
For more information, see https://www.github.com/arbitrationcity/arbi-python#with_streaming_response
|
|
293
|
+
"""
|
|
294
|
+
return AsyncTagResourceWithStreamingResponse(self)
|
|
295
|
+
|
|
296
|
+
async def create(
|
|
297
|
+
self,
|
|
298
|
+
*,
|
|
299
|
+
name: str,
|
|
300
|
+
workspace_ext_id: str,
|
|
301
|
+
parent_ext_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
302
|
+
shared: Optional[bool] | NotGiven = NOT_GIVEN,
|
|
303
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
304
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
305
|
+
extra_headers: Headers | None = None,
|
|
306
|
+
extra_query: Query | None = None,
|
|
307
|
+
extra_body: Body | None = None,
|
|
308
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
309
|
+
) -> TagCreateResponse:
|
|
310
|
+
"""
|
|
311
|
+
Create a new tag for a given workspace.
|
|
312
|
+
|
|
313
|
+
If 'shared' is provided, the tag will be set to shared or private accordingly.
|
|
314
|
+
If 'shared' is not provided, it defaults to True (shared).
|
|
315
|
+
|
|
316
|
+
Args:
|
|
317
|
+
extra_headers: Send extra headers
|
|
318
|
+
|
|
319
|
+
extra_query: Add additional query parameters to the request
|
|
320
|
+
|
|
321
|
+
extra_body: Add additional JSON properties to the request
|
|
322
|
+
|
|
323
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
324
|
+
"""
|
|
325
|
+
return await self._post(
|
|
326
|
+
"/api/tag/create",
|
|
327
|
+
body=await async_maybe_transform(
|
|
328
|
+
{
|
|
329
|
+
"name": name,
|
|
330
|
+
"workspace_ext_id": workspace_ext_id,
|
|
331
|
+
"parent_ext_id": parent_ext_id,
|
|
332
|
+
"shared": shared,
|
|
333
|
+
},
|
|
334
|
+
tag_create_params.TagCreateParams,
|
|
335
|
+
),
|
|
336
|
+
options=make_request_options(
|
|
337
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
338
|
+
),
|
|
339
|
+
cast_to=TagCreateResponse,
|
|
340
|
+
)
|
|
341
|
+
|
|
342
|
+
async def update(
|
|
343
|
+
self,
|
|
344
|
+
tag_ext_id: str,
|
|
345
|
+
*,
|
|
346
|
+
name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
347
|
+
shared: Optional[bool] | NotGiven = NOT_GIVEN,
|
|
348
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
349
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
350
|
+
extra_headers: Headers | None = None,
|
|
351
|
+
extra_query: Query | None = None,
|
|
352
|
+
extra_body: Body | None = None,
|
|
353
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
354
|
+
) -> TagUpdateResponse:
|
|
355
|
+
"""
|
|
356
|
+
Update a tag by its external ID.
|
|
357
|
+
|
|
358
|
+
Args:
|
|
359
|
+
extra_headers: Send extra headers
|
|
360
|
+
|
|
361
|
+
extra_query: Add additional query parameters to the request
|
|
362
|
+
|
|
363
|
+
extra_body: Add additional JSON properties to the request
|
|
364
|
+
|
|
365
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
366
|
+
"""
|
|
367
|
+
if not tag_ext_id:
|
|
368
|
+
raise ValueError(f"Expected a non-empty value for `tag_ext_id` but received {tag_ext_id!r}")
|
|
369
|
+
return await self._patch(
|
|
370
|
+
f"/api/tag/{tag_ext_id}",
|
|
371
|
+
body=await async_maybe_transform(
|
|
372
|
+
{
|
|
373
|
+
"name": name,
|
|
374
|
+
"shared": shared,
|
|
375
|
+
},
|
|
376
|
+
tag_update_params.TagUpdateParams,
|
|
377
|
+
),
|
|
378
|
+
options=make_request_options(
|
|
379
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
380
|
+
),
|
|
381
|
+
cast_to=TagUpdateResponse,
|
|
382
|
+
)
|
|
383
|
+
|
|
384
|
+
async def delete(
|
|
385
|
+
self,
|
|
386
|
+
tag_ext_id: str,
|
|
387
|
+
*,
|
|
388
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
389
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
390
|
+
extra_headers: Headers | None = None,
|
|
391
|
+
extra_query: Query | None = None,
|
|
392
|
+
extra_body: Body | None = None,
|
|
393
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
394
|
+
) -> TagDeleteResponse:
|
|
395
|
+
"""
|
|
396
|
+
Delete a tag by its external ID.
|
|
397
|
+
|
|
398
|
+
Args:
|
|
399
|
+
extra_headers: Send extra headers
|
|
400
|
+
|
|
401
|
+
extra_query: Add additional query parameters to the request
|
|
402
|
+
|
|
403
|
+
extra_body: Add additional JSON properties to the request
|
|
404
|
+
|
|
405
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
406
|
+
"""
|
|
407
|
+
if not tag_ext_id:
|
|
408
|
+
raise ValueError(f"Expected a non-empty value for `tag_ext_id` but received {tag_ext_id!r}")
|
|
409
|
+
return await self._delete(
|
|
410
|
+
f"/api/tag/{tag_ext_id}/delete",
|
|
411
|
+
options=make_request_options(
|
|
412
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
413
|
+
),
|
|
414
|
+
cast_to=TagDeleteResponse,
|
|
415
|
+
)
|
|
416
|
+
|
|
417
|
+
async def apply_to_docs(
|
|
418
|
+
self,
|
|
419
|
+
tag_ext_id: str,
|
|
420
|
+
*,
|
|
421
|
+
doc_ids: List[str],
|
|
422
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
423
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
424
|
+
extra_headers: Headers | None = None,
|
|
425
|
+
extra_query: Query | None = None,
|
|
426
|
+
extra_body: Body | None = None,
|
|
427
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
428
|
+
) -> TagApplyToDocsResponse:
|
|
429
|
+
"""
|
|
430
|
+
Apply a tag to a list of documents.
|
|
431
|
+
|
|
432
|
+
Args:
|
|
433
|
+
extra_headers: Send extra headers
|
|
434
|
+
|
|
435
|
+
extra_query: Add additional query parameters to the request
|
|
436
|
+
|
|
437
|
+
extra_body: Add additional JSON properties to the request
|
|
438
|
+
|
|
439
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
440
|
+
"""
|
|
441
|
+
if not tag_ext_id:
|
|
442
|
+
raise ValueError(f"Expected a non-empty value for `tag_ext_id` but received {tag_ext_id!r}")
|
|
443
|
+
return await self._post(
|
|
444
|
+
f"/api/tag/{tag_ext_id}/apply",
|
|
445
|
+
body=await async_maybe_transform({"doc_ids": doc_ids}, tag_apply_to_docs_params.TagApplyToDocsParams),
|
|
446
|
+
options=make_request_options(
|
|
447
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
448
|
+
),
|
|
449
|
+
cast_to=TagApplyToDocsResponse,
|
|
450
|
+
)
|
|
451
|
+
|
|
452
|
+
async def get_docs(
|
|
453
|
+
self,
|
|
454
|
+
tag_ext_id: str,
|
|
455
|
+
*,
|
|
456
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
457
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
458
|
+
extra_headers: Headers | None = None,
|
|
459
|
+
extra_query: Query | None = None,
|
|
460
|
+
extra_body: Body | None = None,
|
|
461
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
462
|
+
) -> TagGetDocsResponse:
|
|
463
|
+
"""
|
|
464
|
+
Get all doctags for a given tag.
|
|
465
|
+
|
|
466
|
+
Args:
|
|
467
|
+
extra_headers: Send extra headers
|
|
468
|
+
|
|
469
|
+
extra_query: Add additional query parameters to the request
|
|
470
|
+
|
|
471
|
+
extra_body: Add additional JSON properties to the request
|
|
472
|
+
|
|
473
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
474
|
+
"""
|
|
475
|
+
if not tag_ext_id:
|
|
476
|
+
raise ValueError(f"Expected a non-empty value for `tag_ext_id` but received {tag_ext_id!r}")
|
|
477
|
+
return await self._get(
|
|
478
|
+
f"/api/tag/{tag_ext_id}/docs",
|
|
479
|
+
options=make_request_options(
|
|
480
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
481
|
+
),
|
|
482
|
+
cast_to=TagGetDocsResponse,
|
|
483
|
+
)
|
|
484
|
+
|
|
485
|
+
async def remove_from_docs(
|
|
486
|
+
self,
|
|
487
|
+
tag_ext_id: str,
|
|
488
|
+
*,
|
|
489
|
+
doc_ids: List[str],
|
|
490
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
491
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
492
|
+
extra_headers: Headers | None = None,
|
|
493
|
+
extra_query: Query | None = None,
|
|
494
|
+
extra_body: Body | None = None,
|
|
495
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
496
|
+
) -> TagRemoveFromDocsResponse:
|
|
497
|
+
"""
|
|
498
|
+
Remove a tag from a list of documents.
|
|
499
|
+
|
|
500
|
+
Args:
|
|
501
|
+
extra_headers: Send extra headers
|
|
502
|
+
|
|
503
|
+
extra_query: Add additional query parameters to the request
|
|
504
|
+
|
|
505
|
+
extra_body: Add additional JSON properties to the request
|
|
506
|
+
|
|
507
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
508
|
+
"""
|
|
509
|
+
if not tag_ext_id:
|
|
510
|
+
raise ValueError(f"Expected a non-empty value for `tag_ext_id` but received {tag_ext_id!r}")
|
|
511
|
+
return await self._delete(
|
|
512
|
+
f"/api/tag/{tag_ext_id}/remove",
|
|
513
|
+
body=await async_maybe_transform({"doc_ids": doc_ids}, tag_remove_from_docs_params.TagRemoveFromDocsParams),
|
|
514
|
+
options=make_request_options(
|
|
515
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
516
|
+
),
|
|
517
|
+
cast_to=TagRemoveFromDocsResponse,
|
|
518
|
+
)
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
class TagResourceWithRawResponse:
|
|
522
|
+
def __init__(self, tag: TagResource) -> None:
|
|
523
|
+
self._tag = tag
|
|
524
|
+
|
|
525
|
+
self.create = to_raw_response_wrapper(
|
|
526
|
+
tag.create,
|
|
527
|
+
)
|
|
528
|
+
self.update = to_raw_response_wrapper(
|
|
529
|
+
tag.update,
|
|
530
|
+
)
|
|
531
|
+
self.delete = to_raw_response_wrapper(
|
|
532
|
+
tag.delete,
|
|
533
|
+
)
|
|
534
|
+
self.apply_to_docs = to_raw_response_wrapper(
|
|
535
|
+
tag.apply_to_docs,
|
|
536
|
+
)
|
|
537
|
+
self.get_docs = to_raw_response_wrapper(
|
|
538
|
+
tag.get_docs,
|
|
539
|
+
)
|
|
540
|
+
self.remove_from_docs = to_raw_response_wrapper(
|
|
541
|
+
tag.remove_from_docs,
|
|
542
|
+
)
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
class AsyncTagResourceWithRawResponse:
|
|
546
|
+
def __init__(self, tag: AsyncTagResource) -> None:
|
|
547
|
+
self._tag = tag
|
|
548
|
+
|
|
549
|
+
self.create = async_to_raw_response_wrapper(
|
|
550
|
+
tag.create,
|
|
551
|
+
)
|
|
552
|
+
self.update = async_to_raw_response_wrapper(
|
|
553
|
+
tag.update,
|
|
554
|
+
)
|
|
555
|
+
self.delete = async_to_raw_response_wrapper(
|
|
556
|
+
tag.delete,
|
|
557
|
+
)
|
|
558
|
+
self.apply_to_docs = async_to_raw_response_wrapper(
|
|
559
|
+
tag.apply_to_docs,
|
|
560
|
+
)
|
|
561
|
+
self.get_docs = async_to_raw_response_wrapper(
|
|
562
|
+
tag.get_docs,
|
|
563
|
+
)
|
|
564
|
+
self.remove_from_docs = async_to_raw_response_wrapper(
|
|
565
|
+
tag.remove_from_docs,
|
|
566
|
+
)
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
class TagResourceWithStreamingResponse:
|
|
570
|
+
def __init__(self, tag: TagResource) -> None:
|
|
571
|
+
self._tag = tag
|
|
572
|
+
|
|
573
|
+
self.create = to_streamed_response_wrapper(
|
|
574
|
+
tag.create,
|
|
575
|
+
)
|
|
576
|
+
self.update = to_streamed_response_wrapper(
|
|
577
|
+
tag.update,
|
|
578
|
+
)
|
|
579
|
+
self.delete = to_streamed_response_wrapper(
|
|
580
|
+
tag.delete,
|
|
581
|
+
)
|
|
582
|
+
self.apply_to_docs = to_streamed_response_wrapper(
|
|
583
|
+
tag.apply_to_docs,
|
|
584
|
+
)
|
|
585
|
+
self.get_docs = to_streamed_response_wrapper(
|
|
586
|
+
tag.get_docs,
|
|
587
|
+
)
|
|
588
|
+
self.remove_from_docs = to_streamed_response_wrapper(
|
|
589
|
+
tag.remove_from_docs,
|
|
590
|
+
)
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
class AsyncTagResourceWithStreamingResponse:
|
|
594
|
+
def __init__(self, tag: AsyncTagResource) -> None:
|
|
595
|
+
self._tag = tag
|
|
596
|
+
|
|
597
|
+
self.create = async_to_streamed_response_wrapper(
|
|
598
|
+
tag.create,
|
|
599
|
+
)
|
|
600
|
+
self.update = async_to_streamed_response_wrapper(
|
|
601
|
+
tag.update,
|
|
602
|
+
)
|
|
603
|
+
self.delete = async_to_streamed_response_wrapper(
|
|
604
|
+
tag.delete,
|
|
605
|
+
)
|
|
606
|
+
self.apply_to_docs = async_to_streamed_response_wrapper(
|
|
607
|
+
tag.apply_to_docs,
|
|
608
|
+
)
|
|
609
|
+
self.get_docs = async_to_streamed_response_wrapper(
|
|
610
|
+
tag.get_docs,
|
|
611
|
+
)
|
|
612
|
+
self.remove_from_docs = async_to_streamed_response_wrapper(
|
|
613
|
+
tag.remove_from_docs,
|
|
614
|
+
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from .user import (
|
|
4
|
+
UserResource,
|
|
5
|
+
AsyncUserResource,
|
|
6
|
+
UserResourceWithRawResponse,
|
|
7
|
+
AsyncUserResourceWithRawResponse,
|
|
8
|
+
UserResourceWithStreamingResponse,
|
|
9
|
+
AsyncUserResourceWithStreamingResponse,
|
|
10
|
+
)
|
|
11
|
+
from .settings import (
|
|
12
|
+
SettingsResource,
|
|
13
|
+
AsyncSettingsResource,
|
|
14
|
+
SettingsResourceWithRawResponse,
|
|
15
|
+
AsyncSettingsResourceWithRawResponse,
|
|
16
|
+
SettingsResourceWithStreamingResponse,
|
|
17
|
+
AsyncSettingsResourceWithStreamingResponse,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
__all__ = [
|
|
21
|
+
"SettingsResource",
|
|
22
|
+
"AsyncSettingsResource",
|
|
23
|
+
"SettingsResourceWithRawResponse",
|
|
24
|
+
"AsyncSettingsResourceWithRawResponse",
|
|
25
|
+
"SettingsResourceWithStreamingResponse",
|
|
26
|
+
"AsyncSettingsResourceWithStreamingResponse",
|
|
27
|
+
"UserResource",
|
|
28
|
+
"AsyncUserResource",
|
|
29
|
+
"UserResourceWithRawResponse",
|
|
30
|
+
"AsyncUserResourceWithRawResponse",
|
|
31
|
+
"UserResourceWithStreamingResponse",
|
|
32
|
+
"AsyncUserResourceWithStreamingResponse",
|
|
33
|
+
]
|