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.
Files changed (81) hide show
  1. mixpeek/__init__.py +100 -71
  2. mixpeek/base_client.py +155 -0
  3. mixpeek/client.py +65 -0
  4. mixpeek/core/__init__.py +25 -0
  5. mixpeek/core/api_error.py +15 -0
  6. mixpeek/core/client_wrapper.py +83 -0
  7. mixpeek/core/datetime_utils.py +28 -0
  8. mixpeek/core/file.py +38 -0
  9. mixpeek/core/http_client.py +130 -0
  10. mixpeek/core/jsonable_encoder.py +103 -0
  11. mixpeek/core/remove_none_from_dict.py +11 -0
  12. mixpeek/core/request_options.py +32 -0
  13. mixpeek/embed/__init__.py +2 -0
  14. mixpeek/embed/client.py +350 -0
  15. mixpeek/environment.py +7 -0
  16. mixpeek/errors/__init__.py +17 -0
  17. mixpeek/errors/bad_request_error.py +9 -0
  18. mixpeek/errors/forbidden_error.py +9 -0
  19. mixpeek/errors/internal_server_error.py +9 -0
  20. mixpeek/errors/not_found_error.py +9 -0
  21. mixpeek/errors/unauthorized_error.py +9 -0
  22. mixpeek/errors/unprocessable_entity_error.py +9 -0
  23. mixpeek/extract/__init__.py +2 -0
  24. mixpeek/extract/client.py +347 -0
  25. mixpeek/generators/__init__.py +2 -0
  26. mixpeek/generators/client.py +237 -0
  27. mixpeek/parse/__init__.py +2 -0
  28. mixpeek/parse/client.py +111 -0
  29. mixpeek/parse_client.py +14 -0
  30. mixpeek/pipelines/__init__.py +2 -0
  31. mixpeek/pipelines/client.py +468 -0
  32. mixpeek/py.typed +0 -0
  33. mixpeek/storage/__init__.py +2 -0
  34. mixpeek/storage/client.py +250 -0
  35. mixpeek/types/__init__.py +73 -0
  36. mixpeek/types/api_key.py +31 -0
  37. mixpeek/types/audio_params.py +29 -0
  38. mixpeek/types/configs_response.py +31 -0
  39. mixpeek/types/connection.py +36 -0
  40. mixpeek/types/connection_engine.py +5 -0
  41. mixpeek/types/csv_params.py +29 -0
  42. mixpeek/types/destination.py +31 -0
  43. mixpeek/types/embedding_response.py +30 -0
  44. mixpeek/types/error_message.py +29 -0
  45. mixpeek/types/error_response.py +30 -0
  46. mixpeek/types/field_type.py +5 -0
  47. mixpeek/types/generation_response.py +34 -0
  48. mixpeek/types/html_params.py +29 -0
  49. mixpeek/types/http_validation_error.py +30 -0
  50. mixpeek/types/image_params.py +32 -0
  51. mixpeek/types/message.py +30 -0
  52. mixpeek/types/metadata.py +34 -0
  53. mixpeek/types/modality.py +5 -0
  54. mixpeek/types/model.py +31 -0
  55. mixpeek/types/models.py +5 -0
  56. mixpeek/types/pdf_params.py +41 -0
  57. mixpeek/types/ppt_params.py +27 -0
  58. mixpeek/types/pptx_params.py +27 -0
  59. mixpeek/types/settings.py +35 -0
  60. mixpeek/types/source.py +32 -0
  61. mixpeek/types/source_destination_mapping.py +33 -0
  62. mixpeek/types/txt_params.py +27 -0
  63. mixpeek/types/user.py +36 -0
  64. mixpeek/types/validation_error.py +32 -0
  65. mixpeek/types/validation_error_loc_item.py +5 -0
  66. mixpeek/types/video_params.py +27 -0
  67. mixpeek/types/workflow_response.py +32 -0
  68. mixpeek/types/workflow_settings.py +30 -0
  69. mixpeek/types/xlsx_params.py +29 -0
  70. mixpeek/users/__init__.py +2 -0
  71. mixpeek/users/client.py +308 -0
  72. mixpeek/version.py +4 -0
  73. mixpeek/workflows/__init__.py +2 -0
  74. mixpeek/workflows/client.py +536 -0
  75. mixpeek-0.2.dist-info/LICENSE.rst → mixpeek-0.6.2.dist-info/LICENSE +10 -9
  76. mixpeek-0.6.2.dist-info/METADATA +145 -0
  77. mixpeek-0.6.2.dist-info/RECORD +78 -0
  78. {mixpeek-0.2.dist-info → mixpeek-0.6.2.dist-info}/WHEEL +1 -2
  79. mixpeek-0.2.dist-info/METADATA +0 -12
  80. mixpeek-0.2.dist-info/RECORD +0 -6
  81. mixpeek-0.2.dist-info/top_level.txt +0 -1
