mixpeek 0.8.41__py3-none-any.whl → 0.9.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-0.9.0.dist-info/METADATA +356 -0
- mixpeek-0.9.0.dist-info/RECORD +73 -0
- {mixpeek-0.8.41.dist-info → mixpeek-0.9.0.dist-info}/WHEEL +1 -2
- mixpeek-0.9.0.dist-info/licenses/LICENSE +201 -0
- mixpeek_sdk/__init__.py +93 -0
- mixpeek_sdk/_base_client.py +2041 -0
- mixpeek_sdk/_client.py +444 -0
- mixpeek_sdk/_compat.py +219 -0
- mixpeek_sdk/_constants.py +14 -0
- mixpeek_sdk/_exceptions.py +108 -0
- mixpeek_sdk/_files.py +123 -0
- mixpeek_sdk/_models.py +785 -0
- mixpeek_sdk/_qs.py +150 -0
- mixpeek_sdk/_resource.py +43 -0
- mixpeek_sdk/_response.py +826 -0
- mixpeek_sdk/_streaming.py +333 -0
- mixpeek_sdk/_types.py +217 -0
- mixpeek_sdk/_utils/__init__.py +55 -0
- mixpeek_sdk/_utils/_logs.py +25 -0
- mixpeek_sdk/_utils/_proxy.py +62 -0
- mixpeek_sdk/_utils/_reflection.py +42 -0
- mixpeek_sdk/_utils/_streams.py +12 -0
- mixpeek_sdk/_utils/_sync.py +81 -0
- mixpeek_sdk/_utils/_transform.py +382 -0
- mixpeek_sdk/_utils/_typing.py +120 -0
- mixpeek_sdk/_utils/_utils.py +397 -0
- mixpeek_sdk/_version.py +4 -0
- mixpeek_sdk/lib/.keep +4 -0
- mixpeek_sdk/resources/__init__.py +159 -0
- mixpeek_sdk/resources/accounts/__init__.py +33 -0
- mixpeek_sdk/resources/accounts/accounts.py +102 -0
- mixpeek_sdk/resources/accounts/private.py +232 -0
- mixpeek_sdk/resources/agent/__init__.py +33 -0
- mixpeek_sdk/resources/agent/agent.py +225 -0
- mixpeek_sdk/resources/agent/task.py +189 -0
- mixpeek_sdk/resources/collections/__init__.py +33 -0
- mixpeek_sdk/resources/collections/collections.py +459 -0
- mixpeek_sdk/resources/collections/files.py +679 -0
- mixpeek_sdk/resources/describe.py +338 -0
- mixpeek_sdk/resources/embed.py +234 -0
- mixpeek_sdk/resources/indexes.py +506 -0
- mixpeek_sdk/resources/read.py +183 -0
- mixpeek_sdk/resources/recognize.py +183 -0
- mixpeek_sdk/resources/search.py +542 -0
- mixpeek_sdk/resources/tasks.py +294 -0
- mixpeek_sdk/resources/transcribe.py +192 -0
- mixpeek_sdk/types/__init__.py +19 -0
- mixpeek_sdk/types/accounts/__init__.py +6 -0
- mixpeek_sdk/types/accounts/private_update_params.py +25 -0
- mixpeek_sdk/types/accounts/user.py +32 -0
- mixpeek_sdk/types/agent/__init__.py +3 -0
- mixpeek_sdk/types/agent_create_params.py +18 -0
- mixpeek_sdk/types/agentresponse.py +11 -0
- mixpeek_sdk/types/collection_search_params.py +29 -0
- mixpeek_sdk/types/collections/__init__.py +9 -0
- mixpeek_sdk/types/collections/file_create_params.py +31 -0
- mixpeek_sdk/types/collections/file_full_params.py +22 -0
- mixpeek_sdk/types/collections/file_update_params.py +18 -0
- mixpeek_sdk/types/collections/fileresponse.py +23 -0
- mixpeek_sdk/types/collections/groupedfiledata.py +38 -0
- mixpeek_sdk/types/describe_upload_params.py +21 -0
- mixpeek_sdk/types/describe_url_params.py +20 -0
- mixpeek_sdk/types/embed_create_params.py +29 -0
- mixpeek_sdk/types/embeddingresponse.py +15 -0
- mixpeek_sdk/types/index_face_params.py +23 -0
- mixpeek_sdk/types/index_upload_params.py +27 -0
- mixpeek_sdk/types/index_url_params.py +159 -0
- mixpeek_sdk/types/search_text_params.py +45 -0
- mixpeek_sdk/types/search_upload_params.py +25 -0
- mixpeek_sdk/types/search_url_params.py +45 -0
- mixpeek_sdk/types/taskresponse.py +15 -0
- mixpeek_sdk/types/transcribe_url_params.py +18 -0
- mixpeek/__init__.py +0 -1
- 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 → /mixpeek_sdk/py.typed +0 -0
@@ -0,0 +1,542 @@
|
|
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 search_url_params, search_text_params, search_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__ = ["SearchResource", "AsyncSearchResource"]
|
29
|
+
|
30
|
+
|
31
|
+
class SearchResource(SyncAPIResource):
|
32
|
+
@cached_property
|
33
|
+
def with_raw_response(self) -> SearchResourceWithRawResponse:
|
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 SearchResourceWithRawResponse(self)
|
41
|
+
|
42
|
+
@cached_property
|
43
|
+
def with_streaming_response(self) -> SearchResourceWithStreamingResponse:
|
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 SearchResourceWithStreamingResponse(self)
|
50
|
+
|
51
|
+
def text(
|
52
|
+
self,
|
53
|
+
*,
|
54
|
+
input: str,
|
55
|
+
filters: object | NotGiven = NOT_GIVEN,
|
56
|
+
group_by_file: bool | NotGiven = NOT_GIVEN,
|
57
|
+
input_type: Optional[str] | NotGiven = NOT_GIVEN,
|
58
|
+
modality: Optional[str] | NotGiven = NOT_GIVEN,
|
59
|
+
model_id: Optional[str] | NotGiven = NOT_GIVEN,
|
60
|
+
pagination: search_text_params.Pagination | NotGiven = NOT_GIVEN,
|
61
|
+
source: Optional[str] | 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
|
+
Search
|
73
|
+
|
74
|
+
Args:
|
75
|
+
input: url, text, or base64 input
|
76
|
+
|
77
|
+
filters: Additional filters for the search
|
78
|
+
|
79
|
+
group_by_file: Whether to group search results by file
|
80
|
+
|
81
|
+
pagination: Pagination parameters
|
82
|
+
|
83
|
+
index_id: filter by organization
|
84
|
+
|
85
|
+
extra_headers: Send extra headers
|
86
|
+
|
87
|
+
extra_query: Add additional query parameters to the request
|
88
|
+
|
89
|
+
extra_body: Add additional JSON properties to the request
|
90
|
+
|
91
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
92
|
+
"""
|
93
|
+
extra_headers = {
|
94
|
+
**strip_not_given(
|
95
|
+
{
|
96
|
+
"Authorization": authorization,
|
97
|
+
"index-id": index_id,
|
98
|
+
}
|
99
|
+
),
|
100
|
+
**(extra_headers or {}),
|
101
|
+
}
|
102
|
+
return self._post(
|
103
|
+
"/search/text",
|
104
|
+
body=maybe_transform(
|
105
|
+
{
|
106
|
+
"input": input,
|
107
|
+
"filters": filters,
|
108
|
+
"group_by_file": group_by_file,
|
109
|
+
"input_type": input_type,
|
110
|
+
"modality": modality,
|
111
|
+
"model_id": model_id,
|
112
|
+
"pagination": pagination,
|
113
|
+
"source": source,
|
114
|
+
},
|
115
|
+
search_text_params.SearchTextParams,
|
116
|
+
),
|
117
|
+
options=make_request_options(
|
118
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
119
|
+
),
|
120
|
+
cast_to=object,
|
121
|
+
)
|
122
|
+
|
123
|
+
def upload(
|
124
|
+
self,
|
125
|
+
*,
|
126
|
+
file: FileTypes,
|
127
|
+
filters: str | NotGiven = NOT_GIVEN,
|
128
|
+
page: int | NotGiven = NOT_GIVEN,
|
129
|
+
page_size: int | NotGiven = NOT_GIVEN,
|
130
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
131
|
+
index_id: str | NotGiven = NOT_GIVEN,
|
132
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
133
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
134
|
+
extra_headers: Headers | None = None,
|
135
|
+
extra_query: Query | None = None,
|
136
|
+
extra_body: Body | None = None,
|
137
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
138
|
+
) -> object:
|
139
|
+
"""
|
140
|
+
Search Video
|
141
|
+
|
142
|
+
Args:
|
143
|
+
index_id: filter by organization
|
144
|
+
|
145
|
+
extra_headers: Send extra headers
|
146
|
+
|
147
|
+
extra_query: Add additional query parameters to the request
|
148
|
+
|
149
|
+
extra_body: Add additional JSON properties to the request
|
150
|
+
|
151
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
152
|
+
"""
|
153
|
+
extra_headers = {
|
154
|
+
**strip_not_given(
|
155
|
+
{
|
156
|
+
"Authorization": authorization,
|
157
|
+
"index-id": index_id,
|
158
|
+
}
|
159
|
+
),
|
160
|
+
**(extra_headers or {}),
|
161
|
+
}
|
162
|
+
body = deepcopy_minimal(
|
163
|
+
{
|
164
|
+
"file": file,
|
165
|
+
"filters": filters,
|
166
|
+
"page": page,
|
167
|
+
"page_size": page_size,
|
168
|
+
}
|
169
|
+
)
|
170
|
+
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
|
171
|
+
# It should be noted that the actual Content-Type header that will be
|
172
|
+
# sent to the server will contain a `boundary` parameter, e.g.
|
173
|
+
# multipart/form-data; boundary=---abc--
|
174
|
+
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
|
175
|
+
return self._post(
|
176
|
+
"/search/upload",
|
177
|
+
body=maybe_transform(body, search_upload_params.SearchUploadParams),
|
178
|
+
files=files,
|
179
|
+
options=make_request_options(
|
180
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
181
|
+
),
|
182
|
+
cast_to=object,
|
183
|
+
)
|
184
|
+
|
185
|
+
def url(
|
186
|
+
self,
|
187
|
+
*,
|
188
|
+
input: str,
|
189
|
+
filters: object | NotGiven = NOT_GIVEN,
|
190
|
+
group_by_file: bool | NotGiven = NOT_GIVEN,
|
191
|
+
input_type: Optional[str] | NotGiven = NOT_GIVEN,
|
192
|
+
modality: Optional[str] | NotGiven = NOT_GIVEN,
|
193
|
+
model_id: Optional[str] | NotGiven = NOT_GIVEN,
|
194
|
+
pagination: search_url_params.Pagination | NotGiven = NOT_GIVEN,
|
195
|
+
source: Optional[str] | NotGiven = NOT_GIVEN,
|
196
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
197
|
+
index_id: str | NotGiven = NOT_GIVEN,
|
198
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
199
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
200
|
+
extra_headers: Headers | None = None,
|
201
|
+
extra_query: Query | None = None,
|
202
|
+
extra_body: Body | None = None,
|
203
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
204
|
+
) -> object:
|
205
|
+
"""
|
206
|
+
Search Url
|
207
|
+
|
208
|
+
Args:
|
209
|
+
input: url, text, or base64 input
|
210
|
+
|
211
|
+
filters: Additional filters for the search
|
212
|
+
|
213
|
+
group_by_file: Whether to group search results by file
|
214
|
+
|
215
|
+
pagination: Pagination parameters
|
216
|
+
|
217
|
+
index_id: filter by organization
|
218
|
+
|
219
|
+
extra_headers: Send extra headers
|
220
|
+
|
221
|
+
extra_query: Add additional query parameters to the request
|
222
|
+
|
223
|
+
extra_body: Add additional JSON properties to the request
|
224
|
+
|
225
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
226
|
+
"""
|
227
|
+
extra_headers = {
|
228
|
+
**strip_not_given(
|
229
|
+
{
|
230
|
+
"Authorization": authorization,
|
231
|
+
"index-id": index_id,
|
232
|
+
}
|
233
|
+
),
|
234
|
+
**(extra_headers or {}),
|
235
|
+
}
|
236
|
+
return self._post(
|
237
|
+
"/search/url",
|
238
|
+
body=maybe_transform(
|
239
|
+
{
|
240
|
+
"input": input,
|
241
|
+
"filters": filters,
|
242
|
+
"group_by_file": group_by_file,
|
243
|
+
"input_type": input_type,
|
244
|
+
"modality": modality,
|
245
|
+
"model_id": model_id,
|
246
|
+
"pagination": pagination,
|
247
|
+
"source": source,
|
248
|
+
},
|
249
|
+
search_url_params.SearchURLParams,
|
250
|
+
),
|
251
|
+
options=make_request_options(
|
252
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
253
|
+
),
|
254
|
+
cast_to=object,
|
255
|
+
)
|
256
|
+
|
257
|
+
|
258
|
+
class AsyncSearchResource(AsyncAPIResource):
|
259
|
+
@cached_property
|
260
|
+
def with_raw_response(self) -> AsyncSearchResourceWithRawResponse:
|
261
|
+
"""
|
262
|
+
This property can be used as a prefix for any HTTP method call to return the
|
263
|
+
the raw response object instead of the parsed content.
|
264
|
+
|
265
|
+
For more information, see https://www.github.com/mixpeek/python-client#accessing-raw-response-data-eg-headers
|
266
|
+
"""
|
267
|
+
return AsyncSearchResourceWithRawResponse(self)
|
268
|
+
|
269
|
+
@cached_property
|
270
|
+
def with_streaming_response(self) -> AsyncSearchResourceWithStreamingResponse:
|
271
|
+
"""
|
272
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
273
|
+
|
274
|
+
For more information, see https://www.github.com/mixpeek/python-client#with_streaming_response
|
275
|
+
"""
|
276
|
+
return AsyncSearchResourceWithStreamingResponse(self)
|
277
|
+
|
278
|
+
async def text(
|
279
|
+
self,
|
280
|
+
*,
|
281
|
+
input: str,
|
282
|
+
filters: object | NotGiven = NOT_GIVEN,
|
283
|
+
group_by_file: bool | NotGiven = NOT_GIVEN,
|
284
|
+
input_type: Optional[str] | NotGiven = NOT_GIVEN,
|
285
|
+
modality: Optional[str] | NotGiven = NOT_GIVEN,
|
286
|
+
model_id: Optional[str] | NotGiven = NOT_GIVEN,
|
287
|
+
pagination: search_text_params.Pagination | NotGiven = NOT_GIVEN,
|
288
|
+
source: Optional[str] | NotGiven = NOT_GIVEN,
|
289
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
290
|
+
index_id: str | NotGiven = NOT_GIVEN,
|
291
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
292
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
293
|
+
extra_headers: Headers | None = None,
|
294
|
+
extra_query: Query | None = None,
|
295
|
+
extra_body: Body | None = None,
|
296
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
297
|
+
) -> object:
|
298
|
+
"""
|
299
|
+
Search
|
300
|
+
|
301
|
+
Args:
|
302
|
+
input: url, text, or base64 input
|
303
|
+
|
304
|
+
filters: Additional filters for the search
|
305
|
+
|
306
|
+
group_by_file: Whether to group search results by file
|
307
|
+
|
308
|
+
pagination: Pagination parameters
|
309
|
+
|
310
|
+
index_id: filter by organization
|
311
|
+
|
312
|
+
extra_headers: Send extra headers
|
313
|
+
|
314
|
+
extra_query: Add additional query parameters to the request
|
315
|
+
|
316
|
+
extra_body: Add additional JSON properties to the request
|
317
|
+
|
318
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
319
|
+
"""
|
320
|
+
extra_headers = {
|
321
|
+
**strip_not_given(
|
322
|
+
{
|
323
|
+
"Authorization": authorization,
|
324
|
+
"index-id": index_id,
|
325
|
+
}
|
326
|
+
),
|
327
|
+
**(extra_headers or {}),
|
328
|
+
}
|
329
|
+
return await self._post(
|
330
|
+
"/search/text",
|
331
|
+
body=await async_maybe_transform(
|
332
|
+
{
|
333
|
+
"input": input,
|
334
|
+
"filters": filters,
|
335
|
+
"group_by_file": group_by_file,
|
336
|
+
"input_type": input_type,
|
337
|
+
"modality": modality,
|
338
|
+
"model_id": model_id,
|
339
|
+
"pagination": pagination,
|
340
|
+
"source": source,
|
341
|
+
},
|
342
|
+
search_text_params.SearchTextParams,
|
343
|
+
),
|
344
|
+
options=make_request_options(
|
345
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
346
|
+
),
|
347
|
+
cast_to=object,
|
348
|
+
)
|
349
|
+
|
350
|
+
async def upload(
|
351
|
+
self,
|
352
|
+
*,
|
353
|
+
file: FileTypes,
|
354
|
+
filters: str | NotGiven = NOT_GIVEN,
|
355
|
+
page: int | NotGiven = NOT_GIVEN,
|
356
|
+
page_size: int | NotGiven = NOT_GIVEN,
|
357
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
358
|
+
index_id: str | NotGiven = NOT_GIVEN,
|
359
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
360
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
361
|
+
extra_headers: Headers | None = None,
|
362
|
+
extra_query: Query | None = None,
|
363
|
+
extra_body: Body | None = None,
|
364
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
365
|
+
) -> object:
|
366
|
+
"""
|
367
|
+
Search Video
|
368
|
+
|
369
|
+
Args:
|
370
|
+
index_id: filter by organization
|
371
|
+
|
372
|
+
extra_headers: Send extra headers
|
373
|
+
|
374
|
+
extra_query: Add additional query parameters to the request
|
375
|
+
|
376
|
+
extra_body: Add additional JSON properties to the request
|
377
|
+
|
378
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
379
|
+
"""
|
380
|
+
extra_headers = {
|
381
|
+
**strip_not_given(
|
382
|
+
{
|
383
|
+
"Authorization": authorization,
|
384
|
+
"index-id": index_id,
|
385
|
+
}
|
386
|
+
),
|
387
|
+
**(extra_headers or {}),
|
388
|
+
}
|
389
|
+
body = deepcopy_minimal(
|
390
|
+
{
|
391
|
+
"file": file,
|
392
|
+
"filters": filters,
|
393
|
+
"page": page,
|
394
|
+
"page_size": page_size,
|
395
|
+
}
|
396
|
+
)
|
397
|
+
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
|
398
|
+
# It should be noted that the actual Content-Type header that will be
|
399
|
+
# sent to the server will contain a `boundary` parameter, e.g.
|
400
|
+
# multipart/form-data; boundary=---abc--
|
401
|
+
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
|
402
|
+
return await self._post(
|
403
|
+
"/search/upload",
|
404
|
+
body=await async_maybe_transform(body, search_upload_params.SearchUploadParams),
|
405
|
+
files=files,
|
406
|
+
options=make_request_options(
|
407
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
408
|
+
),
|
409
|
+
cast_to=object,
|
410
|
+
)
|
411
|
+
|
412
|
+
async def url(
|
413
|
+
self,
|
414
|
+
*,
|
415
|
+
input: str,
|
416
|
+
filters: object | NotGiven = NOT_GIVEN,
|
417
|
+
group_by_file: bool | NotGiven = NOT_GIVEN,
|
418
|
+
input_type: Optional[str] | NotGiven = NOT_GIVEN,
|
419
|
+
modality: Optional[str] | NotGiven = NOT_GIVEN,
|
420
|
+
model_id: Optional[str] | NotGiven = NOT_GIVEN,
|
421
|
+
pagination: search_url_params.Pagination | NotGiven = NOT_GIVEN,
|
422
|
+
source: Optional[str] | NotGiven = NOT_GIVEN,
|
423
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
424
|
+
index_id: str | NotGiven = NOT_GIVEN,
|
425
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
426
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
427
|
+
extra_headers: Headers | None = None,
|
428
|
+
extra_query: Query | None = None,
|
429
|
+
extra_body: Body | None = None,
|
430
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
431
|
+
) -> object:
|
432
|
+
"""
|
433
|
+
Search Url
|
434
|
+
|
435
|
+
Args:
|
436
|
+
input: url, text, or base64 input
|
437
|
+
|
438
|
+
filters: Additional filters for the search
|
439
|
+
|
440
|
+
group_by_file: Whether to group search results by file
|
441
|
+
|
442
|
+
pagination: Pagination parameters
|
443
|
+
|
444
|
+
index_id: filter by organization
|
445
|
+
|
446
|
+
extra_headers: Send extra headers
|
447
|
+
|
448
|
+
extra_query: Add additional query parameters to the request
|
449
|
+
|
450
|
+
extra_body: Add additional JSON properties to the request
|
451
|
+
|
452
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
453
|
+
"""
|
454
|
+
extra_headers = {
|
455
|
+
**strip_not_given(
|
456
|
+
{
|
457
|
+
"Authorization": authorization,
|
458
|
+
"index-id": index_id,
|
459
|
+
}
|
460
|
+
),
|
461
|
+
**(extra_headers or {}),
|
462
|
+
}
|
463
|
+
return await self._post(
|
464
|
+
"/search/url",
|
465
|
+
body=await async_maybe_transform(
|
466
|
+
{
|
467
|
+
"input": input,
|
468
|
+
"filters": filters,
|
469
|
+
"group_by_file": group_by_file,
|
470
|
+
"input_type": input_type,
|
471
|
+
"modality": modality,
|
472
|
+
"model_id": model_id,
|
473
|
+
"pagination": pagination,
|
474
|
+
"source": source,
|
475
|
+
},
|
476
|
+
search_url_params.SearchURLParams,
|
477
|
+
),
|
478
|
+
options=make_request_options(
|
479
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
480
|
+
),
|
481
|
+
cast_to=object,
|
482
|
+
)
|
483
|
+
|
484
|
+
|
485
|
+
class SearchResourceWithRawResponse:
|
486
|
+
def __init__(self, search: SearchResource) -> None:
|
487
|
+
self._search = search
|
488
|
+
|
489
|
+
self.text = to_raw_response_wrapper(
|
490
|
+
search.text,
|
491
|
+
)
|
492
|
+
self.upload = to_raw_response_wrapper(
|
493
|
+
search.upload,
|
494
|
+
)
|
495
|
+
self.url = to_raw_response_wrapper(
|
496
|
+
search.url,
|
497
|
+
)
|
498
|
+
|
499
|
+
|
500
|
+
class AsyncSearchResourceWithRawResponse:
|
501
|
+
def __init__(self, search: AsyncSearchResource) -> None:
|
502
|
+
self._search = search
|
503
|
+
|
504
|
+
self.text = async_to_raw_response_wrapper(
|
505
|
+
search.text,
|
506
|
+
)
|
507
|
+
self.upload = async_to_raw_response_wrapper(
|
508
|
+
search.upload,
|
509
|
+
)
|
510
|
+
self.url = async_to_raw_response_wrapper(
|
511
|
+
search.url,
|
512
|
+
)
|
513
|
+
|
514
|
+
|
515
|
+
class SearchResourceWithStreamingResponse:
|
516
|
+
def __init__(self, search: SearchResource) -> None:
|
517
|
+
self._search = search
|
518
|
+
|
519
|
+
self.text = to_streamed_response_wrapper(
|
520
|
+
search.text,
|
521
|
+
)
|
522
|
+
self.upload = to_streamed_response_wrapper(
|
523
|
+
search.upload,
|
524
|
+
)
|
525
|
+
self.url = to_streamed_response_wrapper(
|
526
|
+
search.url,
|
527
|
+
)
|
528
|
+
|
529
|
+
|
530
|
+
class AsyncSearchResourceWithStreamingResponse:
|
531
|
+
def __init__(self, search: AsyncSearchResource) -> None:
|
532
|
+
self._search = search
|
533
|
+
|
534
|
+
self.text = async_to_streamed_response_wrapper(
|
535
|
+
search.text,
|
536
|
+
)
|
537
|
+
self.upload = async_to_streamed_response_wrapper(
|
538
|
+
search.upload,
|
539
|
+
)
|
540
|
+
self.url = async_to_streamed_response_wrapper(
|
541
|
+
search.url,
|
542
|
+
)
|