mixpeek 0.2__py3-none-any.whl → 0.6.2__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 +100 -71
- mixpeek/base_client.py +155 -0
- mixpeek/client.py +65 -0
- mixpeek/core/__init__.py +25 -0
- mixpeek/core/api_error.py +15 -0
- mixpeek/core/client_wrapper.py +83 -0
- mixpeek/core/datetime_utils.py +28 -0
- mixpeek/core/file.py +38 -0
- mixpeek/core/http_client.py +130 -0
- mixpeek/core/jsonable_encoder.py +103 -0
- mixpeek/core/remove_none_from_dict.py +11 -0
- mixpeek/core/request_options.py +32 -0
- mixpeek/embed/__init__.py +2 -0
- mixpeek/embed/client.py +350 -0
- mixpeek/environment.py +7 -0
- mixpeek/errors/__init__.py +17 -0
- mixpeek/errors/bad_request_error.py +9 -0
- mixpeek/errors/forbidden_error.py +9 -0
- mixpeek/errors/internal_server_error.py +9 -0
- mixpeek/errors/not_found_error.py +9 -0
- mixpeek/errors/unauthorized_error.py +9 -0
- mixpeek/errors/unprocessable_entity_error.py +9 -0
- mixpeek/extract/__init__.py +2 -0
- mixpeek/extract/client.py +347 -0
- mixpeek/generators/__init__.py +2 -0
- mixpeek/generators/client.py +237 -0
- mixpeek/parse/__init__.py +2 -0
- mixpeek/parse/client.py +111 -0
- mixpeek/parse_client.py +14 -0
- mixpeek/pipelines/__init__.py +2 -0
- mixpeek/pipelines/client.py +468 -0
- mixpeek/py.typed +0 -0
- mixpeek/storage/__init__.py +2 -0
- mixpeek/storage/client.py +250 -0
- mixpeek/types/__init__.py +73 -0
- mixpeek/types/api_key.py +31 -0
- mixpeek/types/audio_params.py +29 -0
- mixpeek/types/configs_response.py +31 -0
- mixpeek/types/connection.py +36 -0
- mixpeek/types/connection_engine.py +5 -0
- mixpeek/types/csv_params.py +29 -0
- mixpeek/types/destination.py +31 -0
- mixpeek/types/embedding_response.py +30 -0
- mixpeek/types/error_message.py +29 -0
- mixpeek/types/error_response.py +30 -0
- mixpeek/types/field_type.py +5 -0
- mixpeek/types/generation_response.py +34 -0
- mixpeek/types/html_params.py +29 -0
- mixpeek/types/http_validation_error.py +30 -0
- mixpeek/types/image_params.py +32 -0
- mixpeek/types/message.py +30 -0
- mixpeek/types/metadata.py +34 -0
- mixpeek/types/modality.py +5 -0
- mixpeek/types/model.py +31 -0
- mixpeek/types/models.py +5 -0
- mixpeek/types/pdf_params.py +41 -0
- mixpeek/types/ppt_params.py +27 -0
- mixpeek/types/pptx_params.py +27 -0
- mixpeek/types/settings.py +35 -0
- mixpeek/types/source.py +32 -0
- mixpeek/types/source_destination_mapping.py +33 -0
- mixpeek/types/txt_params.py +27 -0
- mixpeek/types/user.py +36 -0
- mixpeek/types/validation_error.py +32 -0
- mixpeek/types/validation_error_loc_item.py +5 -0
- mixpeek/types/video_params.py +27 -0
- mixpeek/types/workflow_response.py +32 -0
- mixpeek/types/workflow_settings.py +30 -0
- mixpeek/types/xlsx_params.py +29 -0
- mixpeek/users/__init__.py +2 -0
- mixpeek/users/client.py +308 -0
- mixpeek/version.py +4 -0
- mixpeek/workflows/__init__.py +2 -0
- mixpeek/workflows/client.py +536 -0
- mixpeek-0.2.dist-info/LICENSE.rst → mixpeek-0.6.2.dist-info/LICENSE +10 -9
- mixpeek-0.6.2.dist-info/METADATA +145 -0
- mixpeek-0.6.2.dist-info/RECORD +78 -0
- {mixpeek-0.2.dist-info → mixpeek-0.6.2.dist-info}/WHEEL +1 -2
- mixpeek-0.2.dist-info/METADATA +0 -12
- mixpeek-0.2.dist-info/RECORD +0 -6
- mixpeek-0.2.dist-info/top_level.txt +0 -1
mixpeek/users/client.py
ADDED
@@ -0,0 +1,308 @@
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
2
|
+
|
3
|
+
import typing
|
4
|
+
import urllib.parse
|
5
|
+
from json.decoder import JSONDecodeError
|
6
|
+
|
7
|
+
from ..core.api_error import ApiError
|
8
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
9
|
+
from ..core.jsonable_encoder import jsonable_encoder
|
10
|
+
from ..core.remove_none_from_dict import remove_none_from_dict
|
11
|
+
from ..core.request_options import RequestOptions
|
12
|
+
from ..errors.bad_request_error import BadRequestError
|
13
|
+
from ..errors.forbidden_error import ForbiddenError
|
14
|
+
from ..errors.internal_server_error import InternalServerError
|
15
|
+
from ..errors.not_found_error import NotFoundError
|
16
|
+
from ..errors.unauthorized_error import UnauthorizedError
|
17
|
+
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
18
|
+
from ..types.api_key import ApiKey
|
19
|
+
from ..types.connection import Connection
|
20
|
+
from ..types.error_response import ErrorResponse
|
21
|
+
from ..types.http_validation_error import HttpValidationError
|
22
|
+
from ..types.user import User
|
23
|
+
|
24
|
+
try:
|
25
|
+
import pydantic.v1 as pydantic # type: ignore
|
26
|
+
except ImportError:
|
27
|
+
import pydantic # type: ignore
|
28
|
+
|
29
|
+
# this is used as the default value for optional parameters
|
30
|
+
OMIT = typing.cast(typing.Any, ...)
|
31
|
+
|
32
|
+
|
33
|
+
class UsersClient:
|
34
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
35
|
+
self._client_wrapper = client_wrapper
|
36
|
+
|
37
|
+
def get_user_users_get(self, *, request_options: typing.Optional[RequestOptions] = None) -> User:
|
38
|
+
"""
|
39
|
+
Parameters:
|
40
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
41
|
+
---
|
42
|
+
from mixpeek.client import Mixpeek
|
43
|
+
|
44
|
+
client = Mixpeek(
|
45
|
+
authorization="YOUR_AUTHORIZATION",
|
46
|
+
index_id="YOUR_INDEX_ID",
|
47
|
+
api_key="YOUR_API_KEY",
|
48
|
+
)
|
49
|
+
client.users.get_user_users_get()
|
50
|
+
"""
|
51
|
+
_response = self._client_wrapper.httpx_client.request(
|
52
|
+
"GET",
|
53
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "users"),
|
54
|
+
params=jsonable_encoder(
|
55
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
56
|
+
),
|
57
|
+
headers=jsonable_encoder(
|
58
|
+
remove_none_from_dict(
|
59
|
+
{
|
60
|
+
**self._client_wrapper.get_headers(),
|
61
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
62
|
+
}
|
63
|
+
)
|
64
|
+
),
|
65
|
+
timeout=request_options.get("timeout_in_seconds")
|
66
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
67
|
+
else self._client_wrapper.get_timeout(),
|
68
|
+
retries=0,
|
69
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
70
|
+
)
|
71
|
+
if 200 <= _response.status_code < 300:
|
72
|
+
return pydantic.parse_obj_as(User, _response.json()) # type: ignore
|
73
|
+
if _response.status_code == 400:
|
74
|
+
raise BadRequestError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
75
|
+
if _response.status_code == 401:
|
76
|
+
raise UnauthorizedError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
77
|
+
if _response.status_code == 403:
|
78
|
+
raise ForbiddenError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
79
|
+
if _response.status_code == 404:
|
80
|
+
raise NotFoundError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
81
|
+
if _response.status_code == 422:
|
82
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
83
|
+
if _response.status_code == 500:
|
84
|
+
raise InternalServerError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
85
|
+
try:
|
86
|
+
_response_json = _response.json()
|
87
|
+
except JSONDecodeError:
|
88
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
89
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
90
|
+
|
91
|
+
def update_user_users_put(
|
92
|
+
self,
|
93
|
+
*,
|
94
|
+
api_keys: typing.Optional[typing.Sequence[ApiKey]] = OMIT,
|
95
|
+
metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
|
96
|
+
connections: typing.Optional[typing.Sequence[Connection]] = OMIT,
|
97
|
+
request_options: typing.Optional[RequestOptions] = None,
|
98
|
+
) -> User:
|
99
|
+
"""
|
100
|
+
Parameters:
|
101
|
+
- api_keys: typing.Optional[typing.Sequence[ApiKey]].
|
102
|
+
|
103
|
+
- metadata: typing.Optional[typing.Dict[str, typing.Any]].
|
104
|
+
|
105
|
+
- connections: typing.Optional[typing.Sequence[Connection]].
|
106
|
+
|
107
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
108
|
+
---
|
109
|
+
from mixpeek.client import Mixpeek
|
110
|
+
|
111
|
+
client = Mixpeek(
|
112
|
+
authorization="YOUR_AUTHORIZATION",
|
113
|
+
index_id="YOUR_INDEX_ID",
|
114
|
+
api_key="YOUR_API_KEY",
|
115
|
+
)
|
116
|
+
client.users.update_user_users_put()
|
117
|
+
"""
|
118
|
+
_request: typing.Dict[str, typing.Any] = {}
|
119
|
+
if api_keys is not OMIT:
|
120
|
+
_request["api_keys"] = api_keys
|
121
|
+
if metadata is not OMIT:
|
122
|
+
_request["metadata"] = metadata
|
123
|
+
if connections is not OMIT:
|
124
|
+
_request["connections"] = connections
|
125
|
+
_response = self._client_wrapper.httpx_client.request(
|
126
|
+
"PUT",
|
127
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "users"),
|
128
|
+
params=jsonable_encoder(
|
129
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
130
|
+
),
|
131
|
+
json=jsonable_encoder(_request)
|
132
|
+
if request_options is None or request_options.get("additional_body_parameters") is None
|
133
|
+
else {
|
134
|
+
**jsonable_encoder(_request),
|
135
|
+
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
136
|
+
},
|
137
|
+
headers=jsonable_encoder(
|
138
|
+
remove_none_from_dict(
|
139
|
+
{
|
140
|
+
**self._client_wrapper.get_headers(),
|
141
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
142
|
+
}
|
143
|
+
)
|
144
|
+
),
|
145
|
+
timeout=request_options.get("timeout_in_seconds")
|
146
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
147
|
+
else self._client_wrapper.get_timeout(),
|
148
|
+
retries=0,
|
149
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
150
|
+
)
|
151
|
+
if 200 <= _response.status_code < 300:
|
152
|
+
return pydantic.parse_obj_as(User, _response.json()) # type: ignore
|
153
|
+
if _response.status_code == 400:
|
154
|
+
raise BadRequestError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
155
|
+
if _response.status_code == 401:
|
156
|
+
raise UnauthorizedError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
157
|
+
if _response.status_code == 403:
|
158
|
+
raise ForbiddenError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
159
|
+
if _response.status_code == 404:
|
160
|
+
raise NotFoundError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
161
|
+
if _response.status_code == 422:
|
162
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
163
|
+
if _response.status_code == 500:
|
164
|
+
raise InternalServerError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
165
|
+
try:
|
166
|
+
_response_json = _response.json()
|
167
|
+
except JSONDecodeError:
|
168
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
169
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
170
|
+
|
171
|
+
|
172
|
+
class AsyncUsersClient:
|
173
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
174
|
+
self._client_wrapper = client_wrapper
|
175
|
+
|
176
|
+
async def get_user_users_get(self, *, request_options: typing.Optional[RequestOptions] = None) -> User:
|
177
|
+
"""
|
178
|
+
Parameters:
|
179
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
180
|
+
---
|
181
|
+
from mixpeek.client import AsyncMixpeek
|
182
|
+
|
183
|
+
client = AsyncMixpeek(
|
184
|
+
authorization="YOUR_AUTHORIZATION",
|
185
|
+
index_id="YOUR_INDEX_ID",
|
186
|
+
api_key="YOUR_API_KEY",
|
187
|
+
)
|
188
|
+
await client.users.get_user_users_get()
|
189
|
+
"""
|
190
|
+
_response = await self._client_wrapper.httpx_client.request(
|
191
|
+
"GET",
|
192
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "users"),
|
193
|
+
params=jsonable_encoder(
|
194
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
195
|
+
),
|
196
|
+
headers=jsonable_encoder(
|
197
|
+
remove_none_from_dict(
|
198
|
+
{
|
199
|
+
**self._client_wrapper.get_headers(),
|
200
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
201
|
+
}
|
202
|
+
)
|
203
|
+
),
|
204
|
+
timeout=request_options.get("timeout_in_seconds")
|
205
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
206
|
+
else self._client_wrapper.get_timeout(),
|
207
|
+
retries=0,
|
208
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
209
|
+
)
|
210
|
+
if 200 <= _response.status_code < 300:
|
211
|
+
return pydantic.parse_obj_as(User, _response.json()) # type: ignore
|
212
|
+
if _response.status_code == 400:
|
213
|
+
raise BadRequestError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
214
|
+
if _response.status_code == 401:
|
215
|
+
raise UnauthorizedError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
216
|
+
if _response.status_code == 403:
|
217
|
+
raise ForbiddenError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
218
|
+
if _response.status_code == 404:
|
219
|
+
raise NotFoundError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
220
|
+
if _response.status_code == 422:
|
221
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
222
|
+
if _response.status_code == 500:
|
223
|
+
raise InternalServerError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
224
|
+
try:
|
225
|
+
_response_json = _response.json()
|
226
|
+
except JSONDecodeError:
|
227
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
228
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
229
|
+
|
230
|
+
async def update_user_users_put(
|
231
|
+
self,
|
232
|
+
*,
|
233
|
+
api_keys: typing.Optional[typing.Sequence[ApiKey]] = OMIT,
|
234
|
+
metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
|
235
|
+
connections: typing.Optional[typing.Sequence[Connection]] = OMIT,
|
236
|
+
request_options: typing.Optional[RequestOptions] = None,
|
237
|
+
) -> User:
|
238
|
+
"""
|
239
|
+
Parameters:
|
240
|
+
- api_keys: typing.Optional[typing.Sequence[ApiKey]].
|
241
|
+
|
242
|
+
- metadata: typing.Optional[typing.Dict[str, typing.Any]].
|
243
|
+
|
244
|
+
- connections: typing.Optional[typing.Sequence[Connection]].
|
245
|
+
|
246
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
247
|
+
---
|
248
|
+
from mixpeek.client import AsyncMixpeek
|
249
|
+
|
250
|
+
client = AsyncMixpeek(
|
251
|
+
authorization="YOUR_AUTHORIZATION",
|
252
|
+
index_id="YOUR_INDEX_ID",
|
253
|
+
api_key="YOUR_API_KEY",
|
254
|
+
)
|
255
|
+
await client.users.update_user_users_put()
|
256
|
+
"""
|
257
|
+
_request: typing.Dict[str, typing.Any] = {}
|
258
|
+
if api_keys is not OMIT:
|
259
|
+
_request["api_keys"] = api_keys
|
260
|
+
if metadata is not OMIT:
|
261
|
+
_request["metadata"] = metadata
|
262
|
+
if connections is not OMIT:
|
263
|
+
_request["connections"] = connections
|
264
|
+
_response = await self._client_wrapper.httpx_client.request(
|
265
|
+
"PUT",
|
266
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "users"),
|
267
|
+
params=jsonable_encoder(
|
268
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
269
|
+
),
|
270
|
+
json=jsonable_encoder(_request)
|
271
|
+
if request_options is None or request_options.get("additional_body_parameters") is None
|
272
|
+
else {
|
273
|
+
**jsonable_encoder(_request),
|
274
|
+
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
275
|
+
},
|
276
|
+
headers=jsonable_encoder(
|
277
|
+
remove_none_from_dict(
|
278
|
+
{
|
279
|
+
**self._client_wrapper.get_headers(),
|
280
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
281
|
+
}
|
282
|
+
)
|
283
|
+
),
|
284
|
+
timeout=request_options.get("timeout_in_seconds")
|
285
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
286
|
+
else self._client_wrapper.get_timeout(),
|
287
|
+
retries=0,
|
288
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
289
|
+
)
|
290
|
+
if 200 <= _response.status_code < 300:
|
291
|
+
return pydantic.parse_obj_as(User, _response.json()) # type: ignore
|
292
|
+
if _response.status_code == 400:
|
293
|
+
raise BadRequestError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
294
|
+
if _response.status_code == 401:
|
295
|
+
raise UnauthorizedError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
296
|
+
if _response.status_code == 403:
|
297
|
+
raise ForbiddenError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
298
|
+
if _response.status_code == 404:
|
299
|
+
raise NotFoundError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
300
|
+
if _response.status_code == 422:
|
301
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
302
|
+
if _response.status_code == 500:
|
303
|
+
raise InternalServerError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
304
|
+
try:
|
305
|
+
_response_json = _response.json()
|
306
|
+
except JSONDecodeError:
|
307
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
308
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
mixpeek/version.py
ADDED