mixpeek 0.6.8__py3-none-any.whl → 0.6.9__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.
Files changed (85) hide show
  1. mixpeek/__init__.py +1 -106
  2. mixpeek/client.py +21 -65
  3. mixpeek/endpoints/connections.py +16 -0
  4. mixpeek/endpoints/embed.py +50 -0
  5. mixpeek/endpoints/extract.py +16 -0
  6. mixpeek/endpoints/generate.py +17 -0
  7. mixpeek/endpoints/tools.py +23 -0
  8. mixpeek/exceptions.py +13 -0
  9. mixpeek-0.6.9.dist-info/METADATA +68 -0
  10. mixpeek-0.6.9.dist-info/RECORD +13 -0
  11. {mixpeek-0.6.8.dist-info → mixpeek-0.6.9.dist-info}/WHEEL +2 -1
  12. mixpeek-0.6.9.dist-info/top_level.txt +1 -0
  13. mixpeek/base_client.py +0 -1015
  14. mixpeek/core/__init__.py +0 -27
  15. mixpeek/core/api_error.py +0 -15
  16. mixpeek/core/client_wrapper.py +0 -83
  17. mixpeek/core/datetime_utils.py +0 -28
  18. mixpeek/core/file.py +0 -38
  19. mixpeek/core/http_client.py +0 -130
  20. mixpeek/core/jsonable_encoder.py +0 -99
  21. mixpeek/core/pydantic_utilities.py +0 -12
  22. mixpeek/core/remove_none_from_dict.py +0 -11
  23. mixpeek/core/request_options.py +0 -32
  24. mixpeek/environment.py +0 -7
  25. mixpeek/errors/__init__.py +0 -17
  26. mixpeek/errors/bad_request_error.py +0 -9
  27. mixpeek/errors/forbidden_error.py +0 -9
  28. mixpeek/errors/internal_server_error.py +0 -9
  29. mixpeek/errors/not_found_error.py +0 -9
  30. mixpeek/errors/unauthorized_error.py +0 -9
  31. mixpeek/errors/unprocessable_entity_error.py +0 -9
  32. mixpeek/pipeline/__init__.py +0 -2
  33. mixpeek/pipeline/client.py +0 -482
  34. mixpeek/storage/__init__.py +0 -5
  35. mixpeek/storage/client.py +0 -145
  36. mixpeek/storage/sample/__init__.py +0 -2
  37. mixpeek/storage/sample/client.py +0 -286
  38. mixpeek/types/__init__.py +0 -81
  39. mixpeek/types/api_key.py +0 -27
  40. mixpeek/types/audio_params.py +0 -25
  41. mixpeek/types/configs_response.py +0 -38
  42. mixpeek/types/connection.py +0 -32
  43. mixpeek/types/connection_engine.py +0 -5
  44. mixpeek/types/csv_params.py +0 -25
  45. mixpeek/types/destination.py +0 -38
  46. mixpeek/types/embedding_response.py +0 -30
  47. mixpeek/types/error_message.py +0 -25
  48. mixpeek/types/error_response.py +0 -26
  49. mixpeek/types/extract_response.py +0 -31
  50. mixpeek/types/field_type.py +0 -5
  51. mixpeek/types/generation_response.py +0 -32
  52. mixpeek/types/html_params.py +0 -25
  53. mixpeek/types/http_validation_error.py +0 -26
  54. mixpeek/types/image_params.py +0 -28
  55. mixpeek/types/message.py +0 -33
  56. mixpeek/types/metadata.py +0 -28
  57. mixpeek/types/modality.py +0 -5
  58. mixpeek/types/model.py +0 -34
  59. mixpeek/types/models.py +0 -5
  60. mixpeek/types/pdf_params.py +0 -37
  61. mixpeek/types/pipeline_response.py +0 -45
  62. mixpeek/types/pipeline_task_response.py +0 -28
  63. mixpeek/types/ppt_params.py +0 -23
  64. mixpeek/types/pptx_params.py +0 -23
  65. mixpeek/types/settings.py +0 -31
  66. mixpeek/types/source.py +0 -39
  67. mixpeek/types/source_destination_mapping.py +0 -40
  68. mixpeek/types/txt_params.py +0 -23
  69. mixpeek/types/user.py +0 -32
  70. mixpeek/types/validation_error.py +0 -28
  71. mixpeek/types/validation_error_loc_item.py +0 -5
  72. mixpeek/types/video_params.py +0 -23
  73. mixpeek/types/workflow_code_response.py +0 -25
  74. mixpeek/types/workflow_response.py +0 -28
  75. mixpeek/types/workflow_settings.py +0 -26
  76. mixpeek/types/xlsx_params.py +0 -25
  77. mixpeek/user/__init__.py +0 -2
  78. mixpeek/user/client.py +0 -312
  79. mixpeek/version.py +0 -4
  80. mixpeek/workflow/__init__.py +0 -2
  81. mixpeek/workflow/client.py +0 -543
  82. mixpeek-0.6.8.dist-info/LICENSE +0 -21
  83. mixpeek-0.6.8.dist-info/METADATA +0 -145
  84. mixpeek-0.6.8.dist-info/RECORD +0 -76
  85. /mixpeek/{py.typed → endpoints/__init__.py} +0 -0
