usecortex-ai 0.1.0__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 (89) hide show
  1. cortex_ai/__init__.py +103 -0
  2. cortex_ai/client.py +244 -0
  3. cortex_ai/core/__init__.py +52 -0
  4. cortex_ai/core/api_error.py +23 -0
  5. cortex_ai/core/client_wrapper.py +84 -0
  6. cortex_ai/core/datetime_utils.py +28 -0
  7. cortex_ai/core/file.py +67 -0
  8. cortex_ai/core/force_multipart.py +18 -0
  9. cortex_ai/core/http_client.py +543 -0
  10. cortex_ai/core/http_response.py +55 -0
  11. cortex_ai/core/jsonable_encoder.py +100 -0
  12. cortex_ai/core/pydantic_utilities.py +258 -0
  13. cortex_ai/core/query_encoder.py +58 -0
  14. cortex_ai/core/remove_none_from_dict.py +11 -0
  15. cortex_ai/core/request_options.py +35 -0
  16. cortex_ai/core/serialization.py +276 -0
  17. cortex_ai/embeddings/__init__.py +4 -0
  18. cortex_ai/embeddings/client.py +442 -0
  19. cortex_ai/embeddings/raw_client.py +1153 -0
  20. cortex_ai/environment.py +7 -0
  21. cortex_ai/errors/__init__.py +21 -0
  22. cortex_ai/errors/bad_request_error.py +11 -0
  23. cortex_ai/errors/forbidden_error.py +11 -0
  24. cortex_ai/errors/internal_server_error.py +11 -0
  25. cortex_ai/errors/not_found_error.py +11 -0
  26. cortex_ai/errors/service_unavailable_error.py +11 -0
  27. cortex_ai/errors/unauthorized_error.py +11 -0
  28. cortex_ai/errors/unprocessable_entity_error.py +10 -0
  29. cortex_ai/fetch/__init__.py +4 -0
  30. cortex_ai/fetch/client.py +143 -0
  31. cortex_ai/fetch/raw_client.py +310 -0
  32. cortex_ai/raw_client.py +90 -0
  33. cortex_ai/search/__init__.py +7 -0
  34. cortex_ai/search/client.py +536 -0
  35. cortex_ai/search/raw_client.py +1064 -0
  36. cortex_ai/search/types/__init__.py +7 -0
  37. cortex_ai/search/types/alpha.py +5 -0
  38. cortex_ai/sources/__init__.py +4 -0
  39. cortex_ai/sources/client.py +187 -0
  40. cortex_ai/sources/raw_client.py +532 -0
  41. cortex_ai/tenant/__init__.py +4 -0
  42. cortex_ai/tenant/client.py +120 -0
  43. cortex_ai/tenant/raw_client.py +283 -0
  44. cortex_ai/types/__init__.py +69 -0
  45. cortex_ai/types/actual_error_response.py +20 -0
  46. cortex_ai/types/app_sources_upload_data.py +22 -0
  47. cortex_ai/types/attachment_model.py +26 -0
  48. cortex_ai/types/batch_upload_data.py +22 -0
  49. cortex_ai/types/bm_25_operator_type.py +5 -0
  50. cortex_ai/types/content_model.py +26 -0
  51. cortex_ai/types/delete_memory_request.py +21 -0
  52. cortex_ai/types/embeddings_create_collection_data.py +22 -0
  53. cortex_ai/types/embeddings_delete_data.py +22 -0
  54. cortex_ai/types/embeddings_get_data.py +22 -0
  55. cortex_ai/types/embeddings_search_data.py +22 -0
  56. cortex_ai/types/error_response.py +22 -0
  57. cortex_ai/types/extended_context.py +20 -0
  58. cortex_ai/types/fetch_content_data.py +23 -0
  59. cortex_ai/types/file_upload_result.py +20 -0
  60. cortex_ai/types/full_text_search_data.py +22 -0
  61. cortex_ai/types/http_validation_error.py +20 -0
  62. cortex_ai/types/list_sources_response.py +22 -0
  63. cortex_ai/types/markdown_upload_request.py +21 -0
  64. cortex_ai/types/processing_status.py +22 -0
  65. cortex_ai/types/related_chunk.py +22 -0
  66. cortex_ai/types/search_chunk.py +34 -0
  67. cortex_ai/types/search_data.py +22 -0
  68. cortex_ai/types/single_upload_data.py +21 -0
  69. cortex_ai/types/source.py +32 -0
  70. cortex_ai/types/source_content.py +26 -0
  71. cortex_ai/types/source_model.py +32 -0
  72. cortex_ai/types/tenant_create_data.py +22 -0
  73. cortex_ai/types/tenant_stats.py +23 -0
  74. cortex_ai/types/validation_error.py +22 -0
  75. cortex_ai/types/validation_error_loc_item.py +5 -0
  76. cortex_ai/upload/__init__.py +4 -0
  77. cortex_ai/upload/client.py +1572 -0
  78. cortex_ai/upload/raw_client.py +4202 -0
  79. cortex_ai/user/__init__.py +4 -0
  80. cortex_ai/user/client.py +125 -0
  81. cortex_ai/user/raw_client.py +300 -0
  82. cortex_ai/user_memory/__init__.py +4 -0
  83. cortex_ai/user_memory/client.py +443 -0
  84. cortex_ai/user_memory/raw_client.py +651 -0
  85. usecortex_ai-0.1.0.dist-info/METADATA +136 -0
  86. usecortex_ai-0.1.0.dist-info/RECORD +89 -0
  87. usecortex_ai-0.1.0.dist-info/WHEEL +5 -0
  88. usecortex_ai-0.1.0.dist-info/licenses/LICENSE +22 -0
  89. usecortex_ai-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,283 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from json.decoder import JSONDecodeError
5
+
6
+ from ..core.api_error import ApiError
7
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8
+ from ..core.http_response import AsyncHttpResponse, HttpResponse
9
+ from ..core.pydantic_utilities import parse_obj_as
10
+ from ..core.request_options import RequestOptions
11
+ from ..errors.bad_request_error import BadRequestError
12
+ from ..errors.forbidden_error import ForbiddenError
13
+ from ..errors.internal_server_error import InternalServerError
14
+ from ..errors.not_found_error import NotFoundError
15
+ from ..errors.service_unavailable_error import ServiceUnavailableError
16
+ from ..errors.unauthorized_error import UnauthorizedError
17
+ from ..errors.unprocessable_entity_error import UnprocessableEntityError
18
+ from ..types.actual_error_response import ActualErrorResponse
19
+ from ..types.tenant_stats import TenantStats
20
+
21
+
22
+ class RawTenantClient:
23
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
24
+ self._client_wrapper = client_wrapper
25
+
26
+ def stats(
27
+ self,
28
+ *,
29
+ tenant_id: str,
30
+ sub_tenant_id: typing.Optional[str] = None,
31
+ request_options: typing.Optional[RequestOptions] = None,
32
+ ) -> HttpResponse[TenantStats]:
33
+ """
34
+ Get tenant stats.
35
+
36
+ This endpoint returns stats for tenant.
37
+
38
+ Parameters
39
+ ----------
40
+ tenant_id : str
41
+
42
+ sub_tenant_id : typing.Optional[str]
43
+
44
+ request_options : typing.Optional[RequestOptions]
45
+ Request-specific configuration.
46
+
47
+ Returns
48
+ -------
49
+ HttpResponse[TenantStats]
50
+ Successful Response
51
+ """
52
+ _response = self._client_wrapper.httpx_client.request(
53
+ "tenant/stats",
54
+ method="GET",
55
+ params={
56
+ "tenant_id": tenant_id,
57
+ "sub_tenant_id": sub_tenant_id,
58
+ },
59
+ request_options=request_options,
60
+ )
61
+ try:
62
+ if 200 <= _response.status_code < 300:
63
+ _data = typing.cast(
64
+ TenantStats,
65
+ parse_obj_as(
66
+ type_=TenantStats, # type: ignore
67
+ object_=_response.json(),
68
+ ),
69
+ )
70
+ return HttpResponse(response=_response, data=_data)
71
+ if _response.status_code == 400:
72
+ raise BadRequestError(
73
+ headers=dict(_response.headers),
74
+ body=typing.cast(
75
+ ActualErrorResponse,
76
+ parse_obj_as(
77
+ type_=ActualErrorResponse, # type: ignore
78
+ object_=_response.json(),
79
+ ),
80
+ ),
81
+ )
82
+ if _response.status_code == 401:
83
+ raise UnauthorizedError(
84
+ headers=dict(_response.headers),
85
+ body=typing.cast(
86
+ ActualErrorResponse,
87
+ parse_obj_as(
88
+ type_=ActualErrorResponse, # type: ignore
89
+ object_=_response.json(),
90
+ ),
91
+ ),
92
+ )
93
+ if _response.status_code == 403:
94
+ raise ForbiddenError(
95
+ headers=dict(_response.headers),
96
+ body=typing.cast(
97
+ ActualErrorResponse,
98
+ parse_obj_as(
99
+ type_=ActualErrorResponse, # type: ignore
100
+ object_=_response.json(),
101
+ ),
102
+ ),
103
+ )
104
+ if _response.status_code == 404:
105
+ raise NotFoundError(
106
+ headers=dict(_response.headers),
107
+ body=typing.cast(
108
+ ActualErrorResponse,
109
+ parse_obj_as(
110
+ type_=ActualErrorResponse, # type: ignore
111
+ object_=_response.json(),
112
+ ),
113
+ ),
114
+ )
115
+ if _response.status_code == 422:
116
+ raise UnprocessableEntityError(
117
+ headers=dict(_response.headers),
118
+ body=typing.cast(
119
+ typing.Optional[typing.Any],
120
+ parse_obj_as(
121
+ type_=typing.Optional[typing.Any], # type: ignore
122
+ object_=_response.json(),
123
+ ),
124
+ ),
125
+ )
126
+ if _response.status_code == 500:
127
+ raise InternalServerError(
128
+ headers=dict(_response.headers),
129
+ body=typing.cast(
130
+ ActualErrorResponse,
131
+ parse_obj_as(
132
+ type_=ActualErrorResponse, # type: ignore
133
+ object_=_response.json(),
134
+ ),
135
+ ),
136
+ )
137
+ if _response.status_code == 503:
138
+ raise ServiceUnavailableError(
139
+ headers=dict(_response.headers),
140
+ body=typing.cast(
141
+ ActualErrorResponse,
142
+ parse_obj_as(
143
+ type_=ActualErrorResponse, # type: ignore
144
+ object_=_response.json(),
145
+ ),
146
+ ),
147
+ )
148
+ _response_json = _response.json()
149
+ except JSONDecodeError:
150
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
151
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
152
+
153
+
154
+ class AsyncRawTenantClient:
155
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
156
+ self._client_wrapper = client_wrapper
157
+
158
+ async def stats(
159
+ self,
160
+ *,
161
+ tenant_id: str,
162
+ sub_tenant_id: typing.Optional[str] = None,
163
+ request_options: typing.Optional[RequestOptions] = None,
164
+ ) -> AsyncHttpResponse[TenantStats]:
165
+ """
166
+ Get tenant stats.
167
+
168
+ This endpoint returns stats for tenant.
169
+
170
+ Parameters
171
+ ----------
172
+ tenant_id : str
173
+
174
+ sub_tenant_id : typing.Optional[str]
175
+
176
+ request_options : typing.Optional[RequestOptions]
177
+ Request-specific configuration.
178
+
179
+ Returns
180
+ -------
181
+ AsyncHttpResponse[TenantStats]
182
+ Successful Response
183
+ """
184
+ _response = await self._client_wrapper.httpx_client.request(
185
+ "tenant/stats",
186
+ method="GET",
187
+ params={
188
+ "tenant_id": tenant_id,
189
+ "sub_tenant_id": sub_tenant_id,
190
+ },
191
+ request_options=request_options,
192
+ )
193
+ try:
194
+ if 200 <= _response.status_code < 300:
195
+ _data = typing.cast(
196
+ TenantStats,
197
+ parse_obj_as(
198
+ type_=TenantStats, # type: ignore
199
+ object_=_response.json(),
200
+ ),
201
+ )
202
+ return AsyncHttpResponse(response=_response, data=_data)
203
+ if _response.status_code == 400:
204
+ raise BadRequestError(
205
+ headers=dict(_response.headers),
206
+ body=typing.cast(
207
+ ActualErrorResponse,
208
+ parse_obj_as(
209
+ type_=ActualErrorResponse, # type: ignore
210
+ object_=_response.json(),
211
+ ),
212
+ ),
213
+ )
214
+ if _response.status_code == 401:
215
+ raise UnauthorizedError(
216
+ headers=dict(_response.headers),
217
+ body=typing.cast(
218
+ ActualErrorResponse,
219
+ parse_obj_as(
220
+ type_=ActualErrorResponse, # type: ignore
221
+ object_=_response.json(),
222
+ ),
223
+ ),
224
+ )
225
+ if _response.status_code == 403:
226
+ raise ForbiddenError(
227
+ headers=dict(_response.headers),
228
+ body=typing.cast(
229
+ ActualErrorResponse,
230
+ parse_obj_as(
231
+ type_=ActualErrorResponse, # type: ignore
232
+ object_=_response.json(),
233
+ ),
234
+ ),
235
+ )
236
+ if _response.status_code == 404:
237
+ raise NotFoundError(
238
+ headers=dict(_response.headers),
239
+ body=typing.cast(
240
+ ActualErrorResponse,
241
+ parse_obj_as(
242
+ type_=ActualErrorResponse, # type: ignore
243
+ object_=_response.json(),
244
+ ),
245
+ ),
246
+ )
247
+ if _response.status_code == 422:
248
+ raise UnprocessableEntityError(
249
+ headers=dict(_response.headers),
250
+ body=typing.cast(
251
+ typing.Optional[typing.Any],
252
+ parse_obj_as(
253
+ type_=typing.Optional[typing.Any], # type: ignore
254
+ object_=_response.json(),
255
+ ),
256
+ ),
257
+ )
258
+ if _response.status_code == 500:
259
+ raise InternalServerError(
260
+ headers=dict(_response.headers),
261
+ body=typing.cast(
262
+ ActualErrorResponse,
263
+ parse_obj_as(
264
+ type_=ActualErrorResponse, # type: ignore
265
+ object_=_response.json(),
266
+ ),
267
+ ),
268
+ )
269
+ if _response.status_code == 503:
270
+ raise ServiceUnavailableError(
271
+ headers=dict(_response.headers),
272
+ body=typing.cast(
273
+ ActualErrorResponse,
274
+ parse_obj_as(
275
+ type_=ActualErrorResponse, # type: ignore
276
+ object_=_response.json(),
277
+ ),
278
+ ),
279
+ )
280
+ _response_json = _response.json()
281
+ except JSONDecodeError:
282
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
283
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
@@ -0,0 +1,69 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ from .actual_error_response import ActualErrorResponse
6
+ from .app_sources_upload_data import AppSourcesUploadData
7
+ from .attachment_model import AttachmentModel
8
+ from .batch_upload_data import BatchUploadData
9
+ from .bm_25_operator_type import Bm25OperatorType
10
+ from .content_model import ContentModel
11
+ from .delete_memory_request import DeleteMemoryRequest
12
+ from .embeddings_create_collection_data import EmbeddingsCreateCollectionData
13
+ from .embeddings_delete_data import EmbeddingsDeleteData
14
+ from .embeddings_get_data import EmbeddingsGetData
15
+ from .embeddings_search_data import EmbeddingsSearchData
16
+ from .error_response import ErrorResponse
17
+ from .extended_context import ExtendedContext
18
+ from .fetch_content_data import FetchContentData
19
+ from .file_upload_result import FileUploadResult
20
+ from .full_text_search_data import FullTextSearchData
21
+ from .http_validation_error import HttpValidationError
22
+ from .list_sources_response import ListSourcesResponse
23
+ from .markdown_upload_request import MarkdownUploadRequest
24
+ from .processing_status import ProcessingStatus
25
+ from .related_chunk import RelatedChunk
26
+ from .search_chunk import SearchChunk
27
+ from .search_data import SearchData
28
+ from .single_upload_data import SingleUploadData
29
+ from .source import Source
30
+ from .source_content import SourceContent
31
+ from .source_model import SourceModel
32
+ from .tenant_create_data import TenantCreateData
33
+ from .tenant_stats import TenantStats
34
+ from .validation_error import ValidationError
35
+ from .validation_error_loc_item import ValidationErrorLocItem
36
+
37
+ __all__ = [
38
+ "ActualErrorResponse",
39
+ "AppSourcesUploadData",
40
+ "AttachmentModel",
41
+ "BatchUploadData",
42
+ "Bm25OperatorType",
43
+ "ContentModel",
44
+ "DeleteMemoryRequest",
45
+ "EmbeddingsCreateCollectionData",
46
+ "EmbeddingsDeleteData",
47
+ "EmbeddingsGetData",
48
+ "EmbeddingsSearchData",
49
+ "ErrorResponse",
50
+ "ExtendedContext",
51
+ "FetchContentData",
52
+ "FileUploadResult",
53
+ "FullTextSearchData",
54
+ "HttpValidationError",
55
+ "ListSourcesResponse",
56
+ "MarkdownUploadRequest",
57
+ "ProcessingStatus",
58
+ "RelatedChunk",
59
+ "SearchChunk",
60
+ "SearchData",
61
+ "SingleUploadData",
62
+ "Source",
63
+ "SourceContent",
64
+ "SourceModel",
65
+ "TenantCreateData",
66
+ "TenantStats",
67
+ "ValidationError",
68
+ "ValidationErrorLocItem",
69
+ ]
@@ -0,0 +1,20 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .error_response import ErrorResponse
8
+
9
+
10
+ class ActualErrorResponse(UniversalBaseModel):
11
+ detail: ErrorResponse
12
+
13
+ if IS_PYDANTIC_V2:
14
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
15
+ else:
16
+
17
+ class Config:
18
+ frozen = True
19
+ smart_union = True
20
+ extra = pydantic.Extra.allow
@@ -0,0 +1,22 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .file_upload_result import FileUploadResult
8
+
9
+
10
+ class AppSourcesUploadData(UniversalBaseModel):
11
+ success: typing.Optional[bool] = None
12
+ message: str
13
+ uploaded: typing.List[FileUploadResult]
14
+
15
+ if IS_PYDANTIC_V2:
16
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
17
+ else:
18
+
19
+ class Config:
20
+ frozen = True
21
+ smart_union = True
22
+ extra = pydantic.Extra.allow
@@ -0,0 +1,26 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .content_model import ContentModel
8
+
9
+
10
+ class AttachmentModel(UniversalBaseModel):
11
+ id: typing.Optional[str] = None
12
+ url: typing.Optional[str] = None
13
+ title: typing.Optional[str] = None
14
+ content_type: typing.Optional[str] = None
15
+ content_url: typing.Optional[str] = None
16
+ misc: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
17
+ content: typing.Optional[ContentModel] = None
18
+
19
+ if IS_PYDANTIC_V2:
20
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
21
+ else:
22
+
23
+ class Config:
24
+ frozen = True
25
+ smart_union = True
26
+ extra = pydantic.Extra.allow
@@ -0,0 +1,22 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .file_upload_result import FileUploadResult
8
+
9
+
10
+ class BatchUploadData(UniversalBaseModel):
11
+ success: typing.Optional[bool] = None
12
+ message: str
13
+ uploaded: typing.List[FileUploadResult]
14
+
15
+ if IS_PYDANTIC_V2:
16
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
17
+ else:
18
+
19
+ class Config:
20
+ frozen = True
21
+ smart_union = True
22
+ extra = pydantic.Extra.allow
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ Bm25OperatorType = typing.Union[typing.Literal["or", "and"], typing.Any]
@@ -0,0 +1,26 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+ from ..core.serialization import FieldMetadata
9
+
10
+
11
+ class ContentModel(UniversalBaseModel):
12
+ text: typing.Optional[str] = None
13
+ html_base_64: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="html_base64")] = None
14
+ csv_base_64: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="csv_base64")] = None
15
+ markdown: typing.Optional[str] = None
16
+ files: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = None
17
+ layout: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = None
18
+
19
+ if IS_PYDANTIC_V2:
20
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
21
+ else:
22
+
23
+ class Config:
24
+ frozen = True
25
+ smart_union = True
26
+ extra = pydantic.Extra.allow
@@ -0,0 +1,21 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class DeleteMemoryRequest(UniversalBaseModel):
10
+ tenant_id: str
11
+ source_ids: typing.List[str]
12
+ sub_tenant_id: typing.Optional[str] = None
13
+
14
+ if IS_PYDANTIC_V2:
15
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
16
+ else:
17
+
18
+ class Config:
19
+ frozen = True
20
+ smart_union = True
21
+ extra = pydantic.Extra.allow
@@ -0,0 +1,22 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class EmbeddingsCreateCollectionData(UniversalBaseModel):
10
+ success: typing.Optional[bool] = None
11
+ message: str
12
+ tenant_id: str
13
+ sub_tenant_id: str
14
+
15
+ if IS_PYDANTIC_V2:
16
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
17
+ else:
18
+
19
+ class Config:
20
+ frozen = True
21
+ smart_union = True
22
+ extra = pydantic.Extra.allow
@@ -0,0 +1,22 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class EmbeddingsDeleteData(UniversalBaseModel):
10
+ success: typing.Optional[bool] = None
11
+ message: str
12
+ total_deleted: int
13
+ status: typing.Dict[str, bool]
14
+
15
+ if IS_PYDANTIC_V2:
16
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
17
+ else:
18
+
19
+ class Config:
20
+ frozen = True
21
+ smart_union = True
22
+ extra = pydantic.Extra.allow
@@ -0,0 +1,22 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class EmbeddingsGetData(UniversalBaseModel):
10
+ success: typing.Optional[bool] = None
11
+ message: str
12
+ embeddings: typing.Dict[str, typing.List[float]]
13
+ not_found_chunk_ids: typing.List[str]
14
+
15
+ if IS_PYDANTIC_V2:
16
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
17
+ else:
18
+
19
+ class Config:
20
+ frozen = True
21
+ smart_union = True
22
+ extra = pydantic.Extra.allow
@@ -0,0 +1,22 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class EmbeddingsSearchData(UniversalBaseModel):
10
+ success: typing.Optional[bool] = None
11
+ message: str
12
+ chunk_ids: typing.List[str]
13
+ scores: typing.List[float]
14
+
15
+ if IS_PYDANTIC_V2:
16
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
17
+ else:
18
+
19
+ class Config:
20
+ frozen = True
21
+ smart_union = True
22
+ extra = pydantic.Extra.allow
@@ -0,0 +1,22 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class ErrorResponse(UniversalBaseModel):
10
+ success: typing.Optional[bool] = None
11
+ message: str
12
+ error_code: typing.Optional[str] = None
13
+ data: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
14
+
15
+ if IS_PYDANTIC_V2:
16
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
17
+ else:
18
+
19
+ class Config:
20
+ frozen = True
21
+ smart_union = True
22
+ extra = pydantic.Extra.allow
@@ -0,0 +1,20 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .related_chunk import RelatedChunk
8
+
9
+
10
+ class ExtendedContext(UniversalBaseModel):
11
+ related_chunks: typing.Optional[typing.List[RelatedChunk]] = None
12
+
13
+ if IS_PYDANTIC_V2:
14
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
15
+ else:
16
+
17
+ class Config:
18
+ frozen = True
19
+ smart_union = True
20
+ extra = pydantic.Extra.allow
@@ -0,0 +1,23 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class FetchContentData(UniversalBaseModel):
10
+ success: typing.Optional[bool] = None
11
+ message: str
12
+ file_id: str
13
+ url: str
14
+ file_content: typing.Optional[str] = None
15
+
16
+ if IS_PYDANTIC_V2:
17
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
18
+ else:
19
+
20
+ class Config:
21
+ frozen = True
22
+ smart_union = True
23
+ extra = pydantic.Extra.allow
@@ -0,0 +1,20 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class FileUploadResult(UniversalBaseModel):
10
+ file_id: str
11
+ filename: typing.Optional[str] = None
12
+
13
+ if IS_PYDANTIC_V2:
14
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
15
+ else:
16
+
17
+ class Config:
18
+ frozen = True
19
+ smart_union = True
20
+ extra = pydantic.Extra.allow