usecortex-ai 0.2.1__py3-none-any.whl → 0.3.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.
- usecortex_ai/__init__.py +18 -3
- usecortex_ai/client.py +3 -0
- usecortex_ai/document/__init__.py +4 -0
- usecortex_ai/document/client.py +139 -0
- usecortex_ai/document/raw_client.py +312 -0
- usecortex_ai/embeddings/client.py +48 -78
- usecortex_ai/embeddings/raw_client.py +44 -74
- usecortex_ai/fetch/client.py +2 -2
- usecortex_ai/search/client.py +88 -84
- usecortex_ai/search/raw_client.py +82 -78
- usecortex_ai/sources/client.py +26 -157
- usecortex_ai/sources/raw_client.py +22 -501
- usecortex_ai/tenant/client.py +154 -6
- usecortex_ai/tenant/raw_client.py +502 -4
- usecortex_ai/types/__init__.py +16 -2
- usecortex_ai/types/add_user_memory_response.py +36 -0
- usecortex_ai/types/app_sources_upload_data.py +10 -2
- usecortex_ai/types/attachment_model.py +34 -7
- usecortex_ai/types/batch_upload_data.py +10 -2
- usecortex_ai/types/body_scrape_webpage_upload_scrape_webpage_post.py +0 -2
- usecortex_ai/types/body_update_scrape_job_upload_update_webpage_patch.py +0 -2
- usecortex_ai/types/content_model.py +33 -6
- usecortex_ai/types/delete_memory_request.py +14 -3
- usecortex_ai/types/delete_sources.py +20 -0
- usecortex_ai/types/delete_sub_tenant_data.py +42 -0
- usecortex_ai/types/delete_user_memory_response.py +31 -0
- usecortex_ai/types/embeddings_create_collection_data.py +19 -4
- usecortex_ai/types/embeddings_delete_data.py +19 -4
- usecortex_ai/types/embeddings_get_data.py +19 -4
- usecortex_ai/types/embeddings_search_data.py +19 -4
- usecortex_ai/types/error_response.py +0 -1
- usecortex_ai/types/fetch_content_data.py +19 -5
- usecortex_ai/types/file_upload_result.py +9 -2
- usecortex_ai/types/generate_user_memory_response.py +32 -0
- usecortex_ai/types/list_sources_response.py +14 -3
- usecortex_ai/types/list_user_memories_response.py +32 -0
- usecortex_ai/types/markdown_upload_request.py +23 -5
- usecortex_ai/types/processing_status.py +14 -3
- usecortex_ai/types/relations.py +9 -2
- usecortex_ai/types/retrieve_user_memory_response.py +32 -0
- usecortex_ai/types/search_chunk.py +54 -17
- usecortex_ai/types/single_upload_data.py +10 -2
- usecortex_ai/types/source.py +34 -15
- usecortex_ai/types/source_model.py +63 -14
- usecortex_ai/types/sub_tenant_ids_data.py +29 -5
- usecortex_ai/types/tenant_create_data.py +19 -4
- usecortex_ai/types/tenant_stats.py +24 -5
- usecortex_ai/types/user_memory.py +31 -0
- usecortex_ai/upload/client.py +486 -111
- usecortex_ai/upload/raw_client.py +458 -103
- usecortex_ai/user/client.py +30 -10
- usecortex_ai/user/raw_client.py +22 -6
- usecortex_ai/user_memory/client.py +200 -56
- usecortex_ai/user_memory/raw_client.py +921 -94
- {usecortex_ai-0.2.1.dist-info → usecortex_ai-0.3.0.dist-info}/METADATA +1 -1
- usecortex_ai-0.3.0.dist-info/RECORD +101 -0
- usecortex_ai/types/source_content.py +0 -26
- usecortex_ai-0.2.1.dist-info/RECORD +0 -91
- {usecortex_ai-0.2.1.dist-info → usecortex_ai-0.3.0.dist-info}/WHEEL +0 -0
- {usecortex_ai-0.2.1.dist-info → usecortex_ai-0.3.0.dist-info}/licenses/LICENSE +0 -0
- {usecortex_ai-0.2.1.dist-info → usecortex_ai-0.3.0.dist-info}/top_level.txt +0 -0
usecortex_ai/tenant/client.py
CHANGED
|
@@ -4,6 +4,8 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
6
|
from ..core.request_options import RequestOptions
|
|
7
|
+
from ..types.delete_sub_tenant_data import DeleteSubTenantData
|
|
8
|
+
from ..types.sub_tenant_ids_data import SubTenantIdsData
|
|
7
9
|
from ..types.tenant_stats import TenantStats
|
|
8
10
|
from .raw_client import AsyncRawTenantClient, RawTenantClient
|
|
9
11
|
|
|
@@ -31,15 +33,21 @@ class TenantClient:
|
|
|
31
33
|
request_options: typing.Optional[RequestOptions] = None,
|
|
32
34
|
) -> TenantStats:
|
|
33
35
|
"""
|
|
34
|
-
|
|
36
|
+
Retrieve usage stats for your tenant.
|
|
35
37
|
|
|
36
|
-
|
|
38
|
+
Use this endpoint to check whether a tenant exists and view core metrics like total indexed objects and vector dimension. This helps you validate setup and monitor ingestion.
|
|
39
|
+
|
|
40
|
+
Expected outcome
|
|
41
|
+
- You receive the current object count and vector dimension for the tenant.
|
|
42
|
+
- If the tenant does not exist, you get a not-found error.
|
|
37
43
|
|
|
38
44
|
Parameters
|
|
39
45
|
----------
|
|
40
46
|
tenant_id : str
|
|
47
|
+
Unique identifier for the tenant/organization
|
|
41
48
|
|
|
42
49
|
sub_tenant_id : typing.Optional[str]
|
|
50
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
43
51
|
|
|
44
52
|
request_options : typing.Optional[RequestOptions]
|
|
45
53
|
Request-specific configuration.
|
|
@@ -54,13 +62,76 @@ class TenantClient:
|
|
|
54
62
|
from usecortex-ai import CortexAI
|
|
55
63
|
|
|
56
64
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
57
|
-
client.tenant.stats(tenant_id='
|
|
65
|
+
client.tenant.stats(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
|
|
58
66
|
"""
|
|
59
67
|
_response = self._raw_client.stats(
|
|
60
68
|
tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
61
69
|
)
|
|
62
70
|
return _response.data
|
|
63
71
|
|
|
72
|
+
def get_sub_tenant_ids(
|
|
73
|
+
self, *, tenant_id: str, request_options: typing.Optional[RequestOptions] = None
|
|
74
|
+
) -> SubTenantIdsData:
|
|
75
|
+
"""
|
|
76
|
+
Retrieve all sub-tenant IDs contained within a specific tenant. Fetches the sub-tenant IDs directly from the underlying data store.
|
|
77
|
+
|
|
78
|
+
Parameters
|
|
79
|
+
----------
|
|
80
|
+
tenant_id : str
|
|
81
|
+
|
|
82
|
+
request_options : typing.Optional[RequestOptions]
|
|
83
|
+
Request-specific configuration.
|
|
84
|
+
|
|
85
|
+
Returns
|
|
86
|
+
-------
|
|
87
|
+
SubTenantIdsData
|
|
88
|
+
Successful Response
|
|
89
|
+
|
|
90
|
+
Examples
|
|
91
|
+
--------
|
|
92
|
+
from usecortex-ai import CortexAI
|
|
93
|
+
|
|
94
|
+
client = CortexAI(token="YOUR_TOKEN", )
|
|
95
|
+
client.tenant.get_sub_tenant_ids(tenant_id='tenant_1234', )
|
|
96
|
+
"""
|
|
97
|
+
_response = self._raw_client.get_sub_tenant_ids(tenant_id=tenant_id, request_options=request_options)
|
|
98
|
+
return _response.data
|
|
99
|
+
|
|
100
|
+
def delete_sub_tenant(
|
|
101
|
+
self, *, tenant_id: str, sub_tenant_id: str, request_options: typing.Optional[RequestOptions] = None
|
|
102
|
+
) -> DeleteSubTenantData:
|
|
103
|
+
"""
|
|
104
|
+
Delete a sub-tenant from a given tenant.
|
|
105
|
+
|
|
106
|
+
This endpoint deletes a specific sub-tenant from the specified tenant.
|
|
107
|
+
It validates that the sub-tenant is not the primary/default sub-tenant before deletion.
|
|
108
|
+
|
|
109
|
+
Parameters
|
|
110
|
+
----------
|
|
111
|
+
tenant_id : str
|
|
112
|
+
|
|
113
|
+
sub_tenant_id : str
|
|
114
|
+
|
|
115
|
+
request_options : typing.Optional[RequestOptions]
|
|
116
|
+
Request-specific configuration.
|
|
117
|
+
|
|
118
|
+
Returns
|
|
119
|
+
-------
|
|
120
|
+
DeleteSubTenantData
|
|
121
|
+
Successful Response
|
|
122
|
+
|
|
123
|
+
Examples
|
|
124
|
+
--------
|
|
125
|
+
from usecortex-ai import CortexAI
|
|
126
|
+
|
|
127
|
+
client = CortexAI(token="YOUR_TOKEN", )
|
|
128
|
+
client.tenant.delete_sub_tenant(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
|
|
129
|
+
"""
|
|
130
|
+
_response = self._raw_client.delete_sub_tenant(
|
|
131
|
+
tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
132
|
+
)
|
|
133
|
+
return _response.data
|
|
134
|
+
|
|
64
135
|
|
|
65
136
|
class AsyncTenantClient:
|
|
66
137
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
@@ -85,15 +156,21 @@ class AsyncTenantClient:
|
|
|
85
156
|
request_options: typing.Optional[RequestOptions] = None,
|
|
86
157
|
) -> TenantStats:
|
|
87
158
|
"""
|
|
88
|
-
|
|
159
|
+
Retrieve usage stats for your tenant.
|
|
160
|
+
|
|
161
|
+
Use this endpoint to check whether a tenant exists and view core metrics like total indexed objects and vector dimension. This helps you validate setup and monitor ingestion.
|
|
89
162
|
|
|
90
|
-
|
|
163
|
+
Expected outcome
|
|
164
|
+
- You receive the current object count and vector dimension for the tenant.
|
|
165
|
+
- If the tenant does not exist, you get a not-found error.
|
|
91
166
|
|
|
92
167
|
Parameters
|
|
93
168
|
----------
|
|
94
169
|
tenant_id : str
|
|
170
|
+
Unique identifier for the tenant/organization
|
|
95
171
|
|
|
96
172
|
sub_tenant_id : typing.Optional[str]
|
|
173
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
97
174
|
|
|
98
175
|
request_options : typing.Optional[RequestOptions]
|
|
99
176
|
Request-specific configuration.
|
|
@@ -111,10 +188,81 @@ class AsyncTenantClient:
|
|
|
111
188
|
|
|
112
189
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
113
190
|
async def main() -> None:
|
|
114
|
-
await client.tenant.stats(tenant_id='
|
|
191
|
+
await client.tenant.stats(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
|
|
115
192
|
asyncio.run(main())
|
|
116
193
|
"""
|
|
117
194
|
_response = await self._raw_client.stats(
|
|
118
195
|
tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
119
196
|
)
|
|
120
197
|
return _response.data
|
|
198
|
+
|
|
199
|
+
async def get_sub_tenant_ids(
|
|
200
|
+
self, *, tenant_id: str, request_options: typing.Optional[RequestOptions] = None
|
|
201
|
+
) -> SubTenantIdsData:
|
|
202
|
+
"""
|
|
203
|
+
Retrieve all sub-tenant IDs contained within a specific tenant. Fetches the sub-tenant IDs directly from the underlying data store.
|
|
204
|
+
|
|
205
|
+
Parameters
|
|
206
|
+
----------
|
|
207
|
+
tenant_id : str
|
|
208
|
+
|
|
209
|
+
request_options : typing.Optional[RequestOptions]
|
|
210
|
+
Request-specific configuration.
|
|
211
|
+
|
|
212
|
+
Returns
|
|
213
|
+
-------
|
|
214
|
+
SubTenantIdsData
|
|
215
|
+
Successful Response
|
|
216
|
+
|
|
217
|
+
Examples
|
|
218
|
+
--------
|
|
219
|
+
import asyncio
|
|
220
|
+
|
|
221
|
+
from usecortex-ai import AsyncCortexAI
|
|
222
|
+
|
|
223
|
+
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
224
|
+
async def main() -> None:
|
|
225
|
+
await client.tenant.get_sub_tenant_ids(tenant_id='tenant_1234', )
|
|
226
|
+
asyncio.run(main())
|
|
227
|
+
"""
|
|
228
|
+
_response = await self._raw_client.get_sub_tenant_ids(tenant_id=tenant_id, request_options=request_options)
|
|
229
|
+
return _response.data
|
|
230
|
+
|
|
231
|
+
async def delete_sub_tenant(
|
|
232
|
+
self, *, tenant_id: str, sub_tenant_id: str, request_options: typing.Optional[RequestOptions] = None
|
|
233
|
+
) -> DeleteSubTenantData:
|
|
234
|
+
"""
|
|
235
|
+
Delete a sub-tenant from a given tenant.
|
|
236
|
+
|
|
237
|
+
This endpoint deletes a specific sub-tenant from the specified tenant.
|
|
238
|
+
It validates that the sub-tenant is not the primary/default sub-tenant before deletion.
|
|
239
|
+
|
|
240
|
+
Parameters
|
|
241
|
+
----------
|
|
242
|
+
tenant_id : str
|
|
243
|
+
|
|
244
|
+
sub_tenant_id : str
|
|
245
|
+
|
|
246
|
+
request_options : typing.Optional[RequestOptions]
|
|
247
|
+
Request-specific configuration.
|
|
248
|
+
|
|
249
|
+
Returns
|
|
250
|
+
-------
|
|
251
|
+
DeleteSubTenantData
|
|
252
|
+
Successful Response
|
|
253
|
+
|
|
254
|
+
Examples
|
|
255
|
+
--------
|
|
256
|
+
import asyncio
|
|
257
|
+
|
|
258
|
+
from usecortex-ai import AsyncCortexAI
|
|
259
|
+
|
|
260
|
+
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
261
|
+
async def main() -> None:
|
|
262
|
+
await client.tenant.delete_sub_tenant(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
|
|
263
|
+
asyncio.run(main())
|
|
264
|
+
"""
|
|
265
|
+
_response = await self._raw_client.delete_sub_tenant(
|
|
266
|
+
tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
267
|
+
)
|
|
268
|
+
return _response.data
|