@@ -1,28 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import datetime as dt
4
- import typing
5
-
6
- from ..core.datetime_utils import serialize_datetime
7
- from ..core.pydantic_utilities import pydantic_v1
8
-
9
-
10
- class WorkflowResponse(pydantic_v1.BaseModel):
11
- workflow_id: str
12
- workflow_name: typing.Optional[str] = None
13
- created_at: dt.datetime
14
- metadata: typing.Optional[typing.Dict[str, typing.Any]] = None
15
-
16
- def json(self, **kwargs: typing.Any) -> str:
17
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
18
- return super().json(**kwargs_with_defaults)
19
-
20
- def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
21
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
22
- return super().dict(**kwargs_with_defaults)
23
-
24
- class Config:
25
- frozen = True
26
- smart_union = True
27
- extra = pydantic_v1.Extra.allow
28
- json_encoders = {dt.datetime: serialize_datetime}
@@ -1,26 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import datetime as dt
4
- import typing
5
-
6
- from ..core.datetime_utils import serialize_datetime
7
- from ..core.pydantic_utilities import pydantic_v1
8
-
9
-
10
- class WorkflowSettings(pydantic_v1.BaseModel):
11
- requirements: typing.Optional[typing.List[str]] = None
12
- python_version: typing.Optional[str] = None
13
-
14
- def json(self, **kwargs: typing.Any) -> str:
15
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
16
- return super().json(**kwargs_with_defaults)
17
-
18
- def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
19
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
20
- return super().dict(**kwargs_with_defaults)
21
-
22
- class Config:
23
- frozen = True
24
- smart_union = True
25
- extra = pydantic_v1.Extra.allow
26
- json_encoders = {dt.datetime: serialize_datetime}
@@ -1,25 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import datetime as dt
4
- import typing
5
-
6
- from ..core.datetime_utils import serialize_datetime
7
- from ..core.pydantic_utilities import pydantic_v1
8
-
9
-
10
- class XlsxParams(pydantic_v1.BaseModel):
11
- include_header: typing.Optional[bool] = None
12
-
13
- def json(self, **kwargs: typing.Any) -> str:
14
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
15
- return super().json(**kwargs_with_defaults)
16
-
17
- def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
18
- kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19
- return super().dict(**kwargs_with_defaults)
20
-
21
- class Config:
22
- frozen = True
23
- smart_union = True
24
- extra = pydantic_v1.Extra.allow
25
- json_encoders = {dt.datetime: serialize_datetime}
mixpeek/user/__init__.py DELETED
@@ -1,2 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
mixpeek/user/client.py DELETED
@@ -1,312 +0,0 @@
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.pydantic_utilities import pydantic_v1
11
- from ..core.remove_none_from_dict import remove_none_from_dict
12
- from ..core.request_options import RequestOptions
13
- from ..errors.bad_request_error import BadRequestError
14
- from ..errors.forbidden_error import ForbiddenError
15
- from ..errors.internal_server_error import InternalServerError
16
- from ..errors.not_found_error import NotFoundError
17
- from ..errors.unauthorized_error import UnauthorizedError
18
- from ..errors.unprocessable_entity_error import UnprocessableEntityError
19
- from ..types.api_key import ApiKey
20
- from ..types.connection import Connection
21
- from ..types.error_response import ErrorResponse
22
- from ..types.http_validation_error import HttpValidationError
23
- from ..types.user import User
24
-
25
- # this is used as the default value for optional parameters
26
- OMIT = typing.cast(typing.Any, ...)
27
-
28
-
29
- class UserClient:
30
- def __init__(self, *, client_wrapper: SyncClientWrapper):
31
- self._client_wrapper = client_wrapper
32
-
33
- def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> User:
34
- """
35
- Parameters:
36
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
37
- ---
38
- from mixpeek.client import Mixpeek
39
-
40
- client = Mixpeek(
41
- authorization="YOUR_AUTHORIZATION",
42
- index_id="YOUR_INDEX_ID",
43
- api_key="YOUR_API_KEY",
44
- )
45
- client.user.get()
46
- """
47
- _response = self._client_wrapper.httpx_client.request(
48
- "GET",
49
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "users"),
50
- params=jsonable_encoder(
51
- request_options.get("additional_query_parameters") if request_options is not None else None
52
- ),
53
- headers=jsonable_encoder(
54
- remove_none_from_dict(
55
- {
56
- **self._client_wrapper.get_headers(),
57
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
58
- }
59
- )
60
- ),
61
- timeout=request_options.get("timeout_in_seconds")
62
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
63
- else self._client_wrapper.get_timeout(),
64
- retries=0,
65
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
66
- )
67
- if 200 <= _response.status_code < 300:
68
- return pydantic_v1.parse_obj_as(User, _response.json()) # type: ignore
69
- if _response.status_code == 400:
70
- raise BadRequestError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
71
- if _response.status_code == 401:
72
- raise UnauthorizedError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
73
- if _response.status_code == 403:
74
- raise ForbiddenError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
75
- if _response.status_code == 404:
76
- raise NotFoundError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
77
- if _response.status_code == 422:
78
- raise UnprocessableEntityError(
79
- pydantic_v1.parse_obj_as(HttpValidationError, _response.json()) # type: ignore
80
- )
81
- if _response.status_code == 500:
82
- raise InternalServerError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
83
- try:
84
- _response_json = _response.json()
85
- except JSONDecodeError:
86
- raise ApiError(status_code=_response.status_code, body=_response.text)
87
- raise ApiError(status_code=_response.status_code, body=_response_json)
88
-
89
- def update(
90
- self,
91
- *,
92
- api_keys: typing.Optional[typing.Sequence[ApiKey]] = OMIT,
93
- metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
94
- connections: typing.Optional[typing.Sequence[Connection]] = OMIT,
95
- request_options: typing.Optional[RequestOptions] = None,
96
- ) -> User:
97
- """
98
- Parameters:
99
- - api_keys: typing.Optional[typing.Sequence[ApiKey]].
100
-
101
- - metadata: typing.Optional[typing.Dict[str, typing.Any]].
102
-
103
- - connections: typing.Optional[typing.Sequence[Connection]].
104
-
105
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
106
- ---
107
- from mixpeek.client import Mixpeek
108
-
109
- client = Mixpeek(
110
- authorization="YOUR_AUTHORIZATION",
111
- index_id="YOUR_INDEX_ID",
112
- api_key="YOUR_API_KEY",
113
- )
114
- client.user.update()
115
- """
116
- _request: typing.Dict[str, typing.Any] = {}
117
- if api_keys is not OMIT:
118
- _request["api_keys"] = api_keys
119
- if metadata is not OMIT:
120
- _request["metadata"] = metadata
121
- if connections is not OMIT:
122
- _request["connections"] = connections
123
- _response = self._client_wrapper.httpx_client.request(
124
- "PUT",
125
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "users"),
126
- params=jsonable_encoder(
127
- request_options.get("additional_query_parameters") if request_options is not None else None
128
- ),
129
- json=jsonable_encoder(_request)
130
- if request_options is None or request_options.get("additional_body_parameters") is None
131
- else {
132
- **jsonable_encoder(_request),
133
- **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
134
- },
135
- headers=jsonable_encoder(
136
- remove_none_from_dict(
137
- {
138
- **self._client_wrapper.get_headers(),
139
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
140
- }
141
- )
142
- ),
143
- timeout=request_options.get("timeout_in_seconds")
144
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
145
- else self._client_wrapper.get_timeout(),
146
- retries=0,
147
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
148
- )
149
- if 200 <= _response.status_code < 300:
150
- return pydantic_v1.parse_obj_as(User, _response.json()) # type: ignore
151
- if _response.status_code == 400:
152
- raise BadRequestError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
153
- if _response.status_code == 401:
154
- raise UnauthorizedError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
155
- if _response.status_code == 403:
156
- raise ForbiddenError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
157
- if _response.status_code == 404:
158
- raise NotFoundError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
159
- if _response.status_code == 422:
160
- raise UnprocessableEntityError(
161
- pydantic_v1.parse_obj_as(HttpValidationError, _response.json()) # type: ignore
162
- )
163
- if _response.status_code == 500:
164
- raise InternalServerError(pydantic_v1.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 AsyncUserClient:
173
- def __init__(self, *, client_wrapper: AsyncClientWrapper):
174
- self._client_wrapper = client_wrapper
175
-
176
- async def 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.user.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_v1.parse_obj_as(User, _response.json()) # type: ignore
212
- if _response.status_code == 400:
213
- raise BadRequestError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
214
- if _response.status_code == 401:
215
- raise UnauthorizedError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
216
- if _response.status_code == 403:
217
- raise ForbiddenError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
218
- if _response.status_code == 404:
219
- raise NotFoundError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
220
- if _response.status_code == 422:
221
- raise UnprocessableEntityError(
222
- pydantic_v1.parse_obj_as(HttpValidationError, _response.json()) # type: ignore
223
- )
224
- if _response.status_code == 500:
225
- raise InternalServerError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
226
- try:
227
- _response_json = _response.json()
228
- except JSONDecodeError:
229
- raise ApiError(status_code=_response.status_code, body=_response.text)
230
- raise ApiError(status_code=_response.status_code, body=_response_json)
231
-
232
- async def update(
233
- self,
234
- *,
235
- api_keys: typing.Optional[typing.Sequence[ApiKey]] = OMIT,
236
- metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
237
- connections: typing.Optional[typing.Sequence[Connection]] = OMIT,
238
- request_options: typing.Optional[RequestOptions] = None,
239
- ) -> User:
240
- """
241
- Parameters:
242
- - api_keys: typing.Optional[typing.Sequence[ApiKey]].
243
-
244
- - metadata: typing.Optional[typing.Dict[str, typing.Any]].
245
-
246
- - connections: typing.Optional[typing.Sequence[Connection]].
247
-
248
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
249
- ---
250
- from mixpeek.client import AsyncMixpeek
251
-
252
- client = AsyncMixpeek(
253
- authorization="YOUR_AUTHORIZATION",
254
- index_id="YOUR_INDEX_ID",
255
- api_key="YOUR_API_KEY",
256
- )
257
- await client.user.update()
258
- """
259
- _request: typing.Dict[str, typing.Any] = {}
260
- if api_keys is not OMIT:
261
- _request["api_keys"] = api_keys
262
- if metadata is not OMIT:
263
- _request["metadata"] = metadata
264
- if connections is not OMIT:
265
- _request["connections"] = connections
266
- _response = await self._client_wrapper.httpx_client.request(
267
- "PUT",
268
- urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "users"),
269
- params=jsonable_encoder(
270
- request_options.get("additional_query_parameters") if request_options is not None else None
271
- ),
272
- json=jsonable_encoder(_request)
273
- if request_options is None or request_options.get("additional_body_parameters") is None
274
- else {
275
- **jsonable_encoder(_request),
276
- **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
277
- },
278
- headers=jsonable_encoder(
279
- remove_none_from_dict(
280
- {
281
- **self._client_wrapper.get_headers(),
282
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
283
- }
284
- )
285
- ),
286
- timeout=request_options.get("timeout_in_seconds")
287
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
288
- else self._client_wrapper.get_timeout(),
289
- retries=0,
290
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
291
- )
292
- if 200 <= _response.status_code < 300:
293
- return pydantic_v1.parse_obj_as(User, _response.json()) # type: ignore
294
- if _response.status_code == 400:
295
- raise BadRequestError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
296
- if _response.status_code == 401:
297
- raise UnauthorizedError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
298
- if _response.status_code == 403:
299
- raise ForbiddenError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
300
- if _response.status_code == 404:
301
- raise NotFoundError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
302
- if _response.status_code == 422:
303
- raise UnprocessableEntityError(
304
- pydantic_v1.parse_obj_as(HttpValidationError, _response.json()) # type: ignore
305
- )
306
- if _response.status_code == 500:
307
- raise InternalServerError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
308
- try:
309
- _response_json = _response.json()
310
- except JSONDecodeError:
311
- raise ApiError(status_code=_response.status_code, body=_response.text)
312
- raise ApiError(status_code=_response.status_code, body=_response_json)
mixpeek/version.py DELETED
@@ -1,4 +0,0 @@
1
-
2
- from importlib import metadata
3
-
4
- __version__ = metadata.version("mixpeek")
@@ -1,2 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-