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,338 @@
|
|
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, cast
|
6
|
+
|
7
|
+
import httpx
|
8
|
+
|
9
|
+
from ..types import describe_url_params, describe_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__ = ["DescribeResource", "AsyncDescribeResource"]
|
29
|
+
|
30
|
+
|
31
|
+
class DescribeResource(SyncAPIResource):
|
32
|
+
@cached_property
|
33
|
+
def with_raw_response(self) -> DescribeResourceWithRawResponse:
|
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 DescribeResourceWithRawResponse(self)
|
41
|
+
|
42
|
+
@cached_property
|
43
|
+
def with_streaming_response(self) -> DescribeResourceWithStreamingResponse:
|
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 DescribeResourceWithStreamingResponse(self)
|
50
|
+
|
51
|
+
def upload(
|
52
|
+
self,
|
53
|
+
*,
|
54
|
+
file: FileTypes,
|
55
|
+
prompt: str,
|
56
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
57
|
+
index_id: str | 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
|
+
) -> object:
|
65
|
+
"""
|
66
|
+
Endpoint to describe an uploaded video based on a given description.
|
67
|
+
|
68
|
+
Args:
|
69
|
+
index_id: filter by organization
|
70
|
+
|
71
|
+
extra_headers: Send extra headers
|
72
|
+
|
73
|
+
extra_query: Add additional query parameters to the request
|
74
|
+
|
75
|
+
extra_body: Add additional JSON properties to the request
|
76
|
+
|
77
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
78
|
+
"""
|
79
|
+
extra_headers = {
|
80
|
+
**strip_not_given(
|
81
|
+
{
|
82
|
+
"Authorization": authorization,
|
83
|
+
"index-id": index_id,
|
84
|
+
}
|
85
|
+
),
|
86
|
+
**(extra_headers or {}),
|
87
|
+
}
|
88
|
+
body = deepcopy_minimal(
|
89
|
+
{
|
90
|
+
"file": file,
|
91
|
+
"prompt": prompt,
|
92
|
+
}
|
93
|
+
)
|
94
|
+
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
|
95
|
+
# It should be noted that the actual Content-Type header that will be
|
96
|
+
# sent to the server will contain a `boundary` parameter, e.g.
|
97
|
+
# multipart/form-data; boundary=---abc--
|
98
|
+
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
|
99
|
+
return self._post(
|
100
|
+
"/describe/upload",
|
101
|
+
body=maybe_transform(body, describe_upload_params.DescribeUploadParams),
|
102
|
+
files=files,
|
103
|
+
options=make_request_options(
|
104
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
105
|
+
),
|
106
|
+
cast_to=object,
|
107
|
+
)
|
108
|
+
|
109
|
+
def url(
|
110
|
+
self,
|
111
|
+
*,
|
112
|
+
prompt: str,
|
113
|
+
url: str,
|
114
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
115
|
+
index_id: str | NotGiven = NOT_GIVEN,
|
116
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
117
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
118
|
+
extra_headers: Headers | None = None,
|
119
|
+
extra_query: Query | None = None,
|
120
|
+
extra_body: Body | None = None,
|
121
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
122
|
+
) -> object:
|
123
|
+
"""
|
124
|
+
Endpoint to describe a video from a URL based on a given description.
|
125
|
+
|
126
|
+
Args:
|
127
|
+
index_id: filter by organization
|
128
|
+
|
129
|
+
extra_headers: Send extra headers
|
130
|
+
|
131
|
+
extra_query: Add additional query parameters to the request
|
132
|
+
|
133
|
+
extra_body: Add additional JSON properties to the request
|
134
|
+
|
135
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
136
|
+
"""
|
137
|
+
extra_headers = {
|
138
|
+
**strip_not_given(
|
139
|
+
{
|
140
|
+
"Authorization": authorization,
|
141
|
+
"index-id": index_id,
|
142
|
+
}
|
143
|
+
),
|
144
|
+
**(extra_headers or {}),
|
145
|
+
}
|
146
|
+
return self._post(
|
147
|
+
"/describe/url",
|
148
|
+
body=maybe_transform(
|
149
|
+
{
|
150
|
+
"prompt": prompt,
|
151
|
+
"url": url,
|
152
|
+
},
|
153
|
+
describe_url_params.DescribeURLParams,
|
154
|
+
),
|
155
|
+
options=make_request_options(
|
156
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
157
|
+
),
|
158
|
+
cast_to=object,
|
159
|
+
)
|
160
|
+
|
161
|
+
|
162
|
+
class AsyncDescribeResource(AsyncAPIResource):
|
163
|
+
@cached_property
|
164
|
+
def with_raw_response(self) -> AsyncDescribeResourceWithRawResponse:
|
165
|
+
"""
|
166
|
+
This property can be used as a prefix for any HTTP method call to return the
|
167
|
+
the raw response object instead of the parsed content.
|
168
|
+
|
169
|
+
For more information, see https://www.github.com/mixpeek/python-client#accessing-raw-response-data-eg-headers
|
170
|
+
"""
|
171
|
+
return AsyncDescribeResourceWithRawResponse(self)
|
172
|
+
|
173
|
+
@cached_property
|
174
|
+
def with_streaming_response(self) -> AsyncDescribeResourceWithStreamingResponse:
|
175
|
+
"""
|
176
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
177
|
+
|
178
|
+
For more information, see https://www.github.com/mixpeek/python-client#with_streaming_response
|
179
|
+
"""
|
180
|
+
return AsyncDescribeResourceWithStreamingResponse(self)
|
181
|
+
|
182
|
+
async def upload(
|
183
|
+
self,
|
184
|
+
*,
|
185
|
+
file: FileTypes,
|
186
|
+
prompt: str,
|
187
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
188
|
+
index_id: str | NotGiven = NOT_GIVEN,
|
189
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
190
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
191
|
+
extra_headers: Headers | None = None,
|
192
|
+
extra_query: Query | None = None,
|
193
|
+
extra_body: Body | None = None,
|
194
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
195
|
+
) -> object:
|
196
|
+
"""
|
197
|
+
Endpoint to describe an uploaded video based on a given description.
|
198
|
+
|
199
|
+
Args:
|
200
|
+
index_id: filter by organization
|
201
|
+
|
202
|
+
extra_headers: Send extra headers
|
203
|
+
|
204
|
+
extra_query: Add additional query parameters to the request
|
205
|
+
|
206
|
+
extra_body: Add additional JSON properties to the request
|
207
|
+
|
208
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
209
|
+
"""
|
210
|
+
extra_headers = {
|
211
|
+
**strip_not_given(
|
212
|
+
{
|
213
|
+
"Authorization": authorization,
|
214
|
+
"index-id": index_id,
|
215
|
+
}
|
216
|
+
),
|
217
|
+
**(extra_headers or {}),
|
218
|
+
}
|
219
|
+
body = deepcopy_minimal(
|
220
|
+
{
|
221
|
+
"file": file,
|
222
|
+
"prompt": prompt,
|
223
|
+
}
|
224
|
+
)
|
225
|
+
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
|
226
|
+
# It should be noted that the actual Content-Type header that will be
|
227
|
+
# sent to the server will contain a `boundary` parameter, e.g.
|
228
|
+
# multipart/form-data; boundary=---abc--
|
229
|
+
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
|
230
|
+
return await self._post(
|
231
|
+
"/describe/upload",
|
232
|
+
body=await async_maybe_transform(body, describe_upload_params.DescribeUploadParams),
|
233
|
+
files=files,
|
234
|
+
options=make_request_options(
|
235
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
236
|
+
),
|
237
|
+
cast_to=object,
|
238
|
+
)
|
239
|
+
|
240
|
+
async def url(
|
241
|
+
self,
|
242
|
+
*,
|
243
|
+
prompt: str,
|
244
|
+
url: str,
|
245
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
246
|
+
index_id: str | NotGiven = NOT_GIVEN,
|
247
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
248
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
249
|
+
extra_headers: Headers | None = None,
|
250
|
+
extra_query: Query | None = None,
|
251
|
+
extra_body: Body | None = None,
|
252
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
253
|
+
) -> object:
|
254
|
+
"""
|
255
|
+
Endpoint to describe a video from a URL based on a given description.
|
256
|
+
|
257
|
+
Args:
|
258
|
+
index_id: filter by organization
|
259
|
+
|
260
|
+
extra_headers: Send extra headers
|
261
|
+
|
262
|
+
extra_query: Add additional query parameters to the request
|
263
|
+
|
264
|
+
extra_body: Add additional JSON properties to the request
|
265
|
+
|
266
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
267
|
+
"""
|
268
|
+
extra_headers = {
|
269
|
+
**strip_not_given(
|
270
|
+
{
|
271
|
+
"Authorization": authorization,
|
272
|
+
"index-id": index_id,
|
273
|
+
}
|
274
|
+
),
|
275
|
+
**(extra_headers or {}),
|
276
|
+
}
|
277
|
+
return await self._post(
|
278
|
+
"/describe/url",
|
279
|
+
body=await async_maybe_transform(
|
280
|
+
{
|
281
|
+
"prompt": prompt,
|
282
|
+
"url": url,
|
283
|
+
},
|
284
|
+
describe_url_params.DescribeURLParams,
|
285
|
+
),
|
286
|
+
options=make_request_options(
|
287
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
288
|
+
),
|
289
|
+
cast_to=object,
|
290
|
+
)
|
291
|
+
|
292
|
+
|
293
|
+
class DescribeResourceWithRawResponse:
|
294
|
+
def __init__(self, describe: DescribeResource) -> None:
|
295
|
+
self._describe = describe
|
296
|
+
|
297
|
+
self.upload = to_raw_response_wrapper(
|
298
|
+
describe.upload,
|
299
|
+
)
|
300
|
+
self.url = to_raw_response_wrapper(
|
301
|
+
describe.url,
|
302
|
+
)
|
303
|
+
|
304
|
+
|
305
|
+
class AsyncDescribeResourceWithRawResponse:
|
306
|
+
def __init__(self, describe: AsyncDescribeResource) -> None:
|
307
|
+
self._describe = describe
|
308
|
+
|
309
|
+
self.upload = async_to_raw_response_wrapper(
|
310
|
+
describe.upload,
|
311
|
+
)
|
312
|
+
self.url = async_to_raw_response_wrapper(
|
313
|
+
describe.url,
|
314
|
+
)
|
315
|
+
|
316
|
+
|
317
|
+
class DescribeResourceWithStreamingResponse:
|
318
|
+
def __init__(self, describe: DescribeResource) -> None:
|
319
|
+
self._describe = describe
|
320
|
+
|
321
|
+
self.upload = to_streamed_response_wrapper(
|
322
|
+
describe.upload,
|
323
|
+
)
|
324
|
+
self.url = to_streamed_response_wrapper(
|
325
|
+
describe.url,
|
326
|
+
)
|
327
|
+
|
328
|
+
|
329
|
+
class AsyncDescribeResourceWithStreamingResponse:
|
330
|
+
def __init__(self, describe: AsyncDescribeResource) -> None:
|
331
|
+
self._describe = describe
|
332
|
+
|
333
|
+
self.upload = async_to_streamed_response_wrapper(
|
334
|
+
describe.upload,
|
335
|
+
)
|
336
|
+
self.url = async_to_streamed_response_wrapper(
|
337
|
+
describe.url,
|
338
|
+
)
|
@@ -0,0 +1,234 @@
|
|
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 embed_create_params
|
11
|
+
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
12
|
+
from .._utils import (
|
13
|
+
maybe_transform,
|
14
|
+
strip_not_given,
|
15
|
+
async_maybe_transform,
|
16
|
+
)
|
17
|
+
from .._compat import cached_property
|
18
|
+
from .._resource import SyncAPIResource, AsyncAPIResource
|
19
|
+
from .._response import (
|
20
|
+
to_raw_response_wrapper,
|
21
|
+
to_streamed_response_wrapper,
|
22
|
+
async_to_raw_response_wrapper,
|
23
|
+
async_to_streamed_response_wrapper,
|
24
|
+
)
|
25
|
+
from .._base_client import make_request_options
|
26
|
+
from ..types.embeddingresponse import Embeddingresponse
|
27
|
+
|
28
|
+
__all__ = ["EmbedResource", "AsyncEmbedResource"]
|
29
|
+
|
30
|
+
|
31
|
+
class EmbedResource(SyncAPIResource):
|
32
|
+
@cached_property
|
33
|
+
def with_raw_response(self) -> EmbedResourceWithRawResponse:
|
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 EmbedResourceWithRawResponse(self)
|
41
|
+
|
42
|
+
@cached_property
|
43
|
+
def with_streaming_response(self) -> EmbedResourceWithStreamingResponse:
|
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 EmbedResourceWithStreamingResponse(self)
|
50
|
+
|
51
|
+
def create(
|
52
|
+
self,
|
53
|
+
*,
|
54
|
+
input: str,
|
55
|
+
input_type: Optional[Literal["text", "base64", "url"]] | NotGiven = NOT_GIVEN,
|
56
|
+
modality: Optional[Literal["video", "image"]] | NotGiven = NOT_GIVEN,
|
57
|
+
model_id: Optional[object] | NotGiven = NOT_GIVEN,
|
58
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
59
|
+
index_id: str | NotGiven = NOT_GIVEN,
|
60
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
61
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
62
|
+
extra_headers: Headers | None = None,
|
63
|
+
extra_query: Query | None = None,
|
64
|
+
extra_body: Body | None = None,
|
65
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
66
|
+
) -> Embeddingresponse:
|
67
|
+
"""
|
68
|
+
Embed
|
69
|
+
|
70
|
+
Args:
|
71
|
+
input: The input data to be processed.
|
72
|
+
|
73
|
+
input_type: The type of input data. Can be text, base64, or url.
|
74
|
+
|
75
|
+
modality: The modality of the input data.
|
76
|
+
|
77
|
+
model_id: The model to be used for processing.
|
78
|
+
|
79
|
+
index_id: filter by organization
|
80
|
+
|
81
|
+
extra_headers: Send extra headers
|
82
|
+
|
83
|
+
extra_query: Add additional query parameters to the request
|
84
|
+
|
85
|
+
extra_body: Add additional JSON properties to the request
|
86
|
+
|
87
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
88
|
+
"""
|
89
|
+
extra_headers = {
|
90
|
+
**strip_not_given(
|
91
|
+
{
|
92
|
+
"Authorization": authorization,
|
93
|
+
"index-id": index_id,
|
94
|
+
}
|
95
|
+
),
|
96
|
+
**(extra_headers or {}),
|
97
|
+
}
|
98
|
+
return self._post(
|
99
|
+
"/embed/",
|
100
|
+
body=maybe_transform(
|
101
|
+
{
|
102
|
+
"input": input,
|
103
|
+
"input_type": input_type,
|
104
|
+
"modality": modality,
|
105
|
+
"model_id": model_id,
|
106
|
+
},
|
107
|
+
embed_create_params.EmbedCreateParams,
|
108
|
+
),
|
109
|
+
options=make_request_options(
|
110
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
111
|
+
),
|
112
|
+
cast_to=Embeddingresponse,
|
113
|
+
)
|
114
|
+
|
115
|
+
|
116
|
+
class AsyncEmbedResource(AsyncAPIResource):
|
117
|
+
@cached_property
|
118
|
+
def with_raw_response(self) -> AsyncEmbedResourceWithRawResponse:
|
119
|
+
"""
|
120
|
+
This property can be used as a prefix for any HTTP method call to return the
|
121
|
+
the raw response object instead of the parsed content.
|
122
|
+
|
123
|
+
For more information, see https://www.github.com/mixpeek/python-client#accessing-raw-response-data-eg-headers
|
124
|
+
"""
|
125
|
+
return AsyncEmbedResourceWithRawResponse(self)
|
126
|
+
|
127
|
+
@cached_property
|
128
|
+
def with_streaming_response(self) -> AsyncEmbedResourceWithStreamingResponse:
|
129
|
+
"""
|
130
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
131
|
+
|
132
|
+
For more information, see https://www.github.com/mixpeek/python-client#with_streaming_response
|
133
|
+
"""
|
134
|
+
return AsyncEmbedResourceWithStreamingResponse(self)
|
135
|
+
|
136
|
+
async def create(
|
137
|
+
self,
|
138
|
+
*,
|
139
|
+
input: str,
|
140
|
+
input_type: Optional[Literal["text", "base64", "url"]] | NotGiven = NOT_GIVEN,
|
141
|
+
modality: Optional[Literal["video", "image"]] | NotGiven = NOT_GIVEN,
|
142
|
+
model_id: Optional[object] | NotGiven = NOT_GIVEN,
|
143
|
+
authorization: str | NotGiven = NOT_GIVEN,
|
144
|
+
index_id: str | NotGiven = NOT_GIVEN,
|
145
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
146
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
147
|
+
extra_headers: Headers | None = None,
|
148
|
+
extra_query: Query | None = None,
|
149
|
+
extra_body: Body | None = None,
|
150
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
151
|
+
) -> Embeddingresponse:
|
152
|
+
"""
|
153
|
+
Embed
|
154
|
+
|
155
|
+
Args:
|
156
|
+
input: The input data to be processed.
|
157
|
+
|
158
|
+
input_type: The type of input data. Can be text, base64, or url.
|
159
|
+
|
160
|
+
modality: The modality of the input data.
|
161
|
+
|
162
|
+
model_id: The model to be used for processing.
|
163
|
+
|
164
|
+
index_id: filter by organization
|
165
|
+
|
166
|
+
extra_headers: Send extra headers
|
167
|
+
|
168
|
+
extra_query: Add additional query parameters to the request
|
169
|
+
|
170
|
+
extra_body: Add additional JSON properties to the request
|
171
|
+
|
172
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
173
|
+
"""
|
174
|
+
extra_headers = {
|
175
|
+
**strip_not_given(
|
176
|
+
{
|
177
|
+
"Authorization": authorization,
|
178
|
+
"index-id": index_id,
|
179
|
+
}
|
180
|
+
),
|
181
|
+
**(extra_headers or {}),
|
182
|
+
}
|
183
|
+
return await self._post(
|
184
|
+
"/embed/",
|
185
|
+
body=await async_maybe_transform(
|
186
|
+
{
|
187
|
+
"input": input,
|
188
|
+
"input_type": input_type,
|
189
|
+
"modality": modality,
|
190
|
+
"model_id": model_id,
|
191
|
+
},
|
192
|
+
embed_create_params.EmbedCreateParams,
|
193
|
+
),
|
194
|
+
options=make_request_options(
|
195
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
196
|
+
),
|
197
|
+
cast_to=Embeddingresponse,
|
198
|
+
)
|
199
|
+
|
200
|
+
|
201
|
+
class EmbedResourceWithRawResponse:
|
202
|
+
def __init__(self, embed: EmbedResource) -> None:
|
203
|
+
self._embed = embed
|
204
|
+
|
205
|
+
self.create = to_raw_response_wrapper(
|
206
|
+
embed.create,
|
207
|
+
)
|
208
|
+
|
209
|
+
|
210
|
+
class AsyncEmbedResourceWithRawResponse:
|
211
|
+
def __init__(self, embed: AsyncEmbedResource) -> None:
|
212
|
+
self._embed = embed
|
213
|
+
|
214
|
+
self.create = async_to_raw_response_wrapper(
|
215
|
+
embed.create,
|
216
|
+
)
|
217
|
+
|
218
|
+
|
219
|
+
class EmbedResourceWithStreamingResponse:
|
220
|
+
def __init__(self, embed: EmbedResource) -> None:
|
221
|
+
self._embed = embed
|
222
|
+
|
223
|
+
self.create = to_streamed_response_wrapper(
|
224
|
+
embed.create,
|
225
|
+
)
|
226
|
+
|
227
|
+
|
228
|
+
class AsyncEmbedResourceWithStreamingResponse:
|
229
|
+
def __init__(self, embed: AsyncEmbedResource) -> None:
|
230
|
+
self._embed = embed
|
231
|
+
|
232
|
+
self.create = async_to_streamed_response_wrapper(
|
233
|
+
embed.create,
|
234
|
+
)
|