usecortex-ai 0.3.6__py3-none-any.whl → 0.4.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 +80 -70
- usecortex_ai/client.py +25 -23
- usecortex_ai/dashboard/client.py +448 -0
- usecortex_ai/{user_memory → dashboard}/raw_client.py +371 -530
- usecortex_ai/embeddings/client.py +229 -102
- usecortex_ai/embeddings/raw_client.py +323 -211
- usecortex_ai/errors/__init__.py +2 -0
- usecortex_ai/errors/bad_request_error.py +1 -2
- usecortex_ai/errors/forbidden_error.py +1 -2
- usecortex_ai/errors/internal_server_error.py +1 -2
- usecortex_ai/errors/not_found_error.py +1 -2
- usecortex_ai/errors/service_unavailable_error.py +1 -2
- usecortex_ai/errors/too_many_requests_error.py +11 -0
- usecortex_ai/errors/unauthorized_error.py +1 -2
- usecortex_ai/fetch/client.py +350 -29
- usecortex_ai/fetch/raw_client.py +919 -65
- usecortex_ai/raw_client.py +8 -2
- usecortex_ai/search/client.py +293 -257
- usecortex_ai/search/raw_client.py +445 -346
- usecortex_ai/search/types/alpha.py +1 -1
- usecortex_ai/sources/client.py +29 -216
- usecortex_ai/sources/raw_client.py +51 -589
- usecortex_ai/tenant/client.py +155 -118
- usecortex_ai/tenant/raw_client.py +227 -350
- usecortex_ai/types/__init__.py +74 -66
- usecortex_ai/types/add_memory_response.py +39 -0
- usecortex_ai/types/{relations.py → api_key_info.py} +25 -5
- usecortex_ai/types/app_sources_upload_data.py +15 -6
- usecortex_ai/types/{file_upload_result.py → collection_stats.py} +5 -5
- usecortex_ai/types/custom_property_definition.py +75 -0
- usecortex_ai/types/dashboard_apis_response.py +33 -0
- usecortex_ai/types/dashboard_sources_response.py +33 -0
- usecortex_ai/types/dashboard_tenants_response.py +33 -0
- usecortex_ai/types/{list_sources_response.py → delete_result.py} +10 -7
- usecortex_ai/types/delete_user_memory_response.py +1 -1
- usecortex_ai/types/entity.py +4 -4
- usecortex_ai/types/fetch_mode.py +5 -0
- usecortex_ai/types/graph_context.py +26 -0
- usecortex_ai/types/{delete_sources.py → infra.py} +4 -3
- usecortex_ai/types/{fetch_content_data.py → insert_result.py} +12 -8
- usecortex_ai/types/memory_item.py +82 -0
- usecortex_ai/types/memory_result_item.py +47 -0
- usecortex_ai/types/milvus_data_type.py +21 -0
- usecortex_ai/types/path_triplet.py +3 -18
- usecortex_ai/types/processing_status.py +3 -2
- usecortex_ai/types/processing_status_indexing_status.py +7 -0
- usecortex_ai/types/qn_a_search_response.py +49 -0
- usecortex_ai/types/{retrieve_response.py → raw_embedding_document.py} +11 -8
- usecortex_ai/types/raw_embedding_search_result.py +47 -0
- usecortex_ai/types/{user_memory.py → raw_embedding_vector.py} +6 -6
- usecortex_ai/types/relation_evidence.py +24 -5
- usecortex_ai/types/retrieval_result.py +26 -0
- usecortex_ai/types/scored_path_response.py +5 -19
- usecortex_ai/types/search_mode.py +5 -0
- usecortex_ai/types/{batch_upload_data.py → source_delete_response.py} +8 -8
- usecortex_ai/types/{list_user_memories_response.py → source_delete_result_item.py} +11 -7
- usecortex_ai/types/source_fetch_response.py +70 -0
- usecortex_ai/types/{graph_relations_response.py → source_graph_relations_response.py} +3 -3
- usecortex_ai/types/{single_upload_data.py → source_list_response.py} +7 -10
- usecortex_ai/types/source_model.py +11 -1
- usecortex_ai/types/source_status.py +5 -0
- usecortex_ai/types/source_upload_response.py +35 -0
- usecortex_ai/types/source_upload_result_item.py +38 -0
- usecortex_ai/types/supported_llm_providers.py +5 -0
- usecortex_ai/types/{embeddings_create_collection_data.py → tenant_create_response.py} +9 -7
- usecortex_ai/types/{webpage_scrape_request.py → tenant_info.py} +10 -5
- usecortex_ai/types/{scored_triplet_response.py → tenant_metadata_schema_info.py} +8 -15
- usecortex_ai/types/{tenant_create_data.py → tenant_stats_response.py} +9 -8
- usecortex_ai/types/{triple_with_evidence.py → triplet_with_evidence.py} +5 -1
- usecortex_ai/types/user_assistant_pair.py +4 -0
- usecortex_ai/types/{search_chunk.py → vector_store_chunk.py} +3 -14
- usecortex_ai/upload/__init__.py +3 -0
- usecortex_ai/upload/client.py +233 -1937
- usecortex_ai/upload/raw_client.py +364 -4401
- usecortex_ai/upload/types/__init__.py +7 -0
- usecortex_ai/upload/types/body_upload_app_ingestion_upload_app_post_app_sources.py +7 -0
- {usecortex_ai-0.3.6.dist-info → usecortex_ai-0.4.0.dist-info}/METADATA +2 -2
- usecortex_ai-0.4.0.dist-info/RECORD +113 -0
- {usecortex_ai-0.3.6.dist-info → usecortex_ai-0.4.0.dist-info}/WHEEL +1 -1
- usecortex_ai/document/client.py +0 -139
- usecortex_ai/document/raw_client.py +0 -312
- usecortex_ai/types/add_user_memory_response.py +0 -41
- usecortex_ai/types/body_scrape_webpage_upload_scrape_webpage_post.py +0 -17
- usecortex_ai/types/body_update_scrape_job_upload_update_webpage_patch.py +0 -17
- usecortex_ai/types/chunk_graph_relations_response.py +0 -33
- usecortex_ai/types/delete_memory_request.py +0 -32
- usecortex_ai/types/delete_sub_tenant_data.py +0 -42
- usecortex_ai/types/embeddings_delete_data.py +0 -37
- usecortex_ai/types/embeddings_get_data.py +0 -37
- usecortex_ai/types/embeddings_search_data.py +0 -37
- usecortex_ai/types/extended_context.py +0 -17
- usecortex_ai/types/markdown_upload_request.py +0 -41
- usecortex_ai/types/related_chunk.py +0 -22
- usecortex_ai/types/retrieve_user_memory_response.py +0 -38
- usecortex_ai/types/source.py +0 -52
- usecortex_ai/types/sub_tenant_ids_data.py +0 -47
- usecortex_ai/types/tenant_stats.py +0 -42
- usecortex_ai/user/__init__.py +0 -4
- usecortex_ai/user/client.py +0 -145
- usecortex_ai/user/raw_client.py +0 -316
- usecortex_ai/user_memory/__init__.py +0 -4
- usecortex_ai/user_memory/client.py +0 -515
- usecortex_ai-0.3.6.dist-info/RECORD +0 -112
- /usecortex_ai/{document → dashboard}/__init__.py +0 -0
- {usecortex_ai-0.3.6.dist-info → usecortex_ai-0.4.0.dist-info}/licenses/LICENSE +0 -0
- {usecortex_ai-0.3.6.dist-info → usecortex_ai-0.4.0.dist-info}/top_level.txt +0 -0
usecortex_ai/tenant/client.py
CHANGED
|
@@ -4,11 +4,14 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
6
|
from ..core.request_options import RequestOptions
|
|
7
|
-
from ..types.
|
|
8
|
-
from ..types.
|
|
9
|
-
from ..types.
|
|
7
|
+
from ..types.custom_property_definition import CustomPropertyDefinition
|
|
8
|
+
from ..types.tenant_create_response import TenantCreateResponse
|
|
9
|
+
from ..types.tenant_stats_response import TenantStatsResponse
|
|
10
10
|
from .raw_client import AsyncRawTenantClient, RawTenantClient
|
|
11
11
|
|
|
12
|
+
# this is used as the default value for optional parameters
|
|
13
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
14
|
+
|
|
12
15
|
|
|
13
16
|
class TenantClient:
|
|
14
17
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
@@ -25,36 +28,77 @@ class TenantClient:
|
|
|
25
28
|
"""
|
|
26
29
|
return self._raw_client
|
|
27
30
|
|
|
28
|
-
def
|
|
31
|
+
def create_tenant(
|
|
29
32
|
self,
|
|
30
33
|
*,
|
|
31
34
|
tenant_id: str,
|
|
32
|
-
|
|
35
|
+
is_embeddings_tenant: typing.Optional[bool] = OMIT,
|
|
36
|
+
embeddings_dimension: typing.Optional[int] = OMIT,
|
|
37
|
+
tenant_metadata_schema: typing.Optional[typing.Sequence[CustomPropertyDefinition]] = OMIT,
|
|
33
38
|
request_options: typing.Optional[RequestOptions] = None,
|
|
34
|
-
) ->
|
|
39
|
+
) -> TenantCreateResponse:
|
|
35
40
|
"""
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
Use this endpoint to
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
Create a tenant for your account.
|
|
42
|
+
|
|
43
|
+
Use this endpoint to initialize a tenant space you can use for ingestion, embeddings, and search.
|
|
44
|
+
|
|
45
|
+
**Tenant Metadata Schema**
|
|
46
|
+
|
|
47
|
+
You can optionally provide a `tenant_metadata_schema` to define custom fields that will be
|
|
48
|
+
indexed in the vector store. Each field can be configured with:
|
|
49
|
+
|
|
50
|
+
- `enable_match`: Enable text filtering on this field
|
|
51
|
+
- `enable_dense_embedding`: Create dense embeddings for semantic similarity search
|
|
52
|
+
- `enable_sparse_embedding`: Create sparse embeddings (BM25) for keyword search
|
|
53
|
+
|
|
54
|
+
**Example Request:**
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"tenant_id": "my-tenant",
|
|
58
|
+
"tenant_metadata_schema": [
|
|
59
|
+
{
|
|
60
|
+
"name": "category",
|
|
61
|
+
"data_type": "VARCHAR",
|
|
62
|
+
"max_length": 256,
|
|
63
|
+
"enable_match": true
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "product_description",
|
|
67
|
+
"data_type": "VARCHAR",
|
|
68
|
+
"max_length": 4096,
|
|
69
|
+
"enable_dense_embedding": true,
|
|
70
|
+
"enable_sparse_embedding": true
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Expected outcome:
|
|
77
|
+
- A tenant is created and returned with its identifier.
|
|
78
|
+
- If tenant_metadata_schema is provided, the vector store collection will include
|
|
79
|
+
the specified custom fields with their configured search capabilities.
|
|
80
|
+
- If the tenant already exists, you receive a success message with the existing identifier.
|
|
43
81
|
|
|
44
82
|
Parameters
|
|
45
83
|
----------
|
|
46
84
|
tenant_id : str
|
|
47
|
-
Unique identifier
|
|
85
|
+
Unique tenant identifier
|
|
86
|
+
|
|
87
|
+
is_embeddings_tenant : typing.Optional[bool]
|
|
88
|
+
True to create embeddings tenant
|
|
48
89
|
|
|
49
|
-
|
|
50
|
-
|
|
90
|
+
embeddings_dimension : typing.Optional[int]
|
|
91
|
+
Embedding dimensions for embeddings tenant. Not required for non-embeddings (is_embeddings_tenant=False) tenants
|
|
92
|
+
|
|
93
|
+
tenant_metadata_schema : typing.Optional[typing.Sequence[CustomPropertyDefinition]]
|
|
94
|
+
Schema definition for tenant metadata fields. Each field can be configured for: filtering (enable_match), semantic search (enable_dense_embedding), and/or keyword search (enable_sparse_embedding). Fields with embeddings enabled must be VARCHAR type.
|
|
51
95
|
|
|
52
96
|
request_options : typing.Optional[RequestOptions]
|
|
53
97
|
Request-specific configuration.
|
|
54
98
|
|
|
55
99
|
Returns
|
|
56
100
|
-------
|
|
57
|
-
|
|
101
|
+
TenantCreateResponse
|
|
58
102
|
Successful Response
|
|
59
103
|
|
|
60
104
|
Examples
|
|
@@ -62,62 +106,41 @@ class TenantClient:
|
|
|
62
106
|
from usecortex-ai import CortexAI
|
|
63
107
|
|
|
64
108
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
65
|
-
client.tenant.
|
|
109
|
+
client.tenant.create_tenant(tenant_id='tenant_id', )
|
|
66
110
|
"""
|
|
67
|
-
_response = self._raw_client.
|
|
68
|
-
tenant_id=tenant_id,
|
|
111
|
+
_response = self._raw_client.create_tenant(
|
|
112
|
+
tenant_id=tenant_id,
|
|
113
|
+
is_embeddings_tenant=is_embeddings_tenant,
|
|
114
|
+
embeddings_dimension=embeddings_dimension,
|
|
115
|
+
tenant_metadata_schema=tenant_metadata_schema,
|
|
116
|
+
request_options=request_options,
|
|
69
117
|
)
|
|
70
118
|
return _response.data
|
|
71
119
|
|
|
72
|
-
def
|
|
73
|
-
self, *, tenant_id: str, request_options: typing.Optional[RequestOptions] = None
|
|
74
|
-
) -> SubTenantIdsData:
|
|
120
|
+
def stats(self, *, tenant_id: str, request_options: typing.Optional[RequestOptions] = None) -> TenantStatsResponse:
|
|
75
121
|
"""
|
|
76
|
-
Retrieve
|
|
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
|
|
122
|
+
Retrieve usage stats for your tenant.
|
|
89
123
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
124
|
+
Use this endpoint to check whether a tenant exists and view core metrics like total
|
|
125
|
+
indexed objects and vector dimension. This helps you validate
|
|
126
|
+
setup and monitor ingestion.
|
|
93
127
|
|
|
94
|
-
|
|
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.
|
|
128
|
+
Expected outcome
|
|
105
129
|
|
|
106
|
-
|
|
107
|
-
|
|
130
|
+
You receive the current object count and vector dimension for the tenant.
|
|
131
|
+
If the tenant does not exist, you get a not-found error.
|
|
108
132
|
|
|
109
133
|
Parameters
|
|
110
134
|
----------
|
|
111
135
|
tenant_id : str
|
|
112
|
-
|
|
113
|
-
sub_tenant_id : str
|
|
136
|
+
Unique identifier for the tenant/organization
|
|
114
137
|
|
|
115
138
|
request_options : typing.Optional[RequestOptions]
|
|
116
139
|
Request-specific configuration.
|
|
117
140
|
|
|
118
141
|
Returns
|
|
119
142
|
-------
|
|
120
|
-
|
|
143
|
+
TenantStatsResponse
|
|
121
144
|
Successful Response
|
|
122
145
|
|
|
123
146
|
Examples
|
|
@@ -125,11 +148,9 @@ class TenantClient:
|
|
|
125
148
|
from usecortex-ai import CortexAI
|
|
126
149
|
|
|
127
150
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
128
|
-
client.tenant.
|
|
151
|
+
client.tenant.stats(tenant_id='tenant_id', )
|
|
129
152
|
"""
|
|
130
|
-
_response = self._raw_client.
|
|
131
|
-
tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
132
|
-
)
|
|
153
|
+
_response = self._raw_client.stats(tenant_id=tenant_id, request_options=request_options)
|
|
133
154
|
return _response.data
|
|
134
155
|
|
|
135
156
|
|
|
@@ -148,36 +169,77 @@ class AsyncTenantClient:
|
|
|
148
169
|
"""
|
|
149
170
|
return self._raw_client
|
|
150
171
|
|
|
151
|
-
async def
|
|
172
|
+
async def create_tenant(
|
|
152
173
|
self,
|
|
153
174
|
*,
|
|
154
175
|
tenant_id: str,
|
|
155
|
-
|
|
176
|
+
is_embeddings_tenant: typing.Optional[bool] = OMIT,
|
|
177
|
+
embeddings_dimension: typing.Optional[int] = OMIT,
|
|
178
|
+
tenant_metadata_schema: typing.Optional[typing.Sequence[CustomPropertyDefinition]] = OMIT,
|
|
156
179
|
request_options: typing.Optional[RequestOptions] = None,
|
|
157
|
-
) ->
|
|
180
|
+
) -> TenantCreateResponse:
|
|
158
181
|
"""
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
Use this endpoint to
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
182
|
+
Create a tenant for your account.
|
|
183
|
+
|
|
184
|
+
Use this endpoint to initialize a tenant space you can use for ingestion, embeddings, and search.
|
|
185
|
+
|
|
186
|
+
**Tenant Metadata Schema**
|
|
187
|
+
|
|
188
|
+
You can optionally provide a `tenant_metadata_schema` to define custom fields that will be
|
|
189
|
+
indexed in the vector store. Each field can be configured with:
|
|
190
|
+
|
|
191
|
+
- `enable_match`: Enable text filtering on this field
|
|
192
|
+
- `enable_dense_embedding`: Create dense embeddings for semantic similarity search
|
|
193
|
+
- `enable_sparse_embedding`: Create sparse embeddings (BM25) for keyword search
|
|
194
|
+
|
|
195
|
+
**Example Request:**
|
|
196
|
+
```json
|
|
197
|
+
{
|
|
198
|
+
"tenant_id": "my-tenant",
|
|
199
|
+
"tenant_metadata_schema": [
|
|
200
|
+
{
|
|
201
|
+
"name": "category",
|
|
202
|
+
"data_type": "VARCHAR",
|
|
203
|
+
"max_length": 256,
|
|
204
|
+
"enable_match": true
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"name": "product_description",
|
|
208
|
+
"data_type": "VARCHAR",
|
|
209
|
+
"max_length": 4096,
|
|
210
|
+
"enable_dense_embedding": true,
|
|
211
|
+
"enable_sparse_embedding": true
|
|
212
|
+
}
|
|
213
|
+
]
|
|
214
|
+
}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Expected outcome:
|
|
218
|
+
- A tenant is created and returned with its identifier.
|
|
219
|
+
- If tenant_metadata_schema is provided, the vector store collection will include
|
|
220
|
+
the specified custom fields with their configured search capabilities.
|
|
221
|
+
- If the tenant already exists, you receive a success message with the existing identifier.
|
|
166
222
|
|
|
167
223
|
Parameters
|
|
168
224
|
----------
|
|
169
225
|
tenant_id : str
|
|
170
|
-
Unique identifier
|
|
226
|
+
Unique tenant identifier
|
|
227
|
+
|
|
228
|
+
is_embeddings_tenant : typing.Optional[bool]
|
|
229
|
+
True to create embeddings tenant
|
|
171
230
|
|
|
172
|
-
|
|
173
|
-
|
|
231
|
+
embeddings_dimension : typing.Optional[int]
|
|
232
|
+
Embedding dimensions for embeddings tenant. Not required for non-embeddings (is_embeddings_tenant=False) tenants
|
|
233
|
+
|
|
234
|
+
tenant_metadata_schema : typing.Optional[typing.Sequence[CustomPropertyDefinition]]
|
|
235
|
+
Schema definition for tenant metadata fields. Each field can be configured for: filtering (enable_match), semantic search (enable_dense_embedding), and/or keyword search (enable_sparse_embedding). Fields with embeddings enabled must be VARCHAR type.
|
|
174
236
|
|
|
175
237
|
request_options : typing.Optional[RequestOptions]
|
|
176
238
|
Request-specific configuration.
|
|
177
239
|
|
|
178
240
|
Returns
|
|
179
241
|
-------
|
|
180
|
-
|
|
242
|
+
TenantCreateResponse
|
|
181
243
|
Successful Response
|
|
182
244
|
|
|
183
245
|
Examples
|
|
@@ -188,67 +250,44 @@ class AsyncTenantClient:
|
|
|
188
250
|
|
|
189
251
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
190
252
|
async def main() -> None:
|
|
191
|
-
await client.tenant.
|
|
253
|
+
await client.tenant.create_tenant(tenant_id='tenant_id', )
|
|
192
254
|
asyncio.run(main())
|
|
193
255
|
"""
|
|
194
|
-
_response = await self._raw_client.
|
|
195
|
-
tenant_id=tenant_id,
|
|
256
|
+
_response = await self._raw_client.create_tenant(
|
|
257
|
+
tenant_id=tenant_id,
|
|
258
|
+
is_embeddings_tenant=is_embeddings_tenant,
|
|
259
|
+
embeddings_dimension=embeddings_dimension,
|
|
260
|
+
tenant_metadata_schema=tenant_metadata_schema,
|
|
261
|
+
request_options=request_options,
|
|
196
262
|
)
|
|
197
263
|
return _response.data
|
|
198
264
|
|
|
199
|
-
async def
|
|
265
|
+
async def stats(
|
|
200
266
|
self, *, tenant_id: str, request_options: typing.Optional[RequestOptions] = None
|
|
201
|
-
) ->
|
|
267
|
+
) -> TenantStatsResponse:
|
|
202
268
|
"""
|
|
203
|
-
Retrieve
|
|
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
|
|
269
|
+
Retrieve usage stats for your tenant.
|
|
216
270
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
271
|
+
Use this endpoint to check whether a tenant exists and view core metrics like total
|
|
272
|
+
indexed objects and vector dimension. This helps you validate
|
|
273
|
+
setup and monitor ingestion.
|
|
220
274
|
|
|
221
|
-
|
|
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.
|
|
275
|
+
Expected outcome
|
|
236
276
|
|
|
237
|
-
|
|
238
|
-
|
|
277
|
+
You receive the current object count and vector dimension for the tenant.
|
|
278
|
+
If the tenant does not exist, you get a not-found error.
|
|
239
279
|
|
|
240
280
|
Parameters
|
|
241
281
|
----------
|
|
242
282
|
tenant_id : str
|
|
243
|
-
|
|
244
|
-
sub_tenant_id : str
|
|
283
|
+
Unique identifier for the tenant/organization
|
|
245
284
|
|
|
246
285
|
request_options : typing.Optional[RequestOptions]
|
|
247
286
|
Request-specific configuration.
|
|
248
287
|
|
|
249
288
|
Returns
|
|
250
289
|
-------
|
|
251
|
-
|
|
290
|
+
TenantStatsResponse
|
|
252
291
|
Successful Response
|
|
253
292
|
|
|
254
293
|
Examples
|
|
@@ -259,10 +298,8 @@ class AsyncTenantClient:
|
|
|
259
298
|
|
|
260
299
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
261
300
|
async def main() -> None:
|
|
262
|
-
await client.tenant.
|
|
301
|
+
await client.tenant.stats(tenant_id='tenant_id', )
|
|
263
302
|
asyncio.run(main())
|
|
264
303
|
"""
|
|
265
|
-
_response = await self._raw_client.
|
|
266
|
-
tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
267
|
-
)
|
|
304
|
+
_response = await self._raw_client.stats(tenant_id=tenant_id, request_options=request_options)
|
|
268
305
|
return _response.data
|