@@ -0,0 +1,250 @@
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 StorageClient:
28
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
29
+ self._client_wrapper = client_wrapper
30
+
31
+ def test_connection(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
32
+ """
33
+ Parameters:
34
+ - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
35
+ ---
36
+ from mixpeek.client import Mixpeek
37
+
38
+ client = Mixpeek(
39
+ authorization="YOUR_AUTHORIZATION",
40
+ index_id="YOUR_INDEX_ID",
41
+ api_key="YOUR_API_KEY",
42
+ )
43
+ client.storage.test_connection()
44
+ """
45
+ _response = self._client_wrapper.httpx_client.request(
46
+ "GET",
47
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "storage/connect"),
48
+ params=jsonable_encoder(
49
+ request_options.get("additional_query_parameters") if request_options is not None else None
50
+ ),
51
+ headers=jsonable_encoder(
52
+ remove_none_from_dict(
53
+ {
54
+ **self._client_wrapper.get_headers(),
55
+ **(request_options.get("additional_headers", {}) if request_options is not None else {}),
56
+ }
57
+ )
58
+ ),
59
+ timeout=request_options.get("timeout_in_seconds")
60
+ if request_options is not None and request_options.get("timeout_in_seconds") is not None
61
+ else self._client_wrapper.get_timeout(),
62
+ retries=0,
63
+ max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
64
+ )
65
+ if 200 <= _response.status_code < 300:
66
+ return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
67
+ if _response.status_code == 400:
68
+ raise BadRequestError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
69
+ if _response.status_code == 401:
70
+ raise UnauthorizedError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
71
+ if _response.status_code == 403:
72
+ raise ForbiddenError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
73
+ if _response.status_code == 404:
74
+ raise NotFoundError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
75
+ if _response.status_code == 422:
76
+ raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
77
+ if _response.status_code == 500:
78
+ raise InternalServerError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
79
+ try:
80
+ _response_json = _response.json()
81
+ except JSONDecodeError:
82
+ raise ApiError(status_code=_response.status_code, body=_response.text)
83
+ raise ApiError(status_code=_response.status_code, body=_response_json)
84
+
85
+ def sample_database(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
86
+ """
87
+ Parameters:
88
+ - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
89
+ ---
90
+ from mixpeek.client import Mixpeek
91
+
92
+ client = Mixpeek(
93
+ authorization="YOUR_AUTHORIZATION",
94
+ index_id="YOUR_INDEX_ID",
95
+ api_key="YOUR_API_KEY",
96
+ )
97
+ client.storage.sample_database()
98
+ """
99
+ _response = self._client_wrapper.httpx_client.request(
100
+ "GET",
101
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "storage/sample/database"),
102
+ params=jsonable_encoder(
103
+ request_options.get("additional_query_parameters") if request_options is not None else None
104
+ ),
105
+ headers=jsonable_encoder(
106
+ remove_none_from_dict(
107
+ {
108
+ **self._client_wrapper.get_headers(),
109
+ **(request_options.get("additional_headers", {}) if request_options is not None else {}),
110
+ }
111
+ )
112
+ ),
113
+ timeout=request_options.get("timeout_in_seconds")
114
+ if request_options is not None and request_options.get("timeout_in_seconds") is not None
115
+ else self._client_wrapper.get_timeout(),
116
+ retries=0,
117
+ max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
118
+ )
119
+ if 200 <= _response.status_code < 300:
120
+ return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
121
+ if _response.status_code == 400:
122
+ raise BadRequestError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
123
+ if _response.status_code == 401:
124
+ raise UnauthorizedError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
125
+ if _response.status_code == 403:
126
+ raise ForbiddenError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
127
+ if _response.status_code == 404:
128
+ raise NotFoundError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
129
+ if _response.status_code == 422:
130
+ raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
131
+ if _response.status_code == 500:
132
+ raise InternalServerError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
133
+ try:
134
+ _response_json = _response.json()
135
+ except JSONDecodeError:
136
+ raise ApiError(status_code=_response.status_code, body=_response.text)
137
+ raise ApiError(status_code=_response.status_code, body=_response_json)
138
+
139
+
140
+ class AsyncStorageClient:
141
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
142
+ self._client_wrapper = client_wrapper
143
+
144
+ async def test_connection(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
145
+ """
146
+ Parameters:
147
+ - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
148
+ ---
149
+ from mixpeek.client import AsyncMixpeek
150
+
151
+ client = AsyncMixpeek(
152
+ authorization="YOUR_AUTHORIZATION",
153
+ index_id="YOUR_INDEX_ID",
154
+ api_key="YOUR_API_KEY",
155
+ )
156
+ await client.storage.test_connection()
157
+ """
158
+ _response = await self._client_wrapper.httpx_client.request(
159
+ "GET",
160
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "storage/connect"),
161
+ params=jsonable_encoder(
162
+ request_options.get("additional_query_parameters") if request_options is not None else None
163
+ ),
164
+ headers=jsonable_encoder(
165
+ remove_none_from_dict(
166
+ {
167
+ **self._client_wrapper.get_headers(),
168
+ **(request_options.get("additional_headers", {}) if request_options is not None else {}),
169
+ }
170
+ )
171
+ ),
172
+ timeout=request_options.get("timeout_in_seconds")
173
+ if request_options is not None and request_options.get("timeout_in_seconds") is not None
174
+ else self._client_wrapper.get_timeout(),
175
+ retries=0,
176
+ max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
177
+ )
178
+ if 200 <= _response.status_code < 300:
179
+ return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
180
+ if _response.status_code == 400:
181
+ raise BadRequestError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
182
+ if _response.status_code == 401:
183
+ raise UnauthorizedError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
184
+ if _response.status_code == 403:
185
+ raise ForbiddenError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
186
+ if _response.status_code == 404:
187
+ raise NotFoundError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
188
+ if _response.status_code == 422:
189
+ raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
190
+ if _response.status_code == 500:
191
+ raise InternalServerError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
192
+ try:
193
+ _response_json = _response.json()
194
+ except JSONDecodeError:
195
+ raise ApiError(status_code=_response.status_code, body=_response.text)
196
+ raise ApiError(status_code=_response.status_code, body=_response_json)
197
+
198
+ async def sample_database(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
199
+ """
200
+ Parameters:
201
+ - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
202
+ ---
203
+ from mixpeek.client import AsyncMixpeek
204
+
205
+ client = AsyncMixpeek(
206
+ authorization="YOUR_AUTHORIZATION",
207
+ index_id="YOUR_INDEX_ID",
208
+ api_key="YOUR_API_KEY",
209
+ )
210
+ await client.storage.sample_database()
211
+ """
212
+ _response = await self._client_wrapper.httpx_client.request(
213
+ "GET",
214
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "storage/sample/database"),
215
+ params=jsonable_encoder(
216
+ request_options.get("additional_query_parameters") if request_options is not None else None
217
+ ),
218
+ headers=jsonable_encoder(
219
+ remove_none_from_dict(
220
+ {
221
+ **self._client_wrapper.get_headers(),
222
+ **(request_options.get("additional_headers", {}) if request_options is not None else {}),
223
+ }
224
+ )
225
+ ),
226
+ timeout=request_options.get("timeout_in_seconds")
227
+ if request_options is not None and request_options.get("timeout_in_seconds") is not None
228
+ else self._client_wrapper.get_timeout(),
229
+ retries=0,
230
+ max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
231
+ )
232
+ if 200 <= _response.status_code < 300:
233
+ return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
234
+ if _response.status_code == 400:
235
+ raise BadRequestError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
236
+ if _response.status_code == 401:
237
+ raise UnauthorizedError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
238
+ if _response.status_code == 403:
239
+ raise ForbiddenError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
240
+ if _response.status_code == 404:
241
+ raise NotFoundError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
242
+ if _response.status_code == 422:
243
+ raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
244
+ if _response.status_code == 500:
245
+ raise InternalServerError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
246
+ try:
247
+ _response_json = _response.json()
248
+ except JSONDecodeError:
249
+ raise ApiError(status_code=_response.status_code, body=_response.text)
250
+ raise ApiError(status_code=_response.status_code, body=_response_json)
@@ -0,0 +1,73 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from .api_key import ApiKey
4
+ from .audio_params import AudioParams
5
+ from .configs_response import ConfigsResponse
6
+ from .connection import Connection
7
+ from .connection_engine import ConnectionEngine
8
+ from .csv_params import CsvParams
9
+ from .destination import Destination
10
+ from .embedding_response import EmbeddingResponse
11
+ from .error_message import ErrorMessage
12
+ from .error_response import ErrorResponse
13
+ from .field_type import FieldType
14
+ from .generation_response import GenerationResponse
15
+ from .html_params import HtmlParams
16
+ from .http_validation_error import HttpValidationError
17
+ from .image_params import ImageParams
18
+ from .message import Message
19
+ from .metadata import Metadata
20
+ from .modality import Modality
21
+ from .model import Model
22
+ from .models import Models
23
+ from .pdf_params import PdfParams
24
+ from .ppt_params import PptParams
25
+ from .pptx_params import PptxParams
26
+ from .settings import Settings
27
+ from .source import Source
28
+ from .source_destination_mapping import SourceDestinationMapping
29
+ from .txt_params import TxtParams
30
+ from .user import User
31
+ from .validation_error import ValidationError
32
+ from .validation_error_loc_item import ValidationErrorLocItem
33
+ from .video_params import VideoParams
34
+ from .workflow_response import WorkflowResponse
35
+ from .workflow_settings import WorkflowSettings
36
+ from .xlsx_params import XlsxParams
37
+
38
+ __all__ = [
39
+ "ApiKey",
40
+ "AudioParams",
41
+ "ConfigsResponse",
42
+ "Connection",
43
+ "ConnectionEngine",
44
+ "CsvParams",
45
+ "Destination",
46
+ "EmbeddingResponse",
47
+ "ErrorMessage",
48
+ "ErrorResponse",
49
+ "FieldType",
50
+ "GenerationResponse",
51
+ "HtmlParams",
52
+ "HttpValidationError",
53
+ "ImageParams",
54
+ "Message",
55
+ "Metadata",
56
+ "Modality",
57
+ "Model",
58
+ "Models",
59
+ "PdfParams",
60
+ "PptParams",
61
+ "PptxParams",
62
+ "Settings",
63
+ "Source",
64
+ "SourceDestinationMapping",
65
+ "TxtParams",
66
+ "User",
67
+ "ValidationError",
68
+ "ValidationErrorLocItem",
69
+ "VideoParams",
70
+ "WorkflowResponse",
71
+ "WorkflowSettings",
72
+ "XlsxParams",
73
+ ]
@@ -0,0 +1,31 @@
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 ApiKey(pydantic.BaseModel):
15
+ key: typing.Optional[str] = None
16
+ name: typing.Optional[str] = None
17
+ created_at: typing.Optional[dt.datetime] = None
18
+
19
+ def json(self, **kwargs: typing.Any) -> str:
20
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21
+ return super().json(**kwargs_with_defaults)
22
+
23
+ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
24
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
25
+ return super().dict(**kwargs_with_defaults)
26
+
27
+ class Config:
28
+ frozen = True
29
+ smart_union = True
30
+ extra = pydantic.Extra.allow
31
+ json_encoders = {dt.datetime: serialize_datetime}
@@ -0,0 +1,29 @@
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 AudioParams(pydantic.BaseModel):
15
+ interval_range: typing.Optional[int] = None
16
+
17
+ def json(self, **kwargs: typing.Any) -> str:
18
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19
+ return super().json(**kwargs_with_defaults)
20
+
21
+ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23
+ return super().dict(**kwargs_with_defaults)
24
+
25
+ class Config:
26
+ frozen = True
27
+ smart_union = True
28
+ extra = pydantic.Extra.allow
29
+ json_encoders = {dt.datetime: serialize_datetime}
@@ -0,0 +1,31 @@
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 ConfigsResponse(pydantic.BaseModel):
15
+ dimensions: int
16
+ elapsed_time: float
17
+ token_size: int
18
+
19
+ def json(self, **kwargs: typing.Any) -> str:
20
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21
+ return super().json(**kwargs_with_defaults)
22
+
23
+ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
24
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
25
+ return super().dict(**kwargs_with_defaults)
26
+
27
+ class Config:
28
+ frozen = True
29
+ smart_union = True
30
+ extra = pydantic.Extra.allow
31
+ json_encoders = {dt.datetime: serialize_datetime}
@@ -0,0 +1,36 @@
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_engine import ConnectionEngine
8
+
9
+ try:
10
+ import pydantic.v1 as pydantic # type: ignore
11
+ except ImportError:
12
+ import pydantic # type: ignore
13
+
14
+
15
+ class Connection(pydantic.BaseModel):
16
+ engine: ConnectionEngine
17
+ host: str
18
+ port: typing.Optional[int] = None
19
+ database: str
20
+ username: str
21
+ password: str
22
+ extra_params: typing.Optional[typing.Dict[str, typing.Any]] = None
23
+
24
+ def json(self, **kwargs: typing.Any) -> str:
25
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
26
+ return super().json(**kwargs_with_defaults)
27
+
28
+ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
29
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
30
+ return super().dict(**kwargs_with_defaults)
31
+
32
+ class Config:
33
+ frozen = True
34
+ smart_union = True
35
+ extra = pydantic.Extra.allow
36
+ json_encoders = {dt.datetime: serialize_datetime}
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ ConnectionEngine = typing.Union[typing.AnyStr, typing.Literal["mongodb", "postgresql"]]
@@ -0,0 +1,29 @@
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 CsvParams(pydantic.BaseModel):
15
+ include_header: typing.Optional[bool] = None
16
+
17
+ def json(self, **kwargs: typing.Any) -> str:
18
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19
+ return super().json(**kwargs_with_defaults)
20
+
21
+ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23
+ return super().dict(**kwargs_with_defaults)
24
+
25
+ class Config:
26
+ frozen = True
27
+ smart_union = True
28
+ extra = pydantic.Extra.allow
29
+ json_encoders = {dt.datetime: serialize_datetime}
@@ -0,0 +1,31 @@
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 Destination(pydantic.BaseModel):
15
+ collection: str
16
+ field: str
17
+ embedding: str
18
+
19
+ def json(self, **kwargs: typing.Any) -> str:
20
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21
+ return super().json(**kwargs_with_defaults)
22
+
23
+ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
24
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
25
+ return super().dict(**kwargs_with_defaults)
26
+
27
+ class Config:
28
+ frozen = True
29
+ smart_union = True
30
+ extra = pydantic.Extra.allow
31
+ json_encoders = {dt.datetime: serialize_datetime}
@@ -0,0 +1,30 @@
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 EmbeddingResponse(pydantic.BaseModel):
15
+ embedding: typing.List[float]
16
+ elapsed_time: float
17
+
18
+ def json(self, **kwargs: typing.Any) -> str:
19
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
20
+ return super().json(**kwargs_with_defaults)
21
+
22
+ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
23
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
24
+ return super().dict(**kwargs_with_defaults)
25
+
26
+ class Config:
27
+ frozen = True
28
+ smart_union = True
29
+ extra = pydantic.Extra.allow
30
+ json_encoders = {dt.datetime: serialize_datetime}
@@ -0,0 +1,29 @@
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 ErrorMessage(pydantic.BaseModel):
15
+ msg: str
16
+
17
+ def json(self, **kwargs: typing.Any) -> str:
18
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19
+ return super().json(**kwargs_with_defaults)
20
+
21
+ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
22
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23
+ return super().dict(**kwargs_with_defaults)
24
+
25
+ class Config:
26
+ frozen = True
27
+ smart_union = True
28
+ extra = pydantic.Extra.allow
29
+ json_encoders = {dt.datetime: serialize_datetime}
@@ -0,0 +1,30 @@
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 .error_message import ErrorMessage
8
+
9
+ try:
10
+ import pydantic.v1 as pydantic # type: ignore
11
+ except ImportError:
12
+ import pydantic # type: ignore
13
+
14
+
15
+ class ErrorResponse(pydantic.BaseModel):
16
+ detail: typing.Optional[typing.List[ErrorMessage]] = None
17
+
18
+ def json(self, **kwargs: typing.Any) -> str:
19
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
20
+ return super().json(**kwargs_with_defaults)
21
+
22
+ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
23
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
24
+ return super().dict(**kwargs_with_defaults)
25
+
26
+ class Config:
27
+ frozen = True
28
+ smart_union = True
29
+ extra = pydantic.Extra.allow
30
+ json_encoders = {dt.datetime: serialize_datetime}
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ FieldType = typing.Union[typing.AnyStr, typing.Literal["file_url", "contents"]]
@@ -0,0 +1,34 @@
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 .metadata import Metadata
8
+
9
+ try:
10
+ import pydantic.v1 as pydantic # type: ignore
11
+ except ImportError:
12
+ import pydantic # type: ignore
13
+
14
+
15
+ class GenerationResponse(pydantic.BaseModel):
16
+ success: bool
17
+ status: int
18
+ error: typing.Optional[typing.Dict[str, typing.Any]] = None
19
+ response: typing.Dict[str, typing.Any]
20
+ metadata: typing.Optional[Metadata] = None
21
+
22
+ def json(self, **kwargs: typing.Any) -> str:
23
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
24
+ return super().json(**kwargs_with_defaults)
25
+
26
+ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
27
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
28
+ return super().dict(**kwargs_with_defaults)
29
+
30
+ class Config:
31
+ frozen = True
32
+ smart_union = True
33
+ extra = pydantic.Extra.allow
34
+ json_encoders = {dt.datetime: serialize_datetime}