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,506 @@
|
|
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 Mapping, Optional, cast
|
6
|
+
|
7
|
+
import httpx
|
8
|
+
|
9
|
+
from ..types import index_url_params, index_face_params, index_upload_params
|
10
|
+
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes
|
11
|
+
from .._utils import (
|
12
|
+
extract_files,
|
13
|
+
maybe_transform,
|
14
|
+
strip_not_given,
|
15
|
+
deepcopy_minimal,
|
16
|
+
async_maybe_transform,
|
17
|
+
)
|
18
|
+
from .._compat import cached_property
|
19
|
+
from .._resource import SyncAPIResource, AsyncAPIResource
|
20
|
+
from .._response import (
|
21
|
+
to_raw_response_wrapper,
|
22
|
+
to_streamed_response_wrapper,
|
23
|
+
async_to_raw_response_wrapper,
|
24
|
+
async_to_streamed_response_wrapper,
|
25
|
+
)
|
26
|
+
from .._base_client import make_request_options
|
27
|
+
|
28
|
+
__all__ = ["IndexesResource", "AsyncIndexesResource"]
|
29
|
+
|
30
|
+
|
31
|
+
class IndexesResource(SyncAPIResource):
|
32
|
+
@cached_property
|
33
|
+
def with_raw_response(self) -> IndexesResourceWithRawResponse:
|
34
|
+
"""
|
35
|
+
This property can be used as a prefix for any HTTP method call to return the
|
36
|
+
the raw response object instead of the parsed content.
|
37
|
+
|
38
|
+
For more information, see https://www.github.com/mixpeek/python-client#accessing-raw-response-data-eg-headers
|
39
|
+
"""
|
40
|
+
return IndexesResourceWithRawResponse(self)
|
41
|
+
|
42
|
+
@cached_property
|
43
|
+
def with_streaming_response(self) -> IndexesResourceWithStreamingResponse:
|
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/mixpeek/python-client#with_streaming_response
|
48
|
+
"""
|
49
|
+
return IndexesResourceWithStreamingResponse(self)
|
50
|
+
|
51
|
+
def face(
|
52
|
+
self,
|
53
|
+
*,
|
54
|
+
collection_id: str,
|
55
|
+
file: FileTypes,
|
56
|
+
metadata: str | NotGiven = NOT_GIVEN,
|
57
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
58
|
+
index_id: str | NotGiven = NOT_GIVEN,
|
59
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
60
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
61
|
+
extra_headers: Headers | None = None,
|
62
|
+
extra_query: Query | None = None,
|
63
|
+
extra_body: Body | None = None,
|
64
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
65
|
+
) -> object:
|
66
|
+
"""
|
67
|
+
Index Face
|
68
|
+
|
69
|
+
Args:
|
70
|
+
index_id: filter by organization
|
71
|
+
|
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 = {
|
81
|
+
**strip_not_given(
|
82
|
+
{
|
83
|
+
"Authorization": authorization,
|
84
|
+
"index-id": index_id,
|
85
|
+
}
|
86
|
+
),
|
87
|
+
**(extra_headers or {}),
|
88
|
+
}
|
89
|
+
body = deepcopy_minimal(
|
90
|
+
{
|
91
|
+
"collection_id": collection_id,
|
92
|
+
"file": file,
|
93
|
+
"metadata": metadata,
|
94
|
+
}
|
95
|
+
)
|
96
|
+
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
|
97
|
+
# It should be noted that the actual Content-Type header that will be
|
98
|
+
# sent to the server will contain a `boundary` parameter, e.g.
|
99
|
+
# multipart/form-data; boundary=---abc--
|
100
|
+
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
|
101
|
+
return self._post(
|
102
|
+
"/index/face",
|
103
|
+
body=maybe_transform(body, index_face_params.IndexFaceParams),
|
104
|
+
files=files,
|
105
|
+
options=make_request_options(
|
106
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
107
|
+
),
|
108
|
+
cast_to=object,
|
109
|
+
)
|
110
|
+
|
111
|
+
def upload(
|
112
|
+
self,
|
113
|
+
*,
|
114
|
+
collection_id: str,
|
115
|
+
file: FileTypes,
|
116
|
+
image_settings: str | NotGiven = NOT_GIVEN,
|
117
|
+
metadata: str | NotGiven = NOT_GIVEN,
|
118
|
+
video_settings: str | NotGiven = NOT_GIVEN,
|
119
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
120
|
+
index_id: str | NotGiven = NOT_GIVEN,
|
121
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
122
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
123
|
+
extra_headers: Headers | None = None,
|
124
|
+
extra_query: Query | None = None,
|
125
|
+
extra_body: Body | None = None,
|
126
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
127
|
+
) -> object:
|
128
|
+
"""
|
129
|
+
Index Upload
|
130
|
+
|
131
|
+
Args:
|
132
|
+
index_id: filter by organization
|
133
|
+
|
134
|
+
extra_headers: Send extra headers
|
135
|
+
|
136
|
+
extra_query: Add additional query parameters to the request
|
137
|
+
|
138
|
+
extra_body: Add additional JSON properties to the request
|
139
|
+
|
140
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
141
|
+
"""
|
142
|
+
extra_headers = {
|
143
|
+
**strip_not_given(
|
144
|
+
{
|
145
|
+
"Authorization": authorization,
|
146
|
+
"index-id": index_id,
|
147
|
+
}
|
148
|
+
),
|
149
|
+
**(extra_headers or {}),
|
150
|
+
}
|
151
|
+
body = deepcopy_minimal(
|
152
|
+
{
|
153
|
+
"collection_id": collection_id,
|
154
|
+
"file": file,
|
155
|
+
"image_settings": image_settings,
|
156
|
+
"metadata": metadata,
|
157
|
+
"video_settings": video_settings,
|
158
|
+
}
|
159
|
+
)
|
160
|
+
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
|
161
|
+
# It should be noted that the actual Content-Type header that will be
|
162
|
+
# sent to the server will contain a `boundary` parameter, e.g.
|
163
|
+
# multipart/form-data; boundary=---abc--
|
164
|
+
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
|
165
|
+
return self._post(
|
166
|
+
"/index/upload",
|
167
|
+
body=maybe_transform(body, index_upload_params.IndexUploadParams),
|
168
|
+
files=files,
|
169
|
+
options=make_request_options(
|
170
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
171
|
+
),
|
172
|
+
cast_to=object,
|
173
|
+
)
|
174
|
+
|
175
|
+
def url(
|
176
|
+
self,
|
177
|
+
*,
|
178
|
+
collection_id: str,
|
179
|
+
url: str,
|
180
|
+
image_settings: Optional[index_url_params.ImageSettings] | NotGiven = NOT_GIVEN,
|
181
|
+
metadata: object | NotGiven = NOT_GIVEN,
|
182
|
+
should_save: Optional[bool] | NotGiven = NOT_GIVEN,
|
183
|
+
video_settings: Optional[index_url_params.VideoSettings] | NotGiven = NOT_GIVEN,
|
184
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
185
|
+
index_id: str | NotGiven = NOT_GIVEN,
|
186
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
187
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
188
|
+
extra_headers: Headers | None = None,
|
189
|
+
extra_query: Query | None = None,
|
190
|
+
extra_body: Body | None = None,
|
191
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
192
|
+
) -> object:
|
193
|
+
"""
|
194
|
+
Index Url
|
195
|
+
|
196
|
+
Args:
|
197
|
+
metadata: Additional metadata associated with the file
|
198
|
+
|
199
|
+
should_save: Whether to upload the processed file to S3
|
200
|
+
|
201
|
+
index_id: filter by organization
|
202
|
+
|
203
|
+
extra_headers: Send extra headers
|
204
|
+
|
205
|
+
extra_query: Add additional query parameters to the request
|
206
|
+
|
207
|
+
extra_body: Add additional JSON properties to the request
|
208
|
+
|
209
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
210
|
+
"""
|
211
|
+
extra_headers = {
|
212
|
+
**strip_not_given(
|
213
|
+
{
|
214
|
+
"Authorization": authorization,
|
215
|
+
"index-id": index_id,
|
216
|
+
}
|
217
|
+
),
|
218
|
+
**(extra_headers or {}),
|
219
|
+
}
|
220
|
+
return self._post(
|
221
|
+
"/index/url",
|
222
|
+
body=maybe_transform(
|
223
|
+
{
|
224
|
+
"collection_id": collection_id,
|
225
|
+
"url": url,
|
226
|
+
"image_settings": image_settings,
|
227
|
+
"metadata": metadata,
|
228
|
+
"should_save": should_save,
|
229
|
+
"video_settings": video_settings,
|
230
|
+
},
|
231
|
+
index_url_params.IndexURLParams,
|
232
|
+
),
|
233
|
+
options=make_request_options(
|
234
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
235
|
+
),
|
236
|
+
cast_to=object,
|
237
|
+
)
|
238
|
+
|
239
|
+
|
240
|
+
class AsyncIndexesResource(AsyncAPIResource):
|
241
|
+
@cached_property
|
242
|
+
def with_raw_response(self) -> AsyncIndexesResourceWithRawResponse:
|
243
|
+
"""
|
244
|
+
This property can be used as a prefix for any HTTP method call to return the
|
245
|
+
the raw response object instead of the parsed content.
|
246
|
+
|
247
|
+
For more information, see https://www.github.com/mixpeek/python-client#accessing-raw-response-data-eg-headers
|
248
|
+
"""
|
249
|
+
return AsyncIndexesResourceWithRawResponse(self)
|
250
|
+
|
251
|
+
@cached_property
|
252
|
+
def with_streaming_response(self) -> AsyncIndexesResourceWithStreamingResponse:
|
253
|
+
"""
|
254
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
255
|
+
|
256
|
+
For more information, see https://www.github.com/mixpeek/python-client#with_streaming_response
|
257
|
+
"""
|
258
|
+
return AsyncIndexesResourceWithStreamingResponse(self)
|
259
|
+
|
260
|
+
async def face(
|
261
|
+
self,
|
262
|
+
*,
|
263
|
+
collection_id: str,
|
264
|
+
file: FileTypes,
|
265
|
+
metadata: str | NotGiven = NOT_GIVEN,
|
266
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
267
|
+
index_id: str | NotGiven = NOT_GIVEN,
|
268
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
269
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
270
|
+
extra_headers: Headers | None = None,
|
271
|
+
extra_query: Query | None = None,
|
272
|
+
extra_body: Body | None = None,
|
273
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
274
|
+
) -> object:
|
275
|
+
"""
|
276
|
+
Index Face
|
277
|
+
|
278
|
+
Args:
|
279
|
+
index_id: filter by organization
|
280
|
+
|
281
|
+
extra_headers: Send extra headers
|
282
|
+
|
283
|
+
extra_query: Add additional query parameters to the request
|
284
|
+
|
285
|
+
extra_body: Add additional JSON properties to the request
|
286
|
+
|
287
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
288
|
+
"""
|
289
|
+
extra_headers = {
|
290
|
+
**strip_not_given(
|
291
|
+
{
|
292
|
+
"Authorization": authorization,
|
293
|
+
"index-id": index_id,
|
294
|
+
}
|
295
|
+
),
|
296
|
+
**(extra_headers or {}),
|
297
|
+
}
|
298
|
+
body = deepcopy_minimal(
|
299
|
+
{
|
300
|
+
"collection_id": collection_id,
|
301
|
+
"file": file,
|
302
|
+
"metadata": metadata,
|
303
|
+
}
|
304
|
+
)
|
305
|
+
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
|
306
|
+
# It should be noted that the actual Content-Type header that will be
|
307
|
+
# sent to the server will contain a `boundary` parameter, e.g.
|
308
|
+
# multipart/form-data; boundary=---abc--
|
309
|
+
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
|
310
|
+
return await self._post(
|
311
|
+
"/index/face",
|
312
|
+
body=await async_maybe_transform(body, index_face_params.IndexFaceParams),
|
313
|
+
files=files,
|
314
|
+
options=make_request_options(
|
315
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
316
|
+
),
|
317
|
+
cast_to=object,
|
318
|
+
)
|
319
|
+
|
320
|
+
async def upload(
|
321
|
+
self,
|
322
|
+
*,
|
323
|
+
collection_id: str,
|
324
|
+
file: FileTypes,
|
325
|
+
image_settings: str | NotGiven = NOT_GIVEN,
|
326
|
+
metadata: str | NotGiven = NOT_GIVEN,
|
327
|
+
video_settings: str | NotGiven = NOT_GIVEN,
|
328
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
329
|
+
index_id: str | NotGiven = NOT_GIVEN,
|
330
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
331
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
332
|
+
extra_headers: Headers | None = None,
|
333
|
+
extra_query: Query | None = None,
|
334
|
+
extra_body: Body | None = None,
|
335
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
336
|
+
) -> object:
|
337
|
+
"""
|
338
|
+
Index Upload
|
339
|
+
|
340
|
+
Args:
|
341
|
+
index_id: filter by organization
|
342
|
+
|
343
|
+
extra_headers: Send extra headers
|
344
|
+
|
345
|
+
extra_query: Add additional query parameters to the request
|
346
|
+
|
347
|
+
extra_body: Add additional JSON properties to the request
|
348
|
+
|
349
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
350
|
+
"""
|
351
|
+
extra_headers = {
|
352
|
+
**strip_not_given(
|
353
|
+
{
|
354
|
+
"Authorization": authorization,
|
355
|
+
"index-id": index_id,
|
356
|
+
}
|
357
|
+
),
|
358
|
+
**(extra_headers or {}),
|
359
|
+
}
|
360
|
+
body = deepcopy_minimal(
|
361
|
+
{
|
362
|
+
"collection_id": collection_id,
|
363
|
+
"file": file,
|
364
|
+
"image_settings": image_settings,
|
365
|
+
"metadata": metadata,
|
366
|
+
"video_settings": video_settings,
|
367
|
+
}
|
368
|
+
)
|
369
|
+
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
|
370
|
+
# It should be noted that the actual Content-Type header that will be
|
371
|
+
# sent to the server will contain a `boundary` parameter, e.g.
|
372
|
+
# multipart/form-data; boundary=---abc--
|
373
|
+
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
|
374
|
+
return await self._post(
|
375
|
+
"/index/upload",
|
376
|
+
body=await async_maybe_transform(body, index_upload_params.IndexUploadParams),
|
377
|
+
files=files,
|
378
|
+
options=make_request_options(
|
379
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
380
|
+
),
|
381
|
+
cast_to=object,
|
382
|
+
)
|
383
|
+
|
384
|
+
async def url(
|
385
|
+
self,
|
386
|
+
*,
|
387
|
+
collection_id: str,
|
388
|
+
url: str,
|
389
|
+
image_settings: Optional[index_url_params.ImageSettings] | NotGiven = NOT_GIVEN,
|
390
|
+
metadata: object | NotGiven = NOT_GIVEN,
|
391
|
+
should_save: Optional[bool] | NotGiven = NOT_GIVEN,
|
392
|
+
video_settings: Optional[index_url_params.VideoSettings] | NotGiven = NOT_GIVEN,
|
393
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
394
|
+
index_id: str | NotGiven = NOT_GIVEN,
|
395
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
396
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
397
|
+
extra_headers: Headers | None = None,
|
398
|
+
extra_query: Query | None = None,
|
399
|
+
extra_body: Body | None = None,
|
400
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
401
|
+
) -> object:
|
402
|
+
"""
|
403
|
+
Index Url
|
404
|
+
|
405
|
+
Args:
|
406
|
+
metadata: Additional metadata associated with the file
|
407
|
+
|
408
|
+
should_save: Whether to upload the processed file to S3
|
409
|
+
|
410
|
+
index_id: filter by organization
|
411
|
+
|
412
|
+
extra_headers: Send extra headers
|
413
|
+
|
414
|
+
extra_query: Add additional query parameters to the request
|
415
|
+
|
416
|
+
extra_body: Add additional JSON properties to the request
|
417
|
+
|
418
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
419
|
+
"""
|
420
|
+
extra_headers = {
|
421
|
+
**strip_not_given(
|
422
|
+
{
|
423
|
+
"Authorization": authorization,
|
424
|
+
"index-id": index_id,
|
425
|
+
}
|
426
|
+
),
|
427
|
+
**(extra_headers or {}),
|
428
|
+
}
|
429
|
+
return await self._post(
|
430
|
+
"/index/url",
|
431
|
+
body=await async_maybe_transform(
|
432
|
+
{
|
433
|
+
"collection_id": collection_id,
|
434
|
+
"url": url,
|
435
|
+
"image_settings": image_settings,
|
436
|
+
"metadata": metadata,
|
437
|
+
"should_save": should_save,
|
438
|
+
"video_settings": video_settings,
|
439
|
+
},
|
440
|
+
index_url_params.IndexURLParams,
|
441
|
+
),
|
442
|
+
options=make_request_options(
|
443
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
444
|
+
),
|
445
|
+
cast_to=object,
|
446
|
+
)
|
447
|
+
|
448
|
+
|
449
|
+
class IndexesResourceWithRawResponse:
|
450
|
+
def __init__(self, indexes: IndexesResource) -> None:
|
451
|
+
self._indexes = indexes
|
452
|
+
|
453
|
+
self.face = to_raw_response_wrapper(
|
454
|
+
indexes.face,
|
455
|
+
)
|
456
|
+
self.upload = to_raw_response_wrapper(
|
457
|
+
indexes.upload,
|
458
|
+
)
|
459
|
+
self.url = to_raw_response_wrapper(
|
460
|
+
indexes.url,
|
461
|
+
)
|
462
|
+
|
463
|
+
|
464
|
+
class AsyncIndexesResourceWithRawResponse:
|
465
|
+
def __init__(self, indexes: AsyncIndexesResource) -> None:
|
466
|
+
self._indexes = indexes
|
467
|
+
|
468
|
+
self.face = async_to_raw_response_wrapper(
|
469
|
+
indexes.face,
|
470
|
+
)
|
471
|
+
self.upload = async_to_raw_response_wrapper(
|
472
|
+
indexes.upload,
|
473
|
+
)
|
474
|
+
self.url = async_to_raw_response_wrapper(
|
475
|
+
indexes.url,
|
476
|
+
)
|
477
|
+
|
478
|
+
|
479
|
+
class IndexesResourceWithStreamingResponse:
|
480
|
+
def __init__(self, indexes: IndexesResource) -> None:
|
481
|
+
self._indexes = indexes
|
482
|
+
|
483
|
+
self.face = to_streamed_response_wrapper(
|
484
|
+
indexes.face,
|
485
|
+
)
|
486
|
+
self.upload = to_streamed_response_wrapper(
|
487
|
+
indexes.upload,
|
488
|
+
)
|
489
|
+
self.url = to_streamed_response_wrapper(
|
490
|
+
indexes.url,
|
491
|
+
)
|
492
|
+
|
493
|
+
|
494
|
+
class AsyncIndexesResourceWithStreamingResponse:
|
495
|
+
def __init__(self, indexes: AsyncIndexesResource) -> None:
|
496
|
+
self._indexes = indexes
|
497
|
+
|
498
|
+
self.face = async_to_streamed_response_wrapper(
|
499
|
+
indexes.face,
|
500
|
+
)
|
501
|
+
self.upload = async_to_streamed_response_wrapper(
|
502
|
+
indexes.upload,
|
503
|
+
)
|
504
|
+
self.url = async_to_streamed_response_wrapper(
|
505
|
+
indexes.url,
|
506
|
+
)
|
@@ -0,0 +1,183 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
import httpx
|
6
|
+
|
7
|
+
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
8
|
+
from .._utils import strip_not_given
|
9
|
+
from .._compat import cached_property
|
10
|
+
from .._resource import SyncAPIResource, AsyncAPIResource
|
11
|
+
from .._response import (
|
12
|
+
to_raw_response_wrapper,
|
13
|
+
to_streamed_response_wrapper,
|
14
|
+
async_to_raw_response_wrapper,
|
15
|
+
async_to_streamed_response_wrapper,
|
16
|
+
)
|
17
|
+
from .._base_client import make_request_options
|
18
|
+
|
19
|
+
__all__ = ["ReadResource", "AsyncReadResource"]
|
20
|
+
|
21
|
+
|
22
|
+
class ReadResource(SyncAPIResource):
|
23
|
+
@cached_property
|
24
|
+
def with_raw_response(self) -> ReadResourceWithRawResponse:
|
25
|
+
"""
|
26
|
+
This property can be used as a prefix for any HTTP method call to return the
|
27
|
+
the raw response object instead of the parsed content.
|
28
|
+
|
29
|
+
For more information, see https://www.github.com/mixpeek/python-client#accessing-raw-response-data-eg-headers
|
30
|
+
"""
|
31
|
+
return ReadResourceWithRawResponse(self)
|
32
|
+
|
33
|
+
@cached_property
|
34
|
+
def with_streaming_response(self) -> ReadResourceWithStreamingResponse:
|
35
|
+
"""
|
36
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
37
|
+
|
38
|
+
For more information, see https://www.github.com/mixpeek/python-client#with_streaming_response
|
39
|
+
"""
|
40
|
+
return ReadResourceWithStreamingResponse(self)
|
41
|
+
|
42
|
+
def create(
|
43
|
+
self,
|
44
|
+
*,
|
45
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
46
|
+
index_id: str | NotGiven = NOT_GIVEN,
|
47
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
48
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
49
|
+
extra_headers: Headers | None = None,
|
50
|
+
extra_query: Query | None = None,
|
51
|
+
extra_body: Body | None = None,
|
52
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
53
|
+
) -> object:
|
54
|
+
"""
|
55
|
+
Test
|
56
|
+
|
57
|
+
Args:
|
58
|
+
index_id: filter by organization
|
59
|
+
|
60
|
+
extra_headers: Send extra headers
|
61
|
+
|
62
|
+
extra_query: Add additional query parameters to the request
|
63
|
+
|
64
|
+
extra_body: Add additional JSON properties to the request
|
65
|
+
|
66
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
67
|
+
"""
|
68
|
+
extra_headers = {
|
69
|
+
**strip_not_given(
|
70
|
+
{
|
71
|
+
"Authorization": authorization,
|
72
|
+
"index-id": index_id,
|
73
|
+
}
|
74
|
+
),
|
75
|
+
**(extra_headers or {}),
|
76
|
+
}
|
77
|
+
return self._post(
|
78
|
+
"/read/",
|
79
|
+
options=make_request_options(
|
80
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
81
|
+
),
|
82
|
+
cast_to=object,
|
83
|
+
)
|
84
|
+
|
85
|
+
|
86
|
+
class AsyncReadResource(AsyncAPIResource):
|
87
|
+
@cached_property
|
88
|
+
def with_raw_response(self) -> AsyncReadResourceWithRawResponse:
|
89
|
+
"""
|
90
|
+
This property can be used as a prefix for any HTTP method call to return the
|
91
|
+
the raw response object instead of the parsed content.
|
92
|
+
|
93
|
+
For more information, see https://www.github.com/mixpeek/python-client#accessing-raw-response-data-eg-headers
|
94
|
+
"""
|
95
|
+
return AsyncReadResourceWithRawResponse(self)
|
96
|
+
|
97
|
+
@cached_property
|
98
|
+
def with_streaming_response(self) -> AsyncReadResourceWithStreamingResponse:
|
99
|
+
"""
|
100
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
101
|
+
|
102
|
+
For more information, see https://www.github.com/mixpeek/python-client#with_streaming_response
|
103
|
+
"""
|
104
|
+
return AsyncReadResourceWithStreamingResponse(self)
|
105
|
+
|
106
|
+
async def create(
|
107
|
+
self,
|
108
|
+
*,
|
109
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
110
|
+
index_id: str | NotGiven = NOT_GIVEN,
|
111
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
112
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
113
|
+
extra_headers: Headers | None = None,
|
114
|
+
extra_query: Query | None = None,
|
115
|
+
extra_body: Body | None = None,
|
116
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
117
|
+
) -> object:
|
118
|
+
"""
|
119
|
+
Test
|
120
|
+
|
121
|
+
Args:
|
122
|
+
index_id: filter by organization
|
123
|
+
|
124
|
+
extra_headers: Send extra headers
|
125
|
+
|
126
|
+
extra_query: Add additional query parameters to the request
|
127
|
+
|
128
|
+
extra_body: Add additional JSON properties to the request
|
129
|
+
|
130
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
131
|
+
"""
|
132
|
+
extra_headers = {
|
133
|
+
**strip_not_given(
|
134
|
+
{
|
135
|
+
"Authorization": authorization,
|
136
|
+
"index-id": index_id,
|
137
|
+
}
|
138
|
+
),
|
139
|
+
**(extra_headers or {}),
|
140
|
+
}
|
141
|
+
return await self._post(
|
142
|
+
"/read/",
|
143
|
+
options=make_request_options(
|
144
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
145
|
+
),
|
146
|
+
cast_to=object,
|
147
|
+
)
|
148
|
+
|
149
|
+
|
150
|
+
class ReadResourceWithRawResponse:
|
151
|
+
def __init__(self, read: ReadResource) -> None:
|
152
|
+
self._read = read
|
153
|
+
|
154
|
+
self.create = to_raw_response_wrapper(
|
155
|
+
read.create,
|
156
|
+
)
|
157
|
+
|
158
|
+
|
159
|
+
class AsyncReadResourceWithRawResponse:
|
160
|
+
def __init__(self, read: AsyncReadResource) -> None:
|
161
|
+
self._read = read
|
162
|
+
|
163
|
+
self.create = async_to_raw_response_wrapper(
|
164
|
+
read.create,
|
165
|
+
)
|
166
|
+
|
167
|
+
|
168
|
+
class ReadResourceWithStreamingResponse:
|
169
|
+
def __init__(self, read: ReadResource) -> None:
|
170
|
+
self._read = read
|
171
|
+
|
172
|
+
self.create = to_streamed_response_wrapper(
|
173
|
+
read.create,
|
174
|
+
)
|
175
|
+
|
176
|
+
|
177
|
+
class AsyncReadResourceWithStreamingResponse:
|
178
|
+
def __init__(self, read: AsyncReadResource) -> None:
|
179
|
+
self._read = read
|
180
|
+
|
181
|
+
self.create = async_to_streamed_response_wrapper(
|
182
|
+
read.create,
|
183
|
+
)
|