mixpeek 0.6.1__py3-none-any.whl → 0.6.5__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 +24 -15
- mixpeek/base_client.py +883 -22
- mixpeek/client.py +7 -7
- mixpeek/core/client_wrapper.py +1 -1
- mixpeek/environment.py +7 -0
- mixpeek/{pipelines → pipeline}/client.py +60 -132
- mixpeek/storage/__init__.py +3 -0
- mixpeek/storage/client.py +7 -116
- mixpeek/storage/sample/client.py +282 -0
- mixpeek/types/__init__.py +18 -10
- mixpeek/types/{embedding_request.py → api_key.py} +4 -5
- mixpeek/types/configs_response.py +14 -3
- mixpeek/types/connection.py +1 -1
- mixpeek/types/{field_schema.py → destination.py} +15 -6
- mixpeek/types/embedding_response.py +6 -2
- mixpeek/types/extract_response.py +39 -0
- mixpeek/types/field_type.py +1 -1
- 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 +10 -2
- mixpeek/types/models.py +5 -0
- mixpeek/types/pipeline_response.py +19 -9
- mixpeek/types/{configs_request.py → pipeline_task_response.py} +5 -4
- mixpeek/types/source.py +43 -0
- mixpeek/types/source_destination_mapping.py +44 -0
- mixpeek/types/user.py +36 -0
- mixpeek/types/{destination_schema.py → workflow_code_response.py} +2 -4
- mixpeek/user/client.py +308 -0
- mixpeek/{workflows → workflow}/client.py +127 -10
- {mixpeek-0.6.1.dist-info → mixpeek-0.6.5.dist-info}/METADATA +1 -1
- mixpeek-0.6.5.dist-info/RECORD +75 -0
- mixpeek/generators/client.py +0 -239
- mixpeek/parse/client.py +0 -349
- mixpeek/parse_client.py +0 -14
- mixpeek/types/source_schema.py +0 -32
- mixpeek-0.6.1.dist-info/RECORD +0 -71
- /mixpeek/{generators → pipeline}/__init__.py +0 -0
- /mixpeek/{parse → storage/sample}/__init__.py +0 -0
- /mixpeek/{pipelines → user}/__init__.py +0 -0
- /mixpeek/{workflows → workflow}/__init__.py +0 -0
- {mixpeek-0.6.1.dist-info → mixpeek-0.6.5.dist-info}/LICENSE +0 -0
- {mixpeek-0.6.1.dist-info → mixpeek-0.6.5.dist-info}/WHEEL +0 -0
@@ -0,0 +1,282 @@
|
|
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.error_response import ErrorResponse
|
19
|
+
from ...types.http_validation_error import HttpValidationError
|
20
|
+
|
21
|
+
try:
|
22
|
+
import pydantic.v1 as pydantic # type: ignore
|
23
|
+
except ImportError:
|
24
|
+
import pydantic # type: ignore
|
25
|
+
|
26
|
+
|
27
|
+
class SampleClient:
|
28
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
29
|
+
self._client_wrapper = client_wrapper
|
30
|
+
|
31
|
+
def database(self, database_name: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
|
32
|
+
"""
|
33
|
+
Parameters:
|
34
|
+
- database_name: str.
|
35
|
+
|
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.storage.sample.database(
|
46
|
+
database_name="database_name",
|
47
|
+
)
|
48
|
+
"""
|
49
|
+
_response = self._client_wrapper.httpx_client.request(
|
50
|
+
"GET",
|
51
|
+
urllib.parse.urljoin(
|
52
|
+
f"{self._client_wrapper.get_base_url()}/", f"storage/sample/database/{jsonable_encoder(database_name)}"
|
53
|
+
),
|
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(typing.Any, _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 collection(
|
92
|
+
self, collection_name: str, *, request_options: typing.Optional[RequestOptions] = None
|
93
|
+
) -> typing.Any:
|
94
|
+
"""
|
95
|
+
Parameters:
|
96
|
+
- collection_name: str.
|
97
|
+
|
98
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
99
|
+
---
|
100
|
+
from mixpeek.client import Mixpeek
|
101
|
+
|
102
|
+
client = Mixpeek(
|
103
|
+
authorization="YOUR_AUTHORIZATION",
|
104
|
+
index_id="YOUR_INDEX_ID",
|
105
|
+
api_key="YOUR_API_KEY",
|
106
|
+
)
|
107
|
+
client.storage.sample.collection(
|
108
|
+
collection_name="collection_name",
|
109
|
+
)
|
110
|
+
"""
|
111
|
+
_response = self._client_wrapper.httpx_client.request(
|
112
|
+
"GET",
|
113
|
+
urllib.parse.urljoin(
|
114
|
+
f"{self._client_wrapper.get_base_url()}/",
|
115
|
+
f"storage/sample/collection/{jsonable_encoder(collection_name)}",
|
116
|
+
),
|
117
|
+
params=jsonable_encoder(
|
118
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
119
|
+
),
|
120
|
+
headers=jsonable_encoder(
|
121
|
+
remove_none_from_dict(
|
122
|
+
{
|
123
|
+
**self._client_wrapper.get_headers(),
|
124
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
125
|
+
}
|
126
|
+
)
|
127
|
+
),
|
128
|
+
timeout=request_options.get("timeout_in_seconds")
|
129
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
130
|
+
else self._client_wrapper.get_timeout(),
|
131
|
+
retries=0,
|
132
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
133
|
+
)
|
134
|
+
if 200 <= _response.status_code < 300:
|
135
|
+
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
|
136
|
+
if _response.status_code == 400:
|
137
|
+
raise BadRequestError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
138
|
+
if _response.status_code == 401:
|
139
|
+
raise UnauthorizedError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
140
|
+
if _response.status_code == 403:
|
141
|
+
raise ForbiddenError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
142
|
+
if _response.status_code == 404:
|
143
|
+
raise NotFoundError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
144
|
+
if _response.status_code == 422:
|
145
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
146
|
+
if _response.status_code == 500:
|
147
|
+
raise InternalServerError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
148
|
+
try:
|
149
|
+
_response_json = _response.json()
|
150
|
+
except JSONDecodeError:
|
151
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
152
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
153
|
+
|
154
|
+
|
155
|
+
class AsyncSampleClient:
|
156
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
157
|
+
self._client_wrapper = client_wrapper
|
158
|
+
|
159
|
+
async def database(
|
160
|
+
self, database_name: str, *, request_options: typing.Optional[RequestOptions] = None
|
161
|
+
) -> typing.Any:
|
162
|
+
"""
|
163
|
+
Parameters:
|
164
|
+
- database_name: str.
|
165
|
+
|
166
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
167
|
+
---
|
168
|
+
from mixpeek.client import AsyncMixpeek
|
169
|
+
|
170
|
+
client = AsyncMixpeek(
|
171
|
+
authorization="YOUR_AUTHORIZATION",
|
172
|
+
index_id="YOUR_INDEX_ID",
|
173
|
+
api_key="YOUR_API_KEY",
|
174
|
+
)
|
175
|
+
await client.storage.sample.database(
|
176
|
+
database_name="database_name",
|
177
|
+
)
|
178
|
+
"""
|
179
|
+
_response = await self._client_wrapper.httpx_client.request(
|
180
|
+
"GET",
|
181
|
+
urllib.parse.urljoin(
|
182
|
+
f"{self._client_wrapper.get_base_url()}/", f"storage/sample/database/{jsonable_encoder(database_name)}"
|
183
|
+
),
|
184
|
+
params=jsonable_encoder(
|
185
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
186
|
+
),
|
187
|
+
headers=jsonable_encoder(
|
188
|
+
remove_none_from_dict(
|
189
|
+
{
|
190
|
+
**self._client_wrapper.get_headers(),
|
191
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
192
|
+
}
|
193
|
+
)
|
194
|
+
),
|
195
|
+
timeout=request_options.get("timeout_in_seconds")
|
196
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
197
|
+
else self._client_wrapper.get_timeout(),
|
198
|
+
retries=0,
|
199
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
200
|
+
)
|
201
|
+
if 200 <= _response.status_code < 300:
|
202
|
+
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
|
203
|
+
if _response.status_code == 400:
|
204
|
+
raise BadRequestError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
205
|
+
if _response.status_code == 401:
|
206
|
+
raise UnauthorizedError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
207
|
+
if _response.status_code == 403:
|
208
|
+
raise ForbiddenError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
209
|
+
if _response.status_code == 404:
|
210
|
+
raise NotFoundError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
211
|
+
if _response.status_code == 422:
|
212
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
213
|
+
if _response.status_code == 500:
|
214
|
+
raise InternalServerError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
215
|
+
try:
|
216
|
+
_response_json = _response.json()
|
217
|
+
except JSONDecodeError:
|
218
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
219
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
220
|
+
|
221
|
+
async def collection(
|
222
|
+
self, collection_name: str, *, request_options: typing.Optional[RequestOptions] = None
|
223
|
+
) -> typing.Any:
|
224
|
+
"""
|
225
|
+
Parameters:
|
226
|
+
- collection_name: str.
|
227
|
+
|
228
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
229
|
+
---
|
230
|
+
from mixpeek.client import AsyncMixpeek
|
231
|
+
|
232
|
+
client = AsyncMixpeek(
|
233
|
+
authorization="YOUR_AUTHORIZATION",
|
234
|
+
index_id="YOUR_INDEX_ID",
|
235
|
+
api_key="YOUR_API_KEY",
|
236
|
+
)
|
237
|
+
await client.storage.sample.collection(
|
238
|
+
collection_name="collection_name",
|
239
|
+
)
|
240
|
+
"""
|
241
|
+
_response = await self._client_wrapper.httpx_client.request(
|
242
|
+
"GET",
|
243
|
+
urllib.parse.urljoin(
|
244
|
+
f"{self._client_wrapper.get_base_url()}/",
|
245
|
+
f"storage/sample/collection/{jsonable_encoder(collection_name)}",
|
246
|
+
),
|
247
|
+
params=jsonable_encoder(
|
248
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
249
|
+
),
|
250
|
+
headers=jsonable_encoder(
|
251
|
+
remove_none_from_dict(
|
252
|
+
{
|
253
|
+
**self._client_wrapper.get_headers(),
|
254
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
255
|
+
}
|
256
|
+
)
|
257
|
+
),
|
258
|
+
timeout=request_options.get("timeout_in_seconds")
|
259
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
260
|
+
else self._client_wrapper.get_timeout(),
|
261
|
+
retries=0,
|
262
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
263
|
+
)
|
264
|
+
if 200 <= _response.status_code < 300:
|
265
|
+
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
|
266
|
+
if _response.status_code == 400:
|
267
|
+
raise BadRequestError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
268
|
+
if _response.status_code == 401:
|
269
|
+
raise UnauthorizedError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
270
|
+
if _response.status_code == 403:
|
271
|
+
raise ForbiddenError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
272
|
+
if _response.status_code == 404:
|
273
|
+
raise NotFoundError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
274
|
+
if _response.status_code == 422:
|
275
|
+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
276
|
+
if _response.status_code == 500:
|
277
|
+
raise InternalServerError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
278
|
+
try:
|
279
|
+
_response_json = _response.json()
|
280
|
+
except JSONDecodeError:
|
281
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
282
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
mixpeek/types/__init__.py
CHANGED
@@ -1,17 +1,16 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
+
from .api_key import ApiKey
|
3
4
|
from .audio_params import AudioParams
|
4
|
-
from .configs_request import ConfigsRequest
|
5
5
|
from .configs_response import ConfigsResponse
|
6
6
|
from .connection import Connection
|
7
7
|
from .connection_engine import ConnectionEngine
|
8
8
|
from .csv_params import CsvParams
|
9
|
-
from .
|
10
|
-
from .embedding_request import EmbeddingRequest
|
9
|
+
from .destination import Destination
|
11
10
|
from .embedding_response import EmbeddingResponse
|
12
11
|
from .error_message import ErrorMessage
|
13
12
|
from .error_response import ErrorResponse
|
14
|
-
from .
|
13
|
+
from .extract_response import ExtractResponse
|
15
14
|
from .field_type import FieldType
|
16
15
|
from .generation_response import GenerationResponse
|
17
16
|
from .html_params import HtmlParams
|
@@ -21,33 +20,37 @@ from .message import Message
|
|
21
20
|
from .metadata import Metadata
|
22
21
|
from .modality import Modality
|
23
22
|
from .model import Model
|
23
|
+
from .models import Models
|
24
24
|
from .pdf_params import PdfParams
|
25
25
|
from .pipeline_response import PipelineResponse
|
26
|
+
from .pipeline_task_response import PipelineTaskResponse
|
26
27
|
from .ppt_params import PptParams
|
27
28
|
from .pptx_params import PptxParams
|
28
29
|
from .settings import Settings
|
29
|
-
from .
|
30
|
+
from .source import Source
|
31
|
+
from .source_destination_mapping import SourceDestinationMapping
|
30
32
|
from .txt_params import TxtParams
|
33
|
+
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
|
37
41
|
|
38
42
|
__all__ = [
|
43
|
+
"ApiKey",
|
39
44
|
"AudioParams",
|
40
|
-
"ConfigsRequest",
|
41
45
|
"ConfigsResponse",
|
42
46
|
"Connection",
|
43
47
|
"ConnectionEngine",
|
44
48
|
"CsvParams",
|
45
|
-
"
|
46
|
-
"EmbeddingRequest",
|
49
|
+
"Destination",
|
47
50
|
"EmbeddingResponse",
|
48
51
|
"ErrorMessage",
|
49
52
|
"ErrorResponse",
|
50
|
-
"
|
53
|
+
"ExtractResponse",
|
51
54
|
"FieldType",
|
52
55
|
"GenerationResponse",
|
53
56
|
"HtmlParams",
|
@@ -57,16 +60,21 @@ __all__ = [
|
|
57
60
|
"Metadata",
|
58
61
|
"Modality",
|
59
62
|
"Model",
|
63
|
+
"Models",
|
60
64
|
"PdfParams",
|
61
65
|
"PipelineResponse",
|
66
|
+
"PipelineTaskResponse",
|
62
67
|
"PptParams",
|
63
68
|
"PptxParams",
|
64
69
|
"Settings",
|
65
|
-
"
|
70
|
+
"Source",
|
71
|
+
"SourceDestinationMapping",
|
66
72
|
"TxtParams",
|
73
|
+
"User",
|
67
74
|
"ValidationError",
|
68
75
|
"ValidationErrorLocItem",
|
69
76
|
"VideoParams",
|
77
|
+
"WorkflowCodeResponse",
|
70
78
|
"WorkflowResponse",
|
71
79
|
"WorkflowSettings",
|
72
80
|
"XlsxParams",
|
@@ -4,7 +4,6 @@ import datetime as dt
|
|
4
4
|
import typing
|
5
5
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
|
-
from .modality import Modality
|
8
7
|
|
9
8
|
try:
|
10
9
|
import pydantic.v1 as pydantic # type: ignore
|
@@ -12,10 +11,10 @@ except ImportError:
|
|
12
11
|
import pydantic # type: ignore
|
13
12
|
|
14
13
|
|
15
|
-
class
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
class ApiKey(pydantic.BaseModel):
|
15
|
+
key: typing.Optional[str] = None
|
16
|
+
name: typing.Optional[str] = None
|
17
|
+
created_at: typing.Optional[dt.datetime] = None
|
19
18
|
|
20
19
|
def json(self, **kwargs: typing.Any) -> str:
|
21
20
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
@@ -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/connection.py
CHANGED
@@ -18,7 +18,7 @@ class Connection(pydantic.BaseModel):
|
|
18
18
|
port: typing.Optional[int] = None
|
19
19
|
database: str
|
20
20
|
username: str
|
21
|
-
password:
|
21
|
+
password: str
|
22
22
|
extra_params: typing.Optional[typing.Dict[str, typing.Any]] = None
|
23
23
|
|
24
24
|
def json(self, **kwargs: typing.Any) -> str:
|
@@ -4,7 +4,6 @@ import datetime as dt
|
|
4
4
|
import typing
|
5
5
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
|
-
from .field_type import FieldType
|
8
7
|
|
9
8
|
try:
|
10
9
|
import pydantic.v1 as pydantic # type: ignore
|
@@ -12,11 +11,21 @@ except ImportError:
|
|
12
11
|
import pydantic # type: ignore
|
13
12
|
|
14
13
|
|
15
|
-
class
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
14
|
+
class Destination(pydantic.BaseModel):
|
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
|
+
"""
|
20
29
|
|
21
30
|
def json(self, **kwargs: typing.Any) -> str:
|
22
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,39 @@
|
|
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.List[typing.Any] = pydantic.Field()
|
16
|
+
"""
|
17
|
+
The output of the extraction process.
|
18
|
+
"""
|
19
|
+
|
20
|
+
metadata: typing.Dict[str, typing.Any] = pydantic.Field()
|
21
|
+
"""
|
22
|
+
Metadata related to the extraction process.
|
23
|
+
"""
|
24
|
+
|
25
|
+
elapsed_time: typing.Optional[float] = None
|
26
|
+
|
27
|
+
def json(self, **kwargs: typing.Any) -> str:
|
28
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
29
|
+
return super().json(**kwargs_with_defaults)
|
30
|
+
|
31
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
32
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
33
|
+
return super().dict(**kwargs_with_defaults)
|
34
|
+
|
35
|
+
class Config:
|
36
|
+
frozen = True
|
37
|
+
smart_union = True
|
38
|
+
extra = pydantic.Extra.allow
|
39
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
mixpeek/types/field_type.py
CHANGED
@@ -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
@@ -4,6 +4,7 @@ import datetime as dt
|
|
4
4
|
import typing
|
5
5
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
|
+
from .models import Models
|
7
8
|
|
8
9
|
try:
|
9
10
|
import pydantic.v1 as pydantic # type: ignore
|
@@ -12,8 +13,15 @@ except ImportError:
|
|
12
13
|
|
13
14
|
|
14
15
|
class Model(pydantic.BaseModel):
|
15
|
-
provider: str
|
16
|
-
|
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
|
+
"""
|
17
25
|
|
18
26
|
def json(self, **kwargs: typing.Any) -> str:
|
19
27
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
mixpeek/types/models.py
ADDED
@@ -5,8 +5,7 @@ import typing
|
|
5
5
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
7
|
from .connection import Connection
|
8
|
-
from .
|
9
|
-
from .source_schema import SourceSchema
|
8
|
+
from .source_destination_mapping import SourceDestinationMapping
|
10
9
|
|
11
10
|
try:
|
12
11
|
import pydantic.v1 as pydantic # type: ignore
|
@@ -15,14 +14,25 @@ except ImportError:
|
|
15
14
|
|
16
15
|
|
17
16
|
class PipelineResponse(pydantic.BaseModel):
|
18
|
-
pipeline_id: str
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
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
|
+
|
25
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
|
26
36
|
|
27
37
|
def json(self, **kwargs: typing.Any) -> str:
|
28
38
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|