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.
- cortex_ai/__init__.py +103 -0
- cortex_ai/client.py +244 -0
- cortex_ai/core/__init__.py +52 -0
- cortex_ai/core/api_error.py +23 -0
- cortex_ai/core/client_wrapper.py +84 -0
- cortex_ai/core/datetime_utils.py +28 -0
- cortex_ai/core/file.py +67 -0
- cortex_ai/core/force_multipart.py +18 -0
- cortex_ai/core/http_client.py +543 -0
- cortex_ai/core/http_response.py +55 -0
- cortex_ai/core/jsonable_encoder.py +100 -0
- cortex_ai/core/pydantic_utilities.py +258 -0
- cortex_ai/core/query_encoder.py +58 -0
- cortex_ai/core/remove_none_from_dict.py +11 -0
- cortex_ai/core/request_options.py +35 -0
- cortex_ai/core/serialization.py +276 -0
- cortex_ai/embeddings/__init__.py +4 -0
- cortex_ai/embeddings/client.py +442 -0
- cortex_ai/embeddings/raw_client.py +1153 -0
- cortex_ai/environment.py +7 -0
- cortex_ai/errors/__init__.py +21 -0
- cortex_ai/errors/bad_request_error.py +11 -0
- cortex_ai/errors/forbidden_error.py +11 -0
- cortex_ai/errors/internal_server_error.py +11 -0
- cortex_ai/errors/not_found_error.py +11 -0
- cortex_ai/errors/service_unavailable_error.py +11 -0
- cortex_ai/errors/unauthorized_error.py +11 -0
- cortex_ai/errors/unprocessable_entity_error.py +10 -0
- cortex_ai/fetch/__init__.py +4 -0
- cortex_ai/fetch/client.py +143 -0
- cortex_ai/fetch/raw_client.py +310 -0
- cortex_ai/raw_client.py +90 -0
- cortex_ai/search/__init__.py +7 -0
- cortex_ai/search/client.py +536 -0
- cortex_ai/search/raw_client.py +1064 -0
- cortex_ai/search/types/__init__.py +7 -0
- cortex_ai/search/types/alpha.py +5 -0
- cortex_ai/sources/__init__.py +4 -0
- cortex_ai/sources/client.py +187 -0
- cortex_ai/sources/raw_client.py +532 -0
- cortex_ai/tenant/__init__.py +4 -0
- cortex_ai/tenant/client.py +120 -0
- cortex_ai/tenant/raw_client.py +283 -0
- cortex_ai/types/__init__.py +69 -0
- cortex_ai/types/actual_error_response.py +20 -0
- cortex_ai/types/app_sources_upload_data.py +22 -0
- cortex_ai/types/attachment_model.py +26 -0
- cortex_ai/types/batch_upload_data.py +22 -0
- cortex_ai/types/bm_25_operator_type.py +5 -0
- cortex_ai/types/content_model.py +26 -0
- cortex_ai/types/delete_memory_request.py +21 -0
- cortex_ai/types/embeddings_create_collection_data.py +22 -0
- cortex_ai/types/embeddings_delete_data.py +22 -0
- cortex_ai/types/embeddings_get_data.py +22 -0
- cortex_ai/types/embeddings_search_data.py +22 -0
- cortex_ai/types/error_response.py +22 -0
- cortex_ai/types/extended_context.py +20 -0
- cortex_ai/types/fetch_content_data.py +23 -0
- cortex_ai/types/file_upload_result.py +20 -0
- cortex_ai/types/full_text_search_data.py +22 -0
- cortex_ai/types/http_validation_error.py +20 -0
- cortex_ai/types/list_sources_response.py +22 -0
- cortex_ai/types/markdown_upload_request.py +21 -0
- cortex_ai/types/processing_status.py +22 -0
- cortex_ai/types/related_chunk.py +22 -0
- cortex_ai/types/search_chunk.py +34 -0
- cortex_ai/types/search_data.py +22 -0
- cortex_ai/types/single_upload_data.py +21 -0
- cortex_ai/types/source.py +32 -0
- cortex_ai/types/source_content.py +26 -0
- cortex_ai/types/source_model.py +32 -0
- cortex_ai/types/tenant_create_data.py +22 -0
- cortex_ai/types/tenant_stats.py +23 -0
- cortex_ai/types/validation_error.py +22 -0
- cortex_ai/types/validation_error_loc_item.py +5 -0
- cortex_ai/upload/__init__.py +4 -0
- cortex_ai/upload/client.py +1572 -0
- cortex_ai/upload/raw_client.py +4202 -0
- cortex_ai/user/__init__.py +4 -0
- cortex_ai/user/client.py +125 -0
- cortex_ai/user/raw_client.py +300 -0
- cortex_ai/user_memory/__init__.py +4 -0
- cortex_ai/user_memory/client.py +443 -0
- cortex_ai/user_memory/raw_client.py +651 -0
- usecortex_ai-0.1.0.dist-info/METADATA +136 -0
- usecortex_ai-0.1.0.dist-info/RECORD +89 -0
- usecortex_ai-0.1.0.dist-info/WHEEL +5 -0
- usecortex_ai-0.1.0.dist-info/licenses/LICENSE +22 -0
- usecortex_ai-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
|
+
from ..core.request_options import RequestOptions
|
|
7
|
+
from ..types.list_sources_response import ListSourcesResponse
|
|
8
|
+
from .raw_client import AsyncRawSourcesClient, RawSourcesClient
|
|
9
|
+
|
|
10
|
+
# this is used as the default value for optional parameters
|
|
11
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class SourcesClient:
|
|
15
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
16
|
+
self._raw_client = RawSourcesClient(client_wrapper=client_wrapper)
|
|
17
|
+
|
|
18
|
+
@property
|
|
19
|
+
def with_raw_response(self) -> RawSourcesClient:
|
|
20
|
+
"""
|
|
21
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
22
|
+
|
|
23
|
+
Returns
|
|
24
|
+
-------
|
|
25
|
+
RawSourcesClient
|
|
26
|
+
"""
|
|
27
|
+
return self._raw_client
|
|
28
|
+
|
|
29
|
+
def get_all(
|
|
30
|
+
self,
|
|
31
|
+
*,
|
|
32
|
+
tenant_id: str,
|
|
33
|
+
sub_tenant_id: typing.Optional[str] = None,
|
|
34
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
35
|
+
) -> ListSourcesResponse:
|
|
36
|
+
"""
|
|
37
|
+
Parameters
|
|
38
|
+
----------
|
|
39
|
+
tenant_id : str
|
|
40
|
+
|
|
41
|
+
sub_tenant_id : typing.Optional[str]
|
|
42
|
+
|
|
43
|
+
request_options : typing.Optional[RequestOptions]
|
|
44
|
+
Request-specific configuration.
|
|
45
|
+
|
|
46
|
+
Returns
|
|
47
|
+
-------
|
|
48
|
+
ListSourcesResponse
|
|
49
|
+
Successful Response
|
|
50
|
+
|
|
51
|
+
Examples
|
|
52
|
+
--------
|
|
53
|
+
from cortex-ai import CortexAI
|
|
54
|
+
|
|
55
|
+
client = CortexAI(token="YOUR_TOKEN", )
|
|
56
|
+
client.sources.get_all(tenant_id='tenant_id', )
|
|
57
|
+
"""
|
|
58
|
+
_response = self._raw_client.get_all(
|
|
59
|
+
tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
60
|
+
)
|
|
61
|
+
return _response.data
|
|
62
|
+
|
|
63
|
+
def get_by_ids(
|
|
64
|
+
self,
|
|
65
|
+
*,
|
|
66
|
+
tenant_id: str,
|
|
67
|
+
source_ids: typing.Sequence[str],
|
|
68
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
69
|
+
) -> ListSourcesResponse:
|
|
70
|
+
"""
|
|
71
|
+
Parameters
|
|
72
|
+
----------
|
|
73
|
+
tenant_id : str
|
|
74
|
+
|
|
75
|
+
source_ids : typing.Sequence[str]
|
|
76
|
+
|
|
77
|
+
request_options : typing.Optional[RequestOptions]
|
|
78
|
+
Request-specific configuration.
|
|
79
|
+
|
|
80
|
+
Returns
|
|
81
|
+
-------
|
|
82
|
+
ListSourcesResponse
|
|
83
|
+
Successful Response
|
|
84
|
+
|
|
85
|
+
Examples
|
|
86
|
+
--------
|
|
87
|
+
from cortex-ai import CortexAI
|
|
88
|
+
|
|
89
|
+
client = CortexAI(token="YOUR_TOKEN", )
|
|
90
|
+
client.sources.get_by_ids(tenant_id='tenant_id', source_ids=['source_ids'], )
|
|
91
|
+
"""
|
|
92
|
+
_response = self._raw_client.get_by_ids(
|
|
93
|
+
tenant_id=tenant_id, source_ids=source_ids, request_options=request_options
|
|
94
|
+
)
|
|
95
|
+
return _response.data
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
class AsyncSourcesClient:
|
|
99
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
100
|
+
self._raw_client = AsyncRawSourcesClient(client_wrapper=client_wrapper)
|
|
101
|
+
|
|
102
|
+
@property
|
|
103
|
+
def with_raw_response(self) -> AsyncRawSourcesClient:
|
|
104
|
+
"""
|
|
105
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
106
|
+
|
|
107
|
+
Returns
|
|
108
|
+
-------
|
|
109
|
+
AsyncRawSourcesClient
|
|
110
|
+
"""
|
|
111
|
+
return self._raw_client
|
|
112
|
+
|
|
113
|
+
async def get_all(
|
|
114
|
+
self,
|
|
115
|
+
*,
|
|
116
|
+
tenant_id: str,
|
|
117
|
+
sub_tenant_id: typing.Optional[str] = None,
|
|
118
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
119
|
+
) -> ListSourcesResponse:
|
|
120
|
+
"""
|
|
121
|
+
Parameters
|
|
122
|
+
----------
|
|
123
|
+
tenant_id : str
|
|
124
|
+
|
|
125
|
+
sub_tenant_id : typing.Optional[str]
|
|
126
|
+
|
|
127
|
+
request_options : typing.Optional[RequestOptions]
|
|
128
|
+
Request-specific configuration.
|
|
129
|
+
|
|
130
|
+
Returns
|
|
131
|
+
-------
|
|
132
|
+
ListSourcesResponse
|
|
133
|
+
Successful Response
|
|
134
|
+
|
|
135
|
+
Examples
|
|
136
|
+
--------
|
|
137
|
+
import asyncio
|
|
138
|
+
|
|
139
|
+
from cortex-ai import AsyncCortexAI
|
|
140
|
+
|
|
141
|
+
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
142
|
+
async def main() -> None:
|
|
143
|
+
await client.sources.get_all(tenant_id='tenant_id', )
|
|
144
|
+
asyncio.run(main())
|
|
145
|
+
"""
|
|
146
|
+
_response = await self._raw_client.get_all(
|
|
147
|
+
tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
148
|
+
)
|
|
149
|
+
return _response.data
|
|
150
|
+
|
|
151
|
+
async def get_by_ids(
|
|
152
|
+
self,
|
|
153
|
+
*,
|
|
154
|
+
tenant_id: str,
|
|
155
|
+
source_ids: typing.Sequence[str],
|
|
156
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
157
|
+
) -> ListSourcesResponse:
|
|
158
|
+
"""
|
|
159
|
+
Parameters
|
|
160
|
+
----------
|
|
161
|
+
tenant_id : str
|
|
162
|
+
|
|
163
|
+
source_ids : typing.Sequence[str]
|
|
164
|
+
|
|
165
|
+
request_options : typing.Optional[RequestOptions]
|
|
166
|
+
Request-specific configuration.
|
|
167
|
+
|
|
168
|
+
Returns
|
|
169
|
+
-------
|
|
170
|
+
ListSourcesResponse
|
|
171
|
+
Successful Response
|
|
172
|
+
|
|
173
|
+
Examples
|
|
174
|
+
--------
|
|
175
|
+
import asyncio
|
|
176
|
+
|
|
177
|
+
from cortex-ai import AsyncCortexAI
|
|
178
|
+
|
|
179
|
+
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
180
|
+
async def main() -> None:
|
|
181
|
+
await client.sources.get_by_ids(tenant_id='tenant_id', source_ids=['source_ids'], )
|
|
182
|
+
asyncio.run(main())
|
|
183
|
+
"""
|
|
184
|
+
_response = await self._raw_client.get_by_ids(
|
|
185
|
+
tenant_id=tenant_id, source_ids=source_ids, request_options=request_options
|
|
186
|
+
)
|
|
187
|
+
return _response.data
|