mixpeek 0.6.2__py3-none-any.whl → 0.6.6__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 +12 -8
- mixpeek/base_client.py +857 -23
- mixpeek/client.py +7 -7
- mixpeek/core/client_wrapper.py +1 -1
- mixpeek/{pipelines → pipeline}/client.py +26 -20
- mixpeek/storage/__init__.py +3 -0
- mixpeek/storage/client.py +7 -112
- mixpeek/{embed → storage/sample}/client.py +61 -129
- mixpeek/types/__init__.py +8 -0
- mixpeek/types/configs_response.py +14 -3
- mixpeek/types/destination.py +14 -3
- mixpeek/types/embedding_response.py +6 -2
- mixpeek/types/extract_response.py +35 -0
- mixpeek/types/generation_response.py +6 -4
- mixpeek/types/message.py +9 -2
- mixpeek/types/metadata.py +0 -2
- mixpeek/types/modality.py +1 -1
- mixpeek/types/model.py +9 -2
- mixpeek/types/pipeline_response.py +49 -0
- mixpeek/types/pipeline_task_response.py +32 -0
- mixpeek/types/source.py +14 -3
- mixpeek/types/source_destination_mapping.py +14 -3
- mixpeek/types/workflow_code_response.py +29 -0
- mixpeek/{users → user}/client.py +10 -10
- mixpeek/{workflows → workflow}/client.py +14 -15
- {mixpeek-0.6.2.dist-info → mixpeek-0.6.6.dist-info}/METADATA +1 -1
- {mixpeek-0.6.2.dist-info → mixpeek-0.6.6.dist-info}/RECORD +33 -36
- mixpeek/extract/client.py +0 -347
- mixpeek/generators/client.py +0 -237
- mixpeek/parse/client.py +0 -111
- mixpeek/parse_client.py +0 -14
- mixpeek/pipelines/__init__.py +0 -2
- mixpeek/users/__init__.py +0 -2
- mixpeek/workflows/__init__.py +0 -2
- /mixpeek/{embed → pipeline}/__init__.py +0 -0
- /mixpeek/{extract → storage/sample}/__init__.py +0 -0
- /mixpeek/{generators → user}/__init__.py +0 -0
- /mixpeek/{parse → workflow}/__init__.py +0 -0
- {mixpeek-0.6.2.dist-info → mixpeek-0.6.6.dist-info}/LICENSE +0 -0
- {mixpeek-0.6.2.dist-info → mixpeek-0.6.6.dist-info}/WHEEL +0 -0
@@ -4,48 +4,34 @@ import typing
|
|
4
4
|
import urllib.parse
|
5
5
|
from json.decoder import JSONDecodeError
|
6
6
|
|
7
|
-
from
|
8
|
-
from
|
9
|
-
from
|
10
|
-
from
|
11
|
-
from
|
12
|
-
from
|
13
|
-
from
|
14
|
-
from
|
15
|
-
from
|
16
|
-
from
|
17
|
-
from
|
18
|
-
from
|
19
|
-
from
|
20
|
-
from ..types.error_response import ErrorResponse
|
21
|
-
from ..types.http_validation_error import HttpValidationError
|
22
|
-
from ..types.modality import Modality
|
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.error_response import ErrorResponse
|
19
|
+
from ...types.http_validation_error import HttpValidationError
|
23
20
|
|
24
21
|
try:
|
25
22
|
import pydantic.v1 as pydantic # type: ignore
|
26
23
|
except ImportError:
|
27
24
|
import pydantic # type: ignore
|
28
25
|
|
29
|
-
# this is used as the default value for optional parameters
|
30
|
-
OMIT = typing.cast(typing.Any, ...)
|
31
26
|
|
32
|
-
|
33
|
-
class EmbedClient:
|
27
|
+
class SampleClient:
|
34
28
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
35
29
|
self._client_wrapper = client_wrapper
|
36
30
|
|
37
|
-
def
|
38
|
-
self,
|
39
|
-
*,
|
40
|
-
modality: typing.Optional[Modality] = OMIT,
|
41
|
-
model: typing.Optional[str] = OMIT,
|
42
|
-
request_options: typing.Optional[RequestOptions] = None,
|
43
|
-
) -> ConfigsResponse:
|
31
|
+
def database(self, database_name: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
|
44
32
|
"""
|
45
33
|
Parameters:
|
46
|
-
-
|
47
|
-
|
48
|
-
- model: typing.Optional[str].
|
34
|
+
- database_name: str.
|
49
35
|
|
50
36
|
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
51
37
|
---
|
@@ -56,25 +42,18 @@ class EmbedClient:
|
|
56
42
|
index_id="YOUR_INDEX_ID",
|
57
43
|
api_key="YOUR_API_KEY",
|
58
44
|
)
|
59
|
-
client.
|
45
|
+
client.storage.sample.database(
|
46
|
+
database_name="database_name",
|
47
|
+
)
|
60
48
|
"""
|
61
|
-
_request: typing.Dict[str, typing.Any] = {}
|
62
|
-
if modality is not OMIT:
|
63
|
-
_request["modality"] = modality
|
64
|
-
if model is not OMIT:
|
65
|
-
_request["model"] = model
|
66
49
|
_response = self._client_wrapper.httpx_client.request(
|
67
|
-
"
|
68
|
-
urllib.parse.urljoin(
|
50
|
+
"GET",
|
51
|
+
urllib.parse.urljoin(
|
52
|
+
f"{self._client_wrapper.get_base_url()}/", f"storage/sample/database/{jsonable_encoder(database_name)}"
|
53
|
+
),
|
69
54
|
params=jsonable_encoder(
|
70
55
|
request_options.get("additional_query_parameters") if request_options is not None else None
|
71
56
|
),
|
72
|
-
json=jsonable_encoder(_request)
|
73
|
-
if request_options is None or request_options.get("additional_body_parameters") is None
|
74
|
-
else {
|
75
|
-
**jsonable_encoder(_request),
|
76
|
-
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
77
|
-
},
|
78
57
|
headers=jsonable_encoder(
|
79
58
|
remove_none_from_dict(
|
80
59
|
{
|
@@ -90,7 +69,7 @@ class EmbedClient:
|
|
90
69
|
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
91
70
|
)
|
92
71
|
if 200 <= _response.status_code < 300:
|
93
|
-
return pydantic.parse_obj_as(
|
72
|
+
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
|
94
73
|
if _response.status_code == 400:
|
95
74
|
raise BadRequestError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
96
75
|
if _response.status_code == 401:
|
@@ -109,21 +88,12 @@ class EmbedClient:
|
|
109
88
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
110
89
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
111
90
|
|
112
|
-
def
|
113
|
-
self,
|
114
|
-
|
115
|
-
input: str,
|
116
|
-
modality: typing.Optional[Modality] = OMIT,
|
117
|
-
model: typing.Optional[str] = OMIT,
|
118
|
-
request_options: typing.Optional[RequestOptions] = None,
|
119
|
-
) -> EmbeddingResponse:
|
91
|
+
def collection(
|
92
|
+
self, collection_name: str, *, request_options: typing.Optional[RequestOptions] = None
|
93
|
+
) -> typing.Any:
|
120
94
|
"""
|
121
95
|
Parameters:
|
122
|
-
-
|
123
|
-
|
124
|
-
- modality: typing.Optional[Modality].
|
125
|
-
|
126
|
-
- model: typing.Optional[str].
|
96
|
+
- collection_name: str.
|
127
97
|
|
128
98
|
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
129
99
|
---
|
@@ -134,27 +104,19 @@ class EmbedClient:
|
|
134
104
|
index_id="YOUR_INDEX_ID",
|
135
105
|
api_key="YOUR_API_KEY",
|
136
106
|
)
|
137
|
-
client.
|
138
|
-
|
107
|
+
client.storage.sample.collection(
|
108
|
+
collection_name="collection_name",
|
139
109
|
)
|
140
110
|
"""
|
141
|
-
_request: typing.Dict[str, typing.Any] = {"input": input}
|
142
|
-
if modality is not OMIT:
|
143
|
-
_request["modality"] = modality
|
144
|
-
if model is not OMIT:
|
145
|
-
_request["model"] = model
|
146
111
|
_response = self._client_wrapper.httpx_client.request(
|
147
|
-
"
|
148
|
-
urllib.parse.urljoin(
|
112
|
+
"GET",
|
113
|
+
urllib.parse.urljoin(
|
114
|
+
f"{self._client_wrapper.get_base_url()}/",
|
115
|
+
f"storage/sample/collection/{jsonable_encoder(collection_name)}",
|
116
|
+
),
|
149
117
|
params=jsonable_encoder(
|
150
118
|
request_options.get("additional_query_parameters") if request_options is not None else None
|
151
119
|
),
|
152
|
-
json=jsonable_encoder(_request)
|
153
|
-
if request_options is None or request_options.get("additional_body_parameters") is None
|
154
|
-
else {
|
155
|
-
**jsonable_encoder(_request),
|
156
|
-
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
157
|
-
},
|
158
120
|
headers=jsonable_encoder(
|
159
121
|
remove_none_from_dict(
|
160
122
|
{
|
@@ -170,7 +132,7 @@ class EmbedClient:
|
|
170
132
|
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
171
133
|
)
|
172
134
|
if 200 <= _response.status_code < 300:
|
173
|
-
return pydantic.parse_obj_as(
|
135
|
+
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
|
174
136
|
if _response.status_code == 400:
|
175
137
|
raise BadRequestError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
176
138
|
if _response.status_code == 401:
|
@@ -190,22 +152,16 @@ class EmbedClient:
|
|
190
152
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
191
153
|
|
192
154
|
|
193
|
-
class
|
155
|
+
class AsyncSampleClient:
|
194
156
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
195
157
|
self._client_wrapper = client_wrapper
|
196
158
|
|
197
|
-
async def
|
198
|
-
self,
|
199
|
-
|
200
|
-
modality: typing.Optional[Modality] = OMIT,
|
201
|
-
model: typing.Optional[str] = OMIT,
|
202
|
-
request_options: typing.Optional[RequestOptions] = None,
|
203
|
-
) -> ConfigsResponse:
|
159
|
+
async def database(
|
160
|
+
self, database_name: str, *, request_options: typing.Optional[RequestOptions] = None
|
161
|
+
) -> typing.Any:
|
204
162
|
"""
|
205
163
|
Parameters:
|
206
|
-
-
|
207
|
-
|
208
|
-
- model: typing.Optional[str].
|
164
|
+
- database_name: str.
|
209
165
|
|
210
166
|
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
211
167
|
---
|
@@ -216,25 +172,18 @@ class AsyncEmbedClient:
|
|
216
172
|
index_id="YOUR_INDEX_ID",
|
217
173
|
api_key="YOUR_API_KEY",
|
218
174
|
)
|
219
|
-
await client.
|
175
|
+
await client.storage.sample.database(
|
176
|
+
database_name="database_name",
|
177
|
+
)
|
220
178
|
"""
|
221
|
-
_request: typing.Dict[str, typing.Any] = {}
|
222
|
-
if modality is not OMIT:
|
223
|
-
_request["modality"] = modality
|
224
|
-
if model is not OMIT:
|
225
|
-
_request["model"] = model
|
226
179
|
_response = await self._client_wrapper.httpx_client.request(
|
227
|
-
"
|
228
|
-
urllib.parse.urljoin(
|
180
|
+
"GET",
|
181
|
+
urllib.parse.urljoin(
|
182
|
+
f"{self._client_wrapper.get_base_url()}/", f"storage/sample/database/{jsonable_encoder(database_name)}"
|
183
|
+
),
|
229
184
|
params=jsonable_encoder(
|
230
185
|
request_options.get("additional_query_parameters") if request_options is not None else None
|
231
186
|
),
|
232
|
-
json=jsonable_encoder(_request)
|
233
|
-
if request_options is None or request_options.get("additional_body_parameters") is None
|
234
|
-
else {
|
235
|
-
**jsonable_encoder(_request),
|
236
|
-
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
237
|
-
},
|
238
187
|
headers=jsonable_encoder(
|
239
188
|
remove_none_from_dict(
|
240
189
|
{
|
@@ -250,7 +199,7 @@ class AsyncEmbedClient:
|
|
250
199
|
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
251
200
|
)
|
252
201
|
if 200 <= _response.status_code < 300:
|
253
|
-
return pydantic.parse_obj_as(
|
202
|
+
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
|
254
203
|
if _response.status_code == 400:
|
255
204
|
raise BadRequestError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
256
205
|
if _response.status_code == 401:
|
@@ -269,21 +218,12 @@ class AsyncEmbedClient:
|
|
269
218
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
270
219
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
271
220
|
|
272
|
-
async def
|
273
|
-
self,
|
274
|
-
|
275
|
-
input: str,
|
276
|
-
modality: typing.Optional[Modality] = OMIT,
|
277
|
-
model: typing.Optional[str] = OMIT,
|
278
|
-
request_options: typing.Optional[RequestOptions] = None,
|
279
|
-
) -> EmbeddingResponse:
|
221
|
+
async def collection(
|
222
|
+
self, collection_name: str, *, request_options: typing.Optional[RequestOptions] = None
|
223
|
+
) -> typing.Any:
|
280
224
|
"""
|
281
225
|
Parameters:
|
282
|
-
-
|
283
|
-
|
284
|
-
- modality: typing.Optional[Modality].
|
285
|
-
|
286
|
-
- model: typing.Optional[str].
|
226
|
+
- collection_name: str.
|
287
227
|
|
288
228
|
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
289
229
|
---
|
@@ -294,27 +234,19 @@ class AsyncEmbedClient:
|
|
294
234
|
index_id="YOUR_INDEX_ID",
|
295
235
|
api_key="YOUR_API_KEY",
|
296
236
|
)
|
297
|
-
await client.
|
298
|
-
|
237
|
+
await client.storage.sample.collection(
|
238
|
+
collection_name="collection_name",
|
299
239
|
)
|
300
240
|
"""
|
301
|
-
_request: typing.Dict[str, typing.Any] = {"input": input}
|
302
|
-
if modality is not OMIT:
|
303
|
-
_request["modality"] = modality
|
304
|
-
if model is not OMIT:
|
305
|
-
_request["model"] = model
|
306
241
|
_response = await self._client_wrapper.httpx_client.request(
|
307
|
-
"
|
308
|
-
urllib.parse.urljoin(
|
242
|
+
"GET",
|
243
|
+
urllib.parse.urljoin(
|
244
|
+
f"{self._client_wrapper.get_base_url()}/",
|
245
|
+
f"storage/sample/collection/{jsonable_encoder(collection_name)}",
|
246
|
+
),
|
309
247
|
params=jsonable_encoder(
|
310
248
|
request_options.get("additional_query_parameters") if request_options is not None else None
|
311
249
|
),
|
312
|
-
json=jsonable_encoder(_request)
|
313
|
-
if request_options is None or request_options.get("additional_body_parameters") is None
|
314
|
-
else {
|
315
|
-
**jsonable_encoder(_request),
|
316
|
-
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
317
|
-
},
|
318
250
|
headers=jsonable_encoder(
|
319
251
|
remove_none_from_dict(
|
320
252
|
{
|
@@ -330,7 +262,7 @@ class AsyncEmbedClient:
|
|
330
262
|
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
331
263
|
)
|
332
264
|
if 200 <= _response.status_code < 300:
|
333
|
-
return pydantic.parse_obj_as(
|
265
|
+
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
|
334
266
|
if _response.status_code == 400:
|
335
267
|
raise BadRequestError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
336
268
|
if _response.status_code == 401:
|
mixpeek/types/__init__.py
CHANGED
@@ -10,6 +10,7 @@ from .destination import Destination
|
|
10
10
|
from .embedding_response import EmbeddingResponse
|
11
11
|
from .error_message import ErrorMessage
|
12
12
|
from .error_response import ErrorResponse
|
13
|
+
from .extract_response import ExtractResponse
|
13
14
|
from .field_type import FieldType
|
14
15
|
from .generation_response import GenerationResponse
|
15
16
|
from .html_params import HtmlParams
|
@@ -21,6 +22,8 @@ from .modality import Modality
|
|
21
22
|
from .model import Model
|
22
23
|
from .models import Models
|
23
24
|
from .pdf_params import PdfParams
|
25
|
+
from .pipeline_response import PipelineResponse
|
26
|
+
from .pipeline_task_response import PipelineTaskResponse
|
24
27
|
from .ppt_params import PptParams
|
25
28
|
from .pptx_params import PptxParams
|
26
29
|
from .settings import Settings
|
@@ -31,6 +34,7 @@ from .user import User
|
|
31
34
|
from .validation_error import ValidationError
|
32
35
|
from .validation_error_loc_item import ValidationErrorLocItem
|
33
36
|
from .video_params import VideoParams
|
37
|
+
from .workflow_code_response import WorkflowCodeResponse
|
34
38
|
from .workflow_response import WorkflowResponse
|
35
39
|
from .workflow_settings import WorkflowSettings
|
36
40
|
from .xlsx_params import XlsxParams
|
@@ -46,6 +50,7 @@ __all__ = [
|
|
46
50
|
"EmbeddingResponse",
|
47
51
|
"ErrorMessage",
|
48
52
|
"ErrorResponse",
|
53
|
+
"ExtractResponse",
|
49
54
|
"FieldType",
|
50
55
|
"GenerationResponse",
|
51
56
|
"HtmlParams",
|
@@ -57,6 +62,8 @@ __all__ = [
|
|
57
62
|
"Model",
|
58
63
|
"Models",
|
59
64
|
"PdfParams",
|
65
|
+
"PipelineResponse",
|
66
|
+
"PipelineTaskResponse",
|
60
67
|
"PptParams",
|
61
68
|
"PptxParams",
|
62
69
|
"Settings",
|
@@ -67,6 +74,7 @@ __all__ = [
|
|
67
74
|
"ValidationError",
|
68
75
|
"ValidationErrorLocItem",
|
69
76
|
"VideoParams",
|
77
|
+
"WorkflowCodeResponse",
|
70
78
|
"WorkflowResponse",
|
71
79
|
"WorkflowSettings",
|
72
80
|
"XlsxParams",
|
@@ -12,9 +12,20 @@ except ImportError:
|
|
12
12
|
|
13
13
|
|
14
14
|
class ConfigsResponse(pydantic.BaseModel):
|
15
|
-
dimensions: int
|
16
|
-
|
17
|
-
|
15
|
+
dimensions: int = pydantic.Field()
|
16
|
+
"""
|
17
|
+
The dimensions of the processed data.
|
18
|
+
"""
|
19
|
+
|
20
|
+
elapsed_time: float = pydantic.Field()
|
21
|
+
"""
|
22
|
+
The time taken to process the data.
|
23
|
+
"""
|
24
|
+
|
25
|
+
token_size: int = pydantic.Field()
|
26
|
+
"""
|
27
|
+
The size of the tokens in the processed data.
|
28
|
+
"""
|
18
29
|
|
19
30
|
def json(self, **kwargs: typing.Any) -> str:
|
20
31
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
mixpeek/types/destination.py
CHANGED
@@ -12,9 +12,20 @@ except ImportError:
|
|
12
12
|
|
13
13
|
|
14
14
|
class Destination(pydantic.BaseModel):
|
15
|
-
collection: str
|
16
|
-
|
17
|
-
|
15
|
+
collection: str = pydantic.Field()
|
16
|
+
"""
|
17
|
+
The collection name
|
18
|
+
"""
|
19
|
+
|
20
|
+
field: str = pydantic.Field()
|
21
|
+
"""
|
22
|
+
The field name
|
23
|
+
"""
|
24
|
+
|
25
|
+
embedding: str = pydantic.Field()
|
26
|
+
"""
|
27
|
+
The embedding
|
28
|
+
"""
|
18
29
|
|
19
30
|
def json(self, **kwargs: typing.Any) -> str:
|
20
31
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
@@ -12,8 +12,12 @@ except ImportError:
|
|
12
12
|
|
13
13
|
|
14
14
|
class EmbeddingResponse(pydantic.BaseModel):
|
15
|
-
embedding: typing.List[float]
|
16
|
-
|
15
|
+
embedding: typing.List[float] = pydantic.Field()
|
16
|
+
"""
|
17
|
+
The embedding of the processed data.
|
18
|
+
"""
|
19
|
+
|
20
|
+
elapsed_time: typing.Optional[float] = None
|
17
21
|
|
18
22
|
def json(self, **kwargs: typing.Any) -> str:
|
19
23
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
@@ -0,0 +1,35 @@
|
|
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
|
+
|
8
|
+
try:
|
9
|
+
import pydantic.v1 as pydantic # type: ignore
|
10
|
+
except ImportError:
|
11
|
+
import pydantic # type: ignore
|
12
|
+
|
13
|
+
|
14
|
+
class ExtractResponse(pydantic.BaseModel):
|
15
|
+
output: typing.Any
|
16
|
+
metadata: typing.Dict[str, typing.Any] = pydantic.Field()
|
17
|
+
"""
|
18
|
+
Metadata related to the extraction process.
|
19
|
+
"""
|
20
|
+
|
21
|
+
elapsed_time: typing.Optional[float] = None
|
22
|
+
|
23
|
+
def json(self, **kwargs: typing.Any) -> str:
|
24
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
25
|
+
return super().json(**kwargs_with_defaults)
|
26
|
+
|
27
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
28
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
29
|
+
return super().dict(**kwargs_with_defaults)
|
30
|
+
|
31
|
+
class Config:
|
32
|
+
frozen = True
|
33
|
+
smart_union = True
|
34
|
+
extra = pydantic.Extra.allow
|
35
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -13,11 +13,13 @@ except ImportError:
|
|
13
13
|
|
14
14
|
|
15
15
|
class GenerationResponse(pydantic.BaseModel):
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
response: typing.Dict[str, typing.Any] = pydantic.Field()
|
17
|
+
"""
|
18
|
+
The response from the generation.
|
19
|
+
"""
|
20
|
+
|
20
21
|
metadata: typing.Optional[Metadata] = None
|
22
|
+
elapsed_time: typing.Optional[float] = None
|
21
23
|
|
22
24
|
def json(self, **kwargs: typing.Any) -> str:
|
23
25
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
mixpeek/types/message.py
CHANGED
@@ -12,8 +12,15 @@ except ImportError:
|
|
12
12
|
|
13
13
|
|
14
14
|
class Message(pydantic.BaseModel):
|
15
|
-
role: str
|
16
|
-
|
15
|
+
role: str = pydantic.Field()
|
16
|
+
"""
|
17
|
+
The role of the message sender.
|
18
|
+
"""
|
19
|
+
|
20
|
+
content: str = pydantic.Field()
|
21
|
+
"""
|
22
|
+
The content of the message.
|
23
|
+
"""
|
17
24
|
|
18
25
|
def json(self, **kwargs: typing.Any) -> str:
|
19
26
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
mixpeek/types/metadata.py
CHANGED
@@ -13,11 +13,9 @@ except ImportError:
|
|
13
13
|
|
14
14
|
|
15
15
|
class Metadata(pydantic.BaseModel):
|
16
|
-
elapsed_time: typing.Optional[float] = None
|
17
16
|
total_tokens: typing.Optional[int] = None
|
18
17
|
generation_id: typing.Optional[str] = None
|
19
18
|
model: typing.Optional[Model] = None
|
20
|
-
created_at: typing.Optional[dt.datetime] = None
|
21
19
|
|
22
20
|
def json(self, **kwargs: typing.Any) -> str:
|
23
21
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
mixpeek/types/modality.py
CHANGED
mixpeek/types/model.py
CHANGED
@@ -13,8 +13,15 @@ except ImportError:
|
|
13
13
|
|
14
14
|
|
15
15
|
class Model(pydantic.BaseModel):
|
16
|
-
provider: str
|
17
|
-
|
16
|
+
provider: str = pydantic.Field()
|
17
|
+
"""
|
18
|
+
The provider of the model.
|
19
|
+
"""
|
20
|
+
|
21
|
+
model: Models = pydantic.Field()
|
22
|
+
"""
|
23
|
+
The model to be used.
|
24
|
+
"""
|
18
25
|
|
19
26
|
def json(self, **kwargs: typing.Any) -> str:
|
20
27
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
@@ -0,0 +1,49 @@
|
|
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 .connection import Connection
|
8
|
+
from .source_destination_mapping import SourceDestinationMapping
|
9
|
+
|
10
|
+
try:
|
11
|
+
import pydantic.v1 as pydantic # type: ignore
|
12
|
+
except ImportError:
|
13
|
+
import pydantic # type: ignore
|
14
|
+
|
15
|
+
|
16
|
+
class PipelineResponse(pydantic.BaseModel):
|
17
|
+
pipeline_id: typing.Optional[str] = pydantic.Field(default=None)
|
18
|
+
"""
|
19
|
+
The ID of the pipeline
|
20
|
+
"""
|
21
|
+
|
22
|
+
enabled: typing.Optional[bool] = None
|
23
|
+
connection: typing.Optional[Connection] = None
|
24
|
+
source_destination_mappings: typing.List[SourceDestinationMapping] = pydantic.Field()
|
25
|
+
"""
|
26
|
+
The source-destination mappings
|
27
|
+
"""
|
28
|
+
|
29
|
+
metadata: typing.Optional[typing.Dict[str, typing.Any]] = None
|
30
|
+
created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
|
31
|
+
"""
|
32
|
+
The creation time
|
33
|
+
"""
|
34
|
+
|
35
|
+
last_run: typing.Optional[dt.datetime] = None
|
36
|
+
|
37
|
+
def json(self, **kwargs: typing.Any) -> str:
|
38
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
39
|
+
return super().json(**kwargs_with_defaults)
|
40
|
+
|
41
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
42
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
43
|
+
return super().dict(**kwargs_with_defaults)
|
44
|
+
|
45
|
+
class Config:
|
46
|
+
frozen = True
|
47
|
+
smart_union = True
|
48
|
+
extra = pydantic.Extra.allow
|
49
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -0,0 +1,32 @@
|
|
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
|
+
|
8
|
+
try:
|
9
|
+
import pydantic.v1 as pydantic # type: ignore
|
10
|
+
except ImportError:
|
11
|
+
import pydantic # type: ignore
|
12
|
+
|
13
|
+
|
14
|
+
class PipelineTaskResponse(pydantic.BaseModel):
|
15
|
+
task_id: str = pydantic.Field()
|
16
|
+
"""
|
17
|
+
The ID of the task
|
18
|
+
"""
|
19
|
+
|
20
|
+
def json(self, **kwargs: typing.Any) -> str:
|
21
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
22
|
+
return super().json(**kwargs_with_defaults)
|
23
|
+
|
24
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
25
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
26
|
+
return super().dict(**kwargs_with_defaults)
|
27
|
+
|
28
|
+
class Config:
|
29
|
+
frozen = True
|
30
|
+
smart_union = True
|
31
|
+
extra = pydantic.Extra.allow
|
32
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
mixpeek/types/source.py
CHANGED
@@ -13,9 +13,20 @@ except ImportError:
|
|
13
13
|
|
14
14
|
|
15
15
|
class Source(pydantic.BaseModel):
|
16
|
-
field: str
|
17
|
-
|
18
|
-
|
16
|
+
field: str = pydantic.Field()
|
17
|
+
"""
|
18
|
+
The field name
|
19
|
+
"""
|
20
|
+
|
21
|
+
type: FieldType = pydantic.Field()
|
22
|
+
"""
|
23
|
+
The type of the field
|
24
|
+
"""
|
25
|
+
|
26
|
+
settings: typing.Dict[str, typing.Any] = pydantic.Field()
|
27
|
+
"""
|
28
|
+
The settings for the field
|
29
|
+
"""
|
19
30
|
|
20
31
|
def json(self, **kwargs: typing.Any) -> str:
|
21
32
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
@@ -14,9 +14,20 @@ except ImportError:
|
|
14
14
|
|
15
15
|
|
16
16
|
class SourceDestinationMapping(pydantic.BaseModel):
|
17
|
-
embedding_model: str
|
18
|
-
|
19
|
-
|
17
|
+
embedding_model: str = pydantic.Field()
|
18
|
+
"""
|
19
|
+
The embedding model
|
20
|
+
"""
|
21
|
+
|
22
|
+
source: Source = pydantic.Field()
|
23
|
+
"""
|
24
|
+
The source
|
25
|
+
"""
|
26
|
+
|
27
|
+
destination: Destination = pydantic.Field()
|
28
|
+
"""
|
29
|
+
The destination
|
30
|
+
"""
|
20
31
|
|
21
32
|
def json(self, **kwargs: typing.Any) -> str:
|
22
33
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|