mixpeek 0.8.41__py3-none-any.whl → 0.10.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.
- mixpeek/__init__.py +93 -1
- mixpeek/_base_client.py +2041 -0
- mixpeek/_client.py +444 -0
- mixpeek/_compat.py +219 -0
- mixpeek/_constants.py +14 -0
- mixpeek/_exceptions.py +108 -0
- mixpeek/_files.py +123 -0
- mixpeek/_models.py +785 -0
- mixpeek/_qs.py +150 -0
- mixpeek/_resource.py +43 -0
- mixpeek/_response.py +824 -0
- mixpeek/_streaming.py +333 -0
- mixpeek/_types.py +217 -0
- mixpeek/_utils/__init__.py +55 -0
- mixpeek/_utils/_logs.py +25 -0
- mixpeek/_utils/_proxy.py +62 -0
- mixpeek/_utils/_reflection.py +42 -0
- mixpeek/_utils/_streams.py +12 -0
- mixpeek/_utils/_sync.py +81 -0
- mixpeek/_utils/_transform.py +382 -0
- mixpeek/_utils/_typing.py +120 -0
- mixpeek/_utils/_utils.py +397 -0
- mixpeek/_version.py +4 -0
- mixpeek/lib/.keep +4 -0
- mixpeek/resources/__init__.py +159 -0
- mixpeek/resources/accounts/__init__.py +33 -0
- mixpeek/resources/accounts/accounts.py +102 -0
- mixpeek/resources/accounts/private.py +232 -0
- mixpeek/resources/agent/__init__.py +33 -0
- mixpeek/resources/agent/agent.py +225 -0
- mixpeek/resources/agent/task.py +189 -0
- mixpeek/resources/collections/__init__.py +33 -0
- mixpeek/resources/collections/collections.py +459 -0
- mixpeek/resources/collections/files.py +679 -0
- mixpeek/resources/describe.py +338 -0
- mixpeek/resources/embed.py +234 -0
- mixpeek/resources/indexes.py +506 -0
- mixpeek/resources/read.py +183 -0
- mixpeek/resources/recognize.py +183 -0
- mixpeek/resources/search.py +542 -0
- mixpeek/resources/tasks.py +294 -0
- mixpeek/resources/transcribe.py +192 -0
- mixpeek/types/__init__.py +19 -0
- mixpeek/types/accounts/__init__.py +6 -0
- mixpeek/types/accounts/private_update_params.py +25 -0
- mixpeek/types/accounts/user.py +32 -0
- mixpeek/types/agent/__init__.py +3 -0
- mixpeek/types/agent_create_params.py +18 -0
- mixpeek/types/agentresponse.py +11 -0
- mixpeek/types/collection_search_params.py +29 -0
- mixpeek/types/collections/__init__.py +9 -0
- mixpeek/types/collections/file_create_params.py +31 -0
- mixpeek/types/collections/file_full_params.py +22 -0
- mixpeek/types/collections/file_update_params.py +18 -0
- mixpeek/types/collections/fileresponse.py +23 -0
- mixpeek/types/collections/groupedfiledata.py +38 -0
- mixpeek/types/describe_upload_params.py +21 -0
- mixpeek/types/describe_url_params.py +20 -0
- mixpeek/types/embed_create_params.py +29 -0
- mixpeek/types/embeddingresponse.py +15 -0
- mixpeek/types/index_face_params.py +23 -0
- mixpeek/types/index_upload_params.py +27 -0
- mixpeek/types/index_url_params.py +159 -0
- mixpeek/types/search_text_params.py +45 -0
- mixpeek/types/search_upload_params.py +25 -0
- mixpeek/types/search_url_params.py +45 -0
- mixpeek/types/taskresponse.py +15 -0
- mixpeek/types/transcribe_url_params.py +18 -0
- mixpeek-0.10.0.dist-info/METADATA +356 -0
- mixpeek-0.10.0.dist-info/RECORD +73 -0
- {mixpeek-0.8.41.dist-info → mixpeek-0.10.0.dist-info}/WHEEL +1 -2
- mixpeek-0.10.0.dist-info/licenses/LICENSE +201 -0
- mixpeek/client.py +0 -27
- mixpeek/endpoints/collections.py +0 -86
- mixpeek/endpoints/embed.py +0 -66
- mixpeek/endpoints/index.py +0 -51
- mixpeek/endpoints/register.py +0 -34
- mixpeek/endpoints/search.py +0 -67
- mixpeek/endpoints/tasks.py +0 -26
- mixpeek/endpoints/tools.py +0 -138
- mixpeek/exceptions.py +0 -13
- mixpeek-0.8.41.dist-info/METADATA +0 -375
- mixpeek-0.8.41.dist-info/RECORD +0 -15
- mixpeek-0.8.41.dist-info/top_level.txt +0 -1
- /mixpeek/{endpoints/__init__.py → py.typed} +0 -0
@@ -0,0 +1,679 @@
|
|
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 Optional
|
6
|
+
from typing_extensions import Literal
|
7
|
+
|
8
|
+
import httpx
|
9
|
+
|
10
|
+
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
11
|
+
from ..._utils import (
|
12
|
+
maybe_transform,
|
13
|
+
strip_not_given,
|
14
|
+
async_maybe_transform,
|
15
|
+
)
|
16
|
+
from ..._compat import cached_property
|
17
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
18
|
+
from ..._response import (
|
19
|
+
to_raw_response_wrapper,
|
20
|
+
to_streamed_response_wrapper,
|
21
|
+
async_to_raw_response_wrapper,
|
22
|
+
async_to_streamed_response_wrapper,
|
23
|
+
)
|
24
|
+
from ..._base_client import make_request_options
|
25
|
+
from ...types.collections import file_full_params, file_create_params, file_update_params
|
26
|
+
from ...types.collections.fileresponse import Fileresponse
|
27
|
+
from ...types.collections.groupedfiledata import Groupedfiledata
|
28
|
+
|
29
|
+
__all__ = ["FilesResource", "AsyncFilesResource"]
|
30
|
+
|
31
|
+
|
32
|
+
class FilesResource(SyncAPIResource):
|
33
|
+
@cached_property
|
34
|
+
def with_raw_response(self) -> FilesResourceWithRawResponse:
|
35
|
+
"""
|
36
|
+
This property can be used as a prefix for any HTTP method call to return the
|
37
|
+
the raw response object instead of the parsed content.
|
38
|
+
|
39
|
+
For more information, see https://www.github.com/mixpeek/python-client#accessing-raw-response-data-eg-headers
|
40
|
+
"""
|
41
|
+
return FilesResourceWithRawResponse(self)
|
42
|
+
|
43
|
+
@cached_property
|
44
|
+
def with_streaming_response(self) -> FilesResourceWithStreamingResponse:
|
45
|
+
"""
|
46
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
47
|
+
|
48
|
+
For more information, see https://www.github.com/mixpeek/python-client#with_streaming_response
|
49
|
+
"""
|
50
|
+
return FilesResourceWithStreamingResponse(self)
|
51
|
+
|
52
|
+
def create(
|
53
|
+
self,
|
54
|
+
*,
|
55
|
+
collection_id: str,
|
56
|
+
filters: Optional[object] | NotGiven = NOT_GIVEN,
|
57
|
+
page: int | NotGiven = NOT_GIVEN,
|
58
|
+
page_size: int | NotGiven = NOT_GIVEN,
|
59
|
+
randomize: bool | NotGiven = NOT_GIVEN,
|
60
|
+
sort_by: Optional[str] | NotGiven = NOT_GIVEN,
|
61
|
+
sort_order: Optional[Literal["asc", "desc"]] | NotGiven = NOT_GIVEN,
|
62
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
63
|
+
index_id: str | NotGiven = NOT_GIVEN,
|
64
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
65
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
66
|
+
extra_headers: Headers | None = None,
|
67
|
+
extra_query: Query | None = None,
|
68
|
+
extra_body: Body | None = None,
|
69
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
70
|
+
) -> object:
|
71
|
+
"""
|
72
|
+
List Files
|
73
|
+
|
74
|
+
Args:
|
75
|
+
index_id: filter by organization
|
76
|
+
|
77
|
+
extra_headers: Send extra headers
|
78
|
+
|
79
|
+
extra_query: Add additional query parameters to the request
|
80
|
+
|
81
|
+
extra_body: Add additional JSON properties to the request
|
82
|
+
|
83
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
84
|
+
"""
|
85
|
+
extra_headers = {
|
86
|
+
**strip_not_given(
|
87
|
+
{
|
88
|
+
"Authorization": authorization,
|
89
|
+
"index-id": index_id,
|
90
|
+
}
|
91
|
+
),
|
92
|
+
**(extra_headers or {}),
|
93
|
+
}
|
94
|
+
return self._post(
|
95
|
+
"/collections/files",
|
96
|
+
body=maybe_transform(
|
97
|
+
{
|
98
|
+
"collection_id": collection_id,
|
99
|
+
"filters": filters,
|
100
|
+
"page": page,
|
101
|
+
"page_size": page_size,
|
102
|
+
"randomize": randomize,
|
103
|
+
"sort_by": sort_by,
|
104
|
+
"sort_order": sort_order,
|
105
|
+
},
|
106
|
+
file_create_params.FileCreateParams,
|
107
|
+
),
|
108
|
+
options=make_request_options(
|
109
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
110
|
+
),
|
111
|
+
cast_to=object,
|
112
|
+
)
|
113
|
+
|
114
|
+
def retrieve(
|
115
|
+
self,
|
116
|
+
file_id: str,
|
117
|
+
*,
|
118
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
119
|
+
index_id: str | NotGiven = NOT_GIVEN,
|
120
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
121
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
122
|
+
extra_headers: Headers | None = None,
|
123
|
+
extra_query: Query | None = None,
|
124
|
+
extra_body: Body | None = None,
|
125
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
126
|
+
) -> Fileresponse:
|
127
|
+
"""
|
128
|
+
Get File By Id
|
129
|
+
|
130
|
+
Args:
|
131
|
+
index_id: filter by organization
|
132
|
+
|
133
|
+
extra_headers: Send extra headers
|
134
|
+
|
135
|
+
extra_query: Add additional query parameters to the request
|
136
|
+
|
137
|
+
extra_body: Add additional JSON properties to the request
|
138
|
+
|
139
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
140
|
+
"""
|
141
|
+
if not file_id:
|
142
|
+
raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
|
143
|
+
extra_headers = {
|
144
|
+
**strip_not_given(
|
145
|
+
{
|
146
|
+
"Authorization": authorization,
|
147
|
+
"index-id": index_id,
|
148
|
+
}
|
149
|
+
),
|
150
|
+
**(extra_headers or {}),
|
151
|
+
}
|
152
|
+
return self._get(
|
153
|
+
f"/collections/file/{file_id}",
|
154
|
+
options=make_request_options(
|
155
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
156
|
+
),
|
157
|
+
cast_to=Fileresponse,
|
158
|
+
)
|
159
|
+
|
160
|
+
def update(
|
161
|
+
self,
|
162
|
+
file_id: str,
|
163
|
+
*,
|
164
|
+
body: object,
|
165
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
166
|
+
index_id: str | NotGiven = NOT_GIVEN,
|
167
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
168
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
169
|
+
extra_headers: Headers | None = None,
|
170
|
+
extra_query: Query | None = None,
|
171
|
+
extra_body: Body | None = None,
|
172
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
173
|
+
) -> Fileresponse:
|
174
|
+
"""
|
175
|
+
Update File By Id
|
176
|
+
|
177
|
+
Args:
|
178
|
+
index_id: filter by organization
|
179
|
+
|
180
|
+
extra_headers: Send extra headers
|
181
|
+
|
182
|
+
extra_query: Add additional query parameters to the request
|
183
|
+
|
184
|
+
extra_body: Add additional JSON properties to the request
|
185
|
+
|
186
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
187
|
+
"""
|
188
|
+
if not file_id:
|
189
|
+
raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
|
190
|
+
extra_headers = {
|
191
|
+
**strip_not_given(
|
192
|
+
{
|
193
|
+
"Authorization": authorization,
|
194
|
+
"index-id": index_id,
|
195
|
+
}
|
196
|
+
),
|
197
|
+
**(extra_headers or {}),
|
198
|
+
}
|
199
|
+
return self._put(
|
200
|
+
f"/collections/file/{file_id}",
|
201
|
+
body=maybe_transform(body, file_update_params.FileUpdateParams),
|
202
|
+
options=make_request_options(
|
203
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
204
|
+
),
|
205
|
+
cast_to=Fileresponse,
|
206
|
+
)
|
207
|
+
|
208
|
+
def delete(
|
209
|
+
self,
|
210
|
+
file_id: str,
|
211
|
+
*,
|
212
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
213
|
+
index_id: str | NotGiven = NOT_GIVEN,
|
214
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
215
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
216
|
+
extra_headers: Headers | None = None,
|
217
|
+
extra_query: Query | None = None,
|
218
|
+
extra_body: Body | None = None,
|
219
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
220
|
+
) -> object:
|
221
|
+
"""
|
222
|
+
Delete File By Id
|
223
|
+
|
224
|
+
Args:
|
225
|
+
index_id: filter by organization
|
226
|
+
|
227
|
+
extra_headers: Send extra headers
|
228
|
+
|
229
|
+
extra_query: Add additional query parameters to the request
|
230
|
+
|
231
|
+
extra_body: Add additional JSON properties to the request
|
232
|
+
|
233
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
234
|
+
"""
|
235
|
+
if not file_id:
|
236
|
+
raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
|
237
|
+
extra_headers = {
|
238
|
+
**strip_not_given(
|
239
|
+
{
|
240
|
+
"Authorization": authorization,
|
241
|
+
"index-id": index_id,
|
242
|
+
}
|
243
|
+
),
|
244
|
+
**(extra_headers or {}),
|
245
|
+
}
|
246
|
+
return self._delete(
|
247
|
+
f"/collections/file/{file_id}",
|
248
|
+
options=make_request_options(
|
249
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
250
|
+
),
|
251
|
+
cast_to=object,
|
252
|
+
)
|
253
|
+
|
254
|
+
def full(
|
255
|
+
self,
|
256
|
+
file_id: str,
|
257
|
+
*,
|
258
|
+
modality: str | NotGiven = NOT_GIVEN,
|
259
|
+
page: int | NotGiven = NOT_GIVEN,
|
260
|
+
page_size: int | NotGiven = NOT_GIVEN,
|
261
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
262
|
+
index_id: str | NotGiven = NOT_GIVEN,
|
263
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
264
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
265
|
+
extra_headers: Headers | None = None,
|
266
|
+
extra_query: Query | None = None,
|
267
|
+
extra_body: Body | None = None,
|
268
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
269
|
+
) -> Groupedfiledata:
|
270
|
+
"""
|
271
|
+
Get File Full
|
272
|
+
|
273
|
+
Args:
|
274
|
+
index_id: filter by organization
|
275
|
+
|
276
|
+
extra_headers: Send extra headers
|
277
|
+
|
278
|
+
extra_query: Add additional query parameters to the request
|
279
|
+
|
280
|
+
extra_body: Add additional JSON properties to the request
|
281
|
+
|
282
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
283
|
+
"""
|
284
|
+
if not file_id:
|
285
|
+
raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
|
286
|
+
extra_headers = {
|
287
|
+
**strip_not_given(
|
288
|
+
{
|
289
|
+
"Authorization": authorization,
|
290
|
+
"index-id": index_id,
|
291
|
+
}
|
292
|
+
),
|
293
|
+
**(extra_headers or {}),
|
294
|
+
}
|
295
|
+
return self._get(
|
296
|
+
f"/collections/file/{file_id}/full",
|
297
|
+
options=make_request_options(
|
298
|
+
extra_headers=extra_headers,
|
299
|
+
extra_query=extra_query,
|
300
|
+
extra_body=extra_body,
|
301
|
+
timeout=timeout,
|
302
|
+
query=maybe_transform(
|
303
|
+
{
|
304
|
+
"modality": modality,
|
305
|
+
"page": page,
|
306
|
+
"page_size": page_size,
|
307
|
+
},
|
308
|
+
file_full_params.FileFullParams,
|
309
|
+
),
|
310
|
+
),
|
311
|
+
cast_to=Groupedfiledata,
|
312
|
+
)
|
313
|
+
|
314
|
+
|
315
|
+
class AsyncFilesResource(AsyncAPIResource):
|
316
|
+
@cached_property
|
317
|
+
def with_raw_response(self) -> AsyncFilesResourceWithRawResponse:
|
318
|
+
"""
|
319
|
+
This property can be used as a prefix for any HTTP method call to return the
|
320
|
+
the raw response object instead of the parsed content.
|
321
|
+
|
322
|
+
For more information, see https://www.github.com/mixpeek/python-client#accessing-raw-response-data-eg-headers
|
323
|
+
"""
|
324
|
+
return AsyncFilesResourceWithRawResponse(self)
|
325
|
+
|
326
|
+
@cached_property
|
327
|
+
def with_streaming_response(self) -> AsyncFilesResourceWithStreamingResponse:
|
328
|
+
"""
|
329
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
330
|
+
|
331
|
+
For more information, see https://www.github.com/mixpeek/python-client#with_streaming_response
|
332
|
+
"""
|
333
|
+
return AsyncFilesResourceWithStreamingResponse(self)
|
334
|
+
|
335
|
+
async def create(
|
336
|
+
self,
|
337
|
+
*,
|
338
|
+
collection_id: str,
|
339
|
+
filters: Optional[object] | NotGiven = NOT_GIVEN,
|
340
|
+
page: int | NotGiven = NOT_GIVEN,
|
341
|
+
page_size: int | NotGiven = NOT_GIVEN,
|
342
|
+
randomize: bool | NotGiven = NOT_GIVEN,
|
343
|
+
sort_by: Optional[str] | NotGiven = NOT_GIVEN,
|
344
|
+
sort_order: Optional[Literal["asc", "desc"]] | NotGiven = NOT_GIVEN,
|
345
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
346
|
+
index_id: str | NotGiven = NOT_GIVEN,
|
347
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
348
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
349
|
+
extra_headers: Headers | None = None,
|
350
|
+
extra_query: Query | None = None,
|
351
|
+
extra_body: Body | None = None,
|
352
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
353
|
+
) -> object:
|
354
|
+
"""
|
355
|
+
List Files
|
356
|
+
|
357
|
+
Args:
|
358
|
+
index_id: filter by organization
|
359
|
+
|
360
|
+
extra_headers: Send extra headers
|
361
|
+
|
362
|
+
extra_query: Add additional query parameters to the request
|
363
|
+
|
364
|
+
extra_body: Add additional JSON properties to the request
|
365
|
+
|
366
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
367
|
+
"""
|
368
|
+
extra_headers = {
|
369
|
+
**strip_not_given(
|
370
|
+
{
|
371
|
+
"Authorization": authorization,
|
372
|
+
"index-id": index_id,
|
373
|
+
}
|
374
|
+
),
|
375
|
+
**(extra_headers or {}),
|
376
|
+
}
|
377
|
+
return await self._post(
|
378
|
+
"/collections/files",
|
379
|
+
body=await async_maybe_transform(
|
380
|
+
{
|
381
|
+
"collection_id": collection_id,
|
382
|
+
"filters": filters,
|
383
|
+
"page": page,
|
384
|
+
"page_size": page_size,
|
385
|
+
"randomize": randomize,
|
386
|
+
"sort_by": sort_by,
|
387
|
+
"sort_order": sort_order,
|
388
|
+
},
|
389
|
+
file_create_params.FileCreateParams,
|
390
|
+
),
|
391
|
+
options=make_request_options(
|
392
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
393
|
+
),
|
394
|
+
cast_to=object,
|
395
|
+
)
|
396
|
+
|
397
|
+
async def retrieve(
|
398
|
+
self,
|
399
|
+
file_id: str,
|
400
|
+
*,
|
401
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
402
|
+
index_id: str | NotGiven = NOT_GIVEN,
|
403
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
404
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
405
|
+
extra_headers: Headers | None = None,
|
406
|
+
extra_query: Query | None = None,
|
407
|
+
extra_body: Body | None = None,
|
408
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
409
|
+
) -> Fileresponse:
|
410
|
+
"""
|
411
|
+
Get File By Id
|
412
|
+
|
413
|
+
Args:
|
414
|
+
index_id: filter by organization
|
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
|
+
if not file_id:
|
425
|
+
raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
|
426
|
+
extra_headers = {
|
427
|
+
**strip_not_given(
|
428
|
+
{
|
429
|
+
"Authorization": authorization,
|
430
|
+
"index-id": index_id,
|
431
|
+
}
|
432
|
+
),
|
433
|
+
**(extra_headers or {}),
|
434
|
+
}
|
435
|
+
return await self._get(
|
436
|
+
f"/collections/file/{file_id}",
|
437
|
+
options=make_request_options(
|
438
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
439
|
+
),
|
440
|
+
cast_to=Fileresponse,
|
441
|
+
)
|
442
|
+
|
443
|
+
async def update(
|
444
|
+
self,
|
445
|
+
file_id: str,
|
446
|
+
*,
|
447
|
+
body: object,
|
448
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
449
|
+
index_id: str | NotGiven = NOT_GIVEN,
|
450
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
451
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
452
|
+
extra_headers: Headers | None = None,
|
453
|
+
extra_query: Query | None = None,
|
454
|
+
extra_body: Body | None = None,
|
455
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
456
|
+
) -> Fileresponse:
|
457
|
+
"""
|
458
|
+
Update File By Id
|
459
|
+
|
460
|
+
Args:
|
461
|
+
index_id: filter by organization
|
462
|
+
|
463
|
+
extra_headers: Send extra headers
|
464
|
+
|
465
|
+
extra_query: Add additional query parameters to the request
|
466
|
+
|
467
|
+
extra_body: Add additional JSON properties to the request
|
468
|
+
|
469
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
470
|
+
"""
|
471
|
+
if not file_id:
|
472
|
+
raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
|
473
|
+
extra_headers = {
|
474
|
+
**strip_not_given(
|
475
|
+
{
|
476
|
+
"Authorization": authorization,
|
477
|
+
"index-id": index_id,
|
478
|
+
}
|
479
|
+
),
|
480
|
+
**(extra_headers or {}),
|
481
|
+
}
|
482
|
+
return await self._put(
|
483
|
+
f"/collections/file/{file_id}",
|
484
|
+
body=await async_maybe_transform(body, file_update_params.FileUpdateParams),
|
485
|
+
options=make_request_options(
|
486
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
487
|
+
),
|
488
|
+
cast_to=Fileresponse,
|
489
|
+
)
|
490
|
+
|
491
|
+
async def delete(
|
492
|
+
self,
|
493
|
+
file_id: str,
|
494
|
+
*,
|
495
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
496
|
+
index_id: str | NotGiven = NOT_GIVEN,
|
497
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
498
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
499
|
+
extra_headers: Headers | None = None,
|
500
|
+
extra_query: Query | None = None,
|
501
|
+
extra_body: Body | None = None,
|
502
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
503
|
+
) -> object:
|
504
|
+
"""
|
505
|
+
Delete File By Id
|
506
|
+
|
507
|
+
Args:
|
508
|
+
index_id: filter by organization
|
509
|
+
|
510
|
+
extra_headers: Send extra headers
|
511
|
+
|
512
|
+
extra_query: Add additional query parameters to the request
|
513
|
+
|
514
|
+
extra_body: Add additional JSON properties to the request
|
515
|
+
|
516
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
517
|
+
"""
|
518
|
+
if not file_id:
|
519
|
+
raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
|
520
|
+
extra_headers = {
|
521
|
+
**strip_not_given(
|
522
|
+
{
|
523
|
+
"Authorization": authorization,
|
524
|
+
"index-id": index_id,
|
525
|
+
}
|
526
|
+
),
|
527
|
+
**(extra_headers or {}),
|
528
|
+
}
|
529
|
+
return await self._delete(
|
530
|
+
f"/collections/file/{file_id}",
|
531
|
+
options=make_request_options(
|
532
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
533
|
+
),
|
534
|
+
cast_to=object,
|
535
|
+
)
|
536
|
+
|
537
|
+
async def full(
|
538
|
+
self,
|
539
|
+
file_id: str,
|
540
|
+
*,
|
541
|
+
modality: str | NotGiven = NOT_GIVEN,
|
542
|
+
page: int | NotGiven = NOT_GIVEN,
|
543
|
+
page_size: int | NotGiven = NOT_GIVEN,
|
544
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
545
|
+
index_id: str | NotGiven = NOT_GIVEN,
|
546
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
547
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
548
|
+
extra_headers: Headers | None = None,
|
549
|
+
extra_query: Query | None = None,
|
550
|
+
extra_body: Body | None = None,
|
551
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
552
|
+
) -> Groupedfiledata:
|
553
|
+
"""
|
554
|
+
Get File Full
|
555
|
+
|
556
|
+
Args:
|
557
|
+
index_id: filter by organization
|
558
|
+
|
559
|
+
extra_headers: Send extra headers
|
560
|
+
|
561
|
+
extra_query: Add additional query parameters to the request
|
562
|
+
|
563
|
+
extra_body: Add additional JSON properties to the request
|
564
|
+
|
565
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
566
|
+
"""
|
567
|
+
if not file_id:
|
568
|
+
raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
|
569
|
+
extra_headers = {
|
570
|
+
**strip_not_given(
|
571
|
+
{
|
572
|
+
"Authorization": authorization,
|
573
|
+
"index-id": index_id,
|
574
|
+
}
|
575
|
+
),
|
576
|
+
**(extra_headers or {}),
|
577
|
+
}
|
578
|
+
return await self._get(
|
579
|
+
f"/collections/file/{file_id}/full",
|
580
|
+
options=make_request_options(
|
581
|
+
extra_headers=extra_headers,
|
582
|
+
extra_query=extra_query,
|
583
|
+
extra_body=extra_body,
|
584
|
+
timeout=timeout,
|
585
|
+
query=await async_maybe_transform(
|
586
|
+
{
|
587
|
+
"modality": modality,
|
588
|
+
"page": page,
|
589
|
+
"page_size": page_size,
|
590
|
+
},
|
591
|
+
file_full_params.FileFullParams,
|
592
|
+
),
|
593
|
+
),
|
594
|
+
cast_to=Groupedfiledata,
|
595
|
+
)
|
596
|
+
|
597
|
+
|
598
|
+
class FilesResourceWithRawResponse:
|
599
|
+
def __init__(self, files: FilesResource) -> None:
|
600
|
+
self._files = files
|
601
|
+
|
602
|
+
self.create = to_raw_response_wrapper(
|
603
|
+
files.create,
|
604
|
+
)
|
605
|
+
self.retrieve = to_raw_response_wrapper(
|
606
|
+
files.retrieve,
|
607
|
+
)
|
608
|
+
self.update = to_raw_response_wrapper(
|
609
|
+
files.update,
|
610
|
+
)
|
611
|
+
self.delete = to_raw_response_wrapper(
|
612
|
+
files.delete,
|
613
|
+
)
|
614
|
+
self.full = to_raw_response_wrapper(
|
615
|
+
files.full,
|
616
|
+
)
|
617
|
+
|
618
|
+
|
619
|
+
class AsyncFilesResourceWithRawResponse:
|
620
|
+
def __init__(self, files: AsyncFilesResource) -> None:
|
621
|
+
self._files = files
|
622
|
+
|
623
|
+
self.create = async_to_raw_response_wrapper(
|
624
|
+
files.create,
|
625
|
+
)
|
626
|
+
self.retrieve = async_to_raw_response_wrapper(
|
627
|
+
files.retrieve,
|
628
|
+
)
|
629
|
+
self.update = async_to_raw_response_wrapper(
|
630
|
+
files.update,
|
631
|
+
)
|
632
|
+
self.delete = async_to_raw_response_wrapper(
|
633
|
+
files.delete,
|
634
|
+
)
|
635
|
+
self.full = async_to_raw_response_wrapper(
|
636
|
+
files.full,
|
637
|
+
)
|
638
|
+
|
639
|
+
|
640
|
+
class FilesResourceWithStreamingResponse:
|
641
|
+
def __init__(self, files: FilesResource) -> None:
|
642
|
+
self._files = files
|
643
|
+
|
644
|
+
self.create = to_streamed_response_wrapper(
|
645
|
+
files.create,
|
646
|
+
)
|
647
|
+
self.retrieve = to_streamed_response_wrapper(
|
648
|
+
files.retrieve,
|
649
|
+
)
|
650
|
+
self.update = to_streamed_response_wrapper(
|
651
|
+
files.update,
|
652
|
+
)
|
653
|
+
self.delete = to_streamed_response_wrapper(
|
654
|
+
files.delete,
|
655
|
+
)
|
656
|
+
self.full = to_streamed_response_wrapper(
|
657
|
+
files.full,
|
658
|
+
)
|
659
|
+
|
660
|
+
|
661
|
+
class AsyncFilesResourceWithStreamingResponse:
|
662
|
+
def __init__(self, files: AsyncFilesResource) -> None:
|
663
|
+
self._files = files
|
664
|
+
|
665
|
+
self.create = async_to_streamed_response_wrapper(
|
666
|
+
files.create,
|
667
|
+
)
|
668
|
+
self.retrieve = async_to_streamed_response_wrapper(
|
669
|
+
files.retrieve,
|
670
|
+
)
|
671
|
+
self.update = async_to_streamed_response_wrapper(
|
672
|
+
files.update,
|
673
|
+
)
|
674
|
+
self.delete = async_to_streamed_response_wrapper(
|
675
|
+
files.delete,
|
676
|
+
)
|
677
|
+
self.full = async_to_streamed_response_wrapper(
|
678
|
+
files.full,
|
679
|
+
)
|