usecortex-ai 0.2.2__py3-none-any.whl → 0.3.1__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/client.py +80 -6
- usecortex_ai/core/client_wrapper.py +8 -6
- usecortex_ai/document/client.py +4 -4
- usecortex_ai/document/raw_client.py +2 -2
- usecortex_ai/embeddings/client.py +14 -14
- usecortex_ai/embeddings/raw_client.py +10 -10
- usecortex_ai/fetch/client.py +2 -12
- usecortex_ai/fetch/raw_client.py +0 -10
- usecortex_ai/raw_client.py +90 -0
- usecortex_ai/search/client.py +22 -12
- usecortex_ai/search/raw_client.py +16 -6
- usecortex_ai/sources/client.py +20 -8
- usecortex_ai/sources/raw_client.py +16 -2
- usecortex_ai/tenant/client.py +8 -8
- usecortex_ai/tenant/raw_client.py +2 -2
- usecortex_ai/types/delete_memory_request.py +1 -1
- usecortex_ai/types/markdown_upload_request.py +5 -0
- usecortex_ai/types/sub_tenant_ids_data.py +5 -0
- usecortex_ai/types/tenant_stats.py +2 -2
- usecortex_ai/upload/client.py +122 -62
- usecortex_ai/upload/raw_client.py +90 -30
- usecortex_ai/user/client.py +16 -4
- usecortex_ai/user/raw_client.py +8 -0
- usecortex_ai/user_memory/client.py +36 -26
- usecortex_ai/user_memory/raw_client.py +26 -16
- usecortex_ai-0.3.1.dist-info/METADATA +66 -0
- {usecortex_ai-0.2.2.dist-info → usecortex_ai-0.3.1.dist-info}/RECORD +30 -29
- usecortex_ai-0.2.2.dist-info/METADATA +0 -136
- {usecortex_ai-0.2.2.dist-info → usecortex_ai-0.3.1.dist-info}/WHEEL +0 -0
- {usecortex_ai-0.2.2.dist-info → usecortex_ai-0.3.1.dist-info}/licenses/LICENSE +0 -0
- {usecortex_ai-0.2.2.dist-info → usecortex_ai-0.3.1.dist-info}/top_level.txt +0 -0
usecortex_ai/search/client.py
CHANGED
|
@@ -119,7 +119,7 @@ class SearchClient:
|
|
|
119
119
|
from usecortex-ai import CortexAI
|
|
120
120
|
|
|
121
121
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
122
|
-
client.search.qna(question='
|
|
122
|
+
client.search.qna(question='What is Cortex AI', session_id='chat_session_1234', tenant_id='tenant_1234', )
|
|
123
123
|
"""
|
|
124
124
|
_response = self._raw_client.qna(
|
|
125
125
|
question=question,
|
|
@@ -152,6 +152,7 @@ class SearchClient:
|
|
|
152
152
|
max_chunks: typing.Optional[int] = OMIT,
|
|
153
153
|
alpha: typing.Optional[Alpha] = OMIT,
|
|
154
154
|
recency_bias: typing.Optional[float] = OMIT,
|
|
155
|
+
personalise_search: typing.Optional[bool] = OMIT,
|
|
155
156
|
request_options: typing.Optional[RequestOptions] = None,
|
|
156
157
|
) -> typing.List[SearchChunk]:
|
|
157
158
|
"""
|
|
@@ -169,7 +170,7 @@ class SearchClient:
|
|
|
169
170
|
Unique identifier for the tenant/organization
|
|
170
171
|
|
|
171
172
|
sub_tenant_id : typing.Optional[str]
|
|
172
|
-
Optional sub-tenant identifier
|
|
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.
|
|
173
174
|
|
|
174
175
|
max_chunks : typing.Optional[int]
|
|
175
176
|
Maximum number of results to return
|
|
@@ -180,6 +181,9 @@ class SearchClient:
|
|
|
180
181
|
recency_bias : typing.Optional[float]
|
|
181
182
|
Preference for newer content (0.0 = no bias, 1.0 = strong recency preference)
|
|
182
183
|
|
|
184
|
+
personalise_search : typing.Optional[bool]
|
|
185
|
+
Enable personalized search results based on user preferences
|
|
186
|
+
|
|
183
187
|
request_options : typing.Optional[RequestOptions]
|
|
184
188
|
Request-specific configuration.
|
|
185
189
|
|
|
@@ -193,7 +197,7 @@ class SearchClient:
|
|
|
193
197
|
from usecortex-ai import CortexAI
|
|
194
198
|
|
|
195
199
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
196
|
-
client.search.retrieve(query='
|
|
200
|
+
client.search.retrieve(query='Which mode does user prefer', tenant_id='tenant_1234', )
|
|
197
201
|
"""
|
|
198
202
|
_response = self._raw_client.retrieve(
|
|
199
203
|
query=query,
|
|
@@ -202,6 +206,7 @@ class SearchClient:
|
|
|
202
206
|
max_chunks=max_chunks,
|
|
203
207
|
alpha=alpha,
|
|
204
208
|
recency_bias=recency_bias,
|
|
209
|
+
personalise_search=personalise_search,
|
|
205
210
|
request_options=request_options,
|
|
206
211
|
)
|
|
207
212
|
return _response.data
|
|
@@ -220,7 +225,7 @@ class SearchClient:
|
|
|
220
225
|
Perform full text search for exact matches within your indexed sources.
|
|
221
226
|
|
|
222
227
|
Use this endpoint to find content chunks using BM25-based text matching with configurable operators.
|
|
223
|
-
Choose between OR and AND operators to control how search terms are combined for precise text matching.
|
|
228
|
+
Choose between 'OR' and 'AND' operators to control how search terms are combined for precise text matching.
|
|
224
229
|
|
|
225
230
|
Parameters
|
|
226
231
|
----------
|
|
@@ -231,7 +236,7 @@ class SearchClient:
|
|
|
231
236
|
Unique identifier for the tenant/organization
|
|
232
237
|
|
|
233
238
|
sub_tenant_id : typing.Optional[str]
|
|
234
|
-
Optional sub-tenant identifier
|
|
239
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
235
240
|
|
|
236
241
|
operator : typing.Optional[Bm25OperatorType]
|
|
237
242
|
How to combine search terms (OR or AND)
|
|
@@ -252,7 +257,7 @@ class SearchClient:
|
|
|
252
257
|
from usecortex-ai import CortexAI
|
|
253
258
|
|
|
254
259
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
255
|
-
client.search.full_text_search(query='
|
|
260
|
+
client.search.full_text_search(query='John Smith Jake', tenant_id='tenant_1234', )
|
|
256
261
|
"""
|
|
257
262
|
_response = self._raw_client.full_text_search(
|
|
258
263
|
query=query,
|
|
@@ -374,7 +379,7 @@ class AsyncSearchClient:
|
|
|
374
379
|
|
|
375
380
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
376
381
|
async def main() -> None:
|
|
377
|
-
await client.search.qna(question='
|
|
382
|
+
await client.search.qna(question='What is Cortex AI', session_id='chat_session_1234', tenant_id='tenant_1234', )
|
|
378
383
|
asyncio.run(main())
|
|
379
384
|
"""
|
|
380
385
|
_response = await self._raw_client.qna(
|
|
@@ -408,6 +413,7 @@ class AsyncSearchClient:
|
|
|
408
413
|
max_chunks: typing.Optional[int] = OMIT,
|
|
409
414
|
alpha: typing.Optional[Alpha] = OMIT,
|
|
410
415
|
recency_bias: typing.Optional[float] = OMIT,
|
|
416
|
+
personalise_search: typing.Optional[bool] = OMIT,
|
|
411
417
|
request_options: typing.Optional[RequestOptions] = None,
|
|
412
418
|
) -> typing.List[SearchChunk]:
|
|
413
419
|
"""
|
|
@@ -425,7 +431,7 @@ class AsyncSearchClient:
|
|
|
425
431
|
Unique identifier for the tenant/organization
|
|
426
432
|
|
|
427
433
|
sub_tenant_id : typing.Optional[str]
|
|
428
|
-
Optional sub-tenant identifier
|
|
434
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
429
435
|
|
|
430
436
|
max_chunks : typing.Optional[int]
|
|
431
437
|
Maximum number of results to return
|
|
@@ -436,6 +442,9 @@ class AsyncSearchClient:
|
|
|
436
442
|
recency_bias : typing.Optional[float]
|
|
437
443
|
Preference for newer content (0.0 = no bias, 1.0 = strong recency preference)
|
|
438
444
|
|
|
445
|
+
personalise_search : typing.Optional[bool]
|
|
446
|
+
Enable personalized search results based on user preferences
|
|
447
|
+
|
|
439
448
|
request_options : typing.Optional[RequestOptions]
|
|
440
449
|
Request-specific configuration.
|
|
441
450
|
|
|
@@ -452,7 +461,7 @@ class AsyncSearchClient:
|
|
|
452
461
|
|
|
453
462
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
454
463
|
async def main() -> None:
|
|
455
|
-
await client.search.retrieve(query='
|
|
464
|
+
await client.search.retrieve(query='Which mode does user prefer', tenant_id='tenant_1234', )
|
|
456
465
|
asyncio.run(main())
|
|
457
466
|
"""
|
|
458
467
|
_response = await self._raw_client.retrieve(
|
|
@@ -462,6 +471,7 @@ class AsyncSearchClient:
|
|
|
462
471
|
max_chunks=max_chunks,
|
|
463
472
|
alpha=alpha,
|
|
464
473
|
recency_bias=recency_bias,
|
|
474
|
+
personalise_search=personalise_search,
|
|
465
475
|
request_options=request_options,
|
|
466
476
|
)
|
|
467
477
|
return _response.data
|
|
@@ -480,7 +490,7 @@ class AsyncSearchClient:
|
|
|
480
490
|
Perform full text search for exact matches within your indexed sources.
|
|
481
491
|
|
|
482
492
|
Use this endpoint to find content chunks using BM25-based text matching with configurable operators.
|
|
483
|
-
Choose between OR and AND operators to control how search terms are combined for precise text matching.
|
|
493
|
+
Choose between 'OR' and 'AND' operators to control how search terms are combined for precise text matching.
|
|
484
494
|
|
|
485
495
|
Parameters
|
|
486
496
|
----------
|
|
@@ -491,7 +501,7 @@ class AsyncSearchClient:
|
|
|
491
501
|
Unique identifier for the tenant/organization
|
|
492
502
|
|
|
493
503
|
sub_tenant_id : typing.Optional[str]
|
|
494
|
-
Optional sub-tenant identifier
|
|
504
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
495
505
|
|
|
496
506
|
operator : typing.Optional[Bm25OperatorType]
|
|
497
507
|
How to combine search terms (OR or AND)
|
|
@@ -515,7 +525,7 @@ class AsyncSearchClient:
|
|
|
515
525
|
|
|
516
526
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
517
527
|
async def main() -> None:
|
|
518
|
-
await client.search.full_text_search(query='
|
|
528
|
+
await client.search.full_text_search(query='John Smith Jake', tenant_id='tenant_1234', )
|
|
519
529
|
asyncio.run(main())
|
|
520
530
|
"""
|
|
521
531
|
_response = await self._raw_client.full_text_search(
|
|
@@ -246,6 +246,7 @@ class RawSearchClient:
|
|
|
246
246
|
max_chunks: typing.Optional[int] = OMIT,
|
|
247
247
|
alpha: typing.Optional[Alpha] = OMIT,
|
|
248
248
|
recency_bias: typing.Optional[float] = OMIT,
|
|
249
|
+
personalise_search: typing.Optional[bool] = OMIT,
|
|
249
250
|
request_options: typing.Optional[RequestOptions] = None,
|
|
250
251
|
) -> HttpResponse[typing.List[SearchChunk]]:
|
|
251
252
|
"""
|
|
@@ -263,7 +264,7 @@ class RawSearchClient:
|
|
|
263
264
|
Unique identifier for the tenant/organization
|
|
264
265
|
|
|
265
266
|
sub_tenant_id : typing.Optional[str]
|
|
266
|
-
Optional sub-tenant identifier
|
|
267
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
267
268
|
|
|
268
269
|
max_chunks : typing.Optional[int]
|
|
269
270
|
Maximum number of results to return
|
|
@@ -274,6 +275,9 @@ class RawSearchClient:
|
|
|
274
275
|
recency_bias : typing.Optional[float]
|
|
275
276
|
Preference for newer content (0.0 = no bias, 1.0 = strong recency preference)
|
|
276
277
|
|
|
278
|
+
personalise_search : typing.Optional[bool]
|
|
279
|
+
Enable personalized search results based on user preferences
|
|
280
|
+
|
|
277
281
|
request_options : typing.Optional[RequestOptions]
|
|
278
282
|
Request-specific configuration.
|
|
279
283
|
|
|
@@ -292,6 +296,7 @@ class RawSearchClient:
|
|
|
292
296
|
"max_chunks": max_chunks,
|
|
293
297
|
"alpha": convert_and_respect_annotation_metadata(object_=alpha, annotation=Alpha, direction="write"),
|
|
294
298
|
"recency_bias": recency_bias,
|
|
299
|
+
"personalise_search": personalise_search,
|
|
295
300
|
},
|
|
296
301
|
headers={
|
|
297
302
|
"content-type": "application/json",
|
|
@@ -405,7 +410,7 @@ class RawSearchClient:
|
|
|
405
410
|
Perform full text search for exact matches within your indexed sources.
|
|
406
411
|
|
|
407
412
|
Use this endpoint to find content chunks using BM25-based text matching with configurable operators.
|
|
408
|
-
Choose between OR and AND operators to control how search terms are combined for precise text matching.
|
|
413
|
+
Choose between 'OR' and 'AND' operators to control how search terms are combined for precise text matching.
|
|
409
414
|
|
|
410
415
|
Parameters
|
|
411
416
|
----------
|
|
@@ -416,7 +421,7 @@ class RawSearchClient:
|
|
|
416
421
|
Unique identifier for the tenant/organization
|
|
417
422
|
|
|
418
423
|
sub_tenant_id : typing.Optional[str]
|
|
419
|
-
Optional sub-tenant identifier
|
|
424
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
420
425
|
|
|
421
426
|
operator : typing.Optional[Bm25OperatorType]
|
|
422
427
|
How to combine search terms (OR or AND)
|
|
@@ -762,6 +767,7 @@ class AsyncRawSearchClient:
|
|
|
762
767
|
max_chunks: typing.Optional[int] = OMIT,
|
|
763
768
|
alpha: typing.Optional[Alpha] = OMIT,
|
|
764
769
|
recency_bias: typing.Optional[float] = OMIT,
|
|
770
|
+
personalise_search: typing.Optional[bool] = OMIT,
|
|
765
771
|
request_options: typing.Optional[RequestOptions] = None,
|
|
766
772
|
) -> AsyncHttpResponse[typing.List[SearchChunk]]:
|
|
767
773
|
"""
|
|
@@ -779,7 +785,7 @@ class AsyncRawSearchClient:
|
|
|
779
785
|
Unique identifier for the tenant/organization
|
|
780
786
|
|
|
781
787
|
sub_tenant_id : typing.Optional[str]
|
|
782
|
-
Optional sub-tenant identifier
|
|
788
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
783
789
|
|
|
784
790
|
max_chunks : typing.Optional[int]
|
|
785
791
|
Maximum number of results to return
|
|
@@ -790,6 +796,9 @@ class AsyncRawSearchClient:
|
|
|
790
796
|
recency_bias : typing.Optional[float]
|
|
791
797
|
Preference for newer content (0.0 = no bias, 1.0 = strong recency preference)
|
|
792
798
|
|
|
799
|
+
personalise_search : typing.Optional[bool]
|
|
800
|
+
Enable personalized search results based on user preferences
|
|
801
|
+
|
|
793
802
|
request_options : typing.Optional[RequestOptions]
|
|
794
803
|
Request-specific configuration.
|
|
795
804
|
|
|
@@ -808,6 +817,7 @@ class AsyncRawSearchClient:
|
|
|
808
817
|
"max_chunks": max_chunks,
|
|
809
818
|
"alpha": convert_and_respect_annotation_metadata(object_=alpha, annotation=Alpha, direction="write"),
|
|
810
819
|
"recency_bias": recency_bias,
|
|
820
|
+
"personalise_search": personalise_search,
|
|
811
821
|
},
|
|
812
822
|
headers={
|
|
813
823
|
"content-type": "application/json",
|
|
@@ -921,7 +931,7 @@ class AsyncRawSearchClient:
|
|
|
921
931
|
Perform full text search for exact matches within your indexed sources.
|
|
922
932
|
|
|
923
933
|
Use this endpoint to find content chunks using BM25-based text matching with configurable operators.
|
|
924
|
-
Choose between OR and AND operators to control how search terms are combined for precise text matching.
|
|
934
|
+
Choose between 'OR' and 'AND' operators to control how search terms are combined for precise text matching.
|
|
925
935
|
|
|
926
936
|
Parameters
|
|
927
937
|
----------
|
|
@@ -932,7 +942,7 @@ class AsyncRawSearchClient:
|
|
|
932
942
|
Unique identifier for the tenant/organization
|
|
933
943
|
|
|
934
944
|
sub_tenant_id : typing.Optional[str]
|
|
935
|
-
Optional sub-tenant identifier
|
|
945
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
936
946
|
|
|
937
947
|
operator : typing.Optional[Bm25OperatorType]
|
|
938
948
|
How to combine search terms (OR or AND)
|
usecortex_ai/sources/client.py
CHANGED
|
@@ -46,7 +46,7 @@ class SourcesClient:
|
|
|
46
46
|
Unique identifier for the tenant/organization
|
|
47
47
|
|
|
48
48
|
sub_tenant_id : typing.Optional[str]
|
|
49
|
-
Optional sub-tenant identifier
|
|
49
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
50
50
|
|
|
51
51
|
request_options : typing.Optional[RequestOptions]
|
|
52
52
|
Request-specific configuration.
|
|
@@ -61,7 +61,7 @@ class SourcesClient:
|
|
|
61
61
|
from usecortex-ai import CortexAI
|
|
62
62
|
|
|
63
63
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
64
|
-
client.sources.get_all(tenant_id='
|
|
64
|
+
client.sources.get_all(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
|
|
65
65
|
"""
|
|
66
66
|
_response = self._raw_client.get_all(
|
|
67
67
|
tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
@@ -73,6 +73,7 @@ class SourcesClient:
|
|
|
73
73
|
*,
|
|
74
74
|
tenant_id: str,
|
|
75
75
|
source_ids: typing.Sequence[str],
|
|
76
|
+
sub_tenant_id: typing.Optional[str] = OMIT,
|
|
76
77
|
request_options: typing.Optional[RequestOptions] = None,
|
|
77
78
|
) -> ListSourcesResponse:
|
|
78
79
|
"""
|
|
@@ -85,8 +86,13 @@ class SourcesClient:
|
|
|
85
86
|
Parameters
|
|
86
87
|
----------
|
|
87
88
|
tenant_id : str
|
|
89
|
+
Unique identifier for the tenant/organization
|
|
88
90
|
|
|
89
91
|
source_ids : typing.Sequence[str]
|
|
92
|
+
List of source IDs to fetch
|
|
93
|
+
|
|
94
|
+
sub_tenant_id : typing.Optional[str]
|
|
95
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
90
96
|
|
|
91
97
|
request_options : typing.Optional[RequestOptions]
|
|
92
98
|
Request-specific configuration.
|
|
@@ -101,10 +107,10 @@ class SourcesClient:
|
|
|
101
107
|
from usecortex-ai import CortexAI
|
|
102
108
|
|
|
103
109
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
104
|
-
client.sources.get_by_ids(tenant_id='
|
|
110
|
+
client.sources.get_by_ids(tenant_id='tenant_1234', source_ids=['CortexDoc1234', 'CortexDoc4567'], )
|
|
105
111
|
"""
|
|
106
112
|
_response = self._raw_client.get_by_ids(
|
|
107
|
-
tenant_id=tenant_id, source_ids=source_ids, request_options=request_options
|
|
113
|
+
tenant_id=tenant_id, source_ids=source_ids, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
108
114
|
)
|
|
109
115
|
return _response.data
|
|
110
116
|
|
|
@@ -144,7 +150,7 @@ class AsyncSourcesClient:
|
|
|
144
150
|
Unique identifier for the tenant/organization
|
|
145
151
|
|
|
146
152
|
sub_tenant_id : typing.Optional[str]
|
|
147
|
-
Optional sub-tenant identifier
|
|
153
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
148
154
|
|
|
149
155
|
request_options : typing.Optional[RequestOptions]
|
|
150
156
|
Request-specific configuration.
|
|
@@ -162,7 +168,7 @@ class AsyncSourcesClient:
|
|
|
162
168
|
|
|
163
169
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
164
170
|
async def main() -> None:
|
|
165
|
-
await client.sources.get_all(tenant_id='
|
|
171
|
+
await client.sources.get_all(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
|
|
166
172
|
asyncio.run(main())
|
|
167
173
|
"""
|
|
168
174
|
_response = await self._raw_client.get_all(
|
|
@@ -175,6 +181,7 @@ class AsyncSourcesClient:
|
|
|
175
181
|
*,
|
|
176
182
|
tenant_id: str,
|
|
177
183
|
source_ids: typing.Sequence[str],
|
|
184
|
+
sub_tenant_id: typing.Optional[str] = OMIT,
|
|
178
185
|
request_options: typing.Optional[RequestOptions] = None,
|
|
179
186
|
) -> ListSourcesResponse:
|
|
180
187
|
"""
|
|
@@ -187,8 +194,13 @@ class AsyncSourcesClient:
|
|
|
187
194
|
Parameters
|
|
188
195
|
----------
|
|
189
196
|
tenant_id : str
|
|
197
|
+
Unique identifier for the tenant/organization
|
|
190
198
|
|
|
191
199
|
source_ids : typing.Sequence[str]
|
|
200
|
+
List of source IDs to fetch
|
|
201
|
+
|
|
202
|
+
sub_tenant_id : typing.Optional[str]
|
|
203
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
192
204
|
|
|
193
205
|
request_options : typing.Optional[RequestOptions]
|
|
194
206
|
Request-specific configuration.
|
|
@@ -206,10 +218,10 @@ class AsyncSourcesClient:
|
|
|
206
218
|
|
|
207
219
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
208
220
|
async def main() -> None:
|
|
209
|
-
await client.sources.get_by_ids(tenant_id='
|
|
221
|
+
await client.sources.get_by_ids(tenant_id='tenant_1234', source_ids=['CortexDoc1234', 'CortexDoc4567'], )
|
|
210
222
|
asyncio.run(main())
|
|
211
223
|
"""
|
|
212
224
|
_response = await self._raw_client.get_by_ids(
|
|
213
|
-
tenant_id=tenant_id, source_ids=source_ids, request_options=request_options
|
|
225
|
+
tenant_id=tenant_id, source_ids=source_ids, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
214
226
|
)
|
|
215
227
|
return _response.data
|
|
@@ -46,7 +46,7 @@ class RawSourcesClient:
|
|
|
46
46
|
Unique identifier for the tenant/organization
|
|
47
47
|
|
|
48
48
|
sub_tenant_id : typing.Optional[str]
|
|
49
|
-
Optional sub-tenant identifier
|
|
49
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
50
50
|
|
|
51
51
|
request_options : typing.Optional[RequestOptions]
|
|
52
52
|
Request-specific configuration.
|
|
@@ -162,6 +162,7 @@ class RawSourcesClient:
|
|
|
162
162
|
*,
|
|
163
163
|
tenant_id: str,
|
|
164
164
|
source_ids: typing.Sequence[str],
|
|
165
|
+
sub_tenant_id: typing.Optional[str] = OMIT,
|
|
165
166
|
request_options: typing.Optional[RequestOptions] = None,
|
|
166
167
|
) -> HttpResponse[ListSourcesResponse]:
|
|
167
168
|
"""
|
|
@@ -174,8 +175,13 @@ class RawSourcesClient:
|
|
|
174
175
|
Parameters
|
|
175
176
|
----------
|
|
176
177
|
tenant_id : str
|
|
178
|
+
Unique identifier for the tenant/organization
|
|
177
179
|
|
|
178
180
|
source_ids : typing.Sequence[str]
|
|
181
|
+
List of source IDs to fetch
|
|
182
|
+
|
|
183
|
+
sub_tenant_id : typing.Optional[str]
|
|
184
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
179
185
|
|
|
180
186
|
request_options : typing.Optional[RequestOptions]
|
|
181
187
|
Request-specific configuration.
|
|
@@ -191,6 +197,7 @@ class RawSourcesClient:
|
|
|
191
197
|
json={
|
|
192
198
|
"tenant_id": tenant_id,
|
|
193
199
|
"source_ids": source_ids,
|
|
200
|
+
"sub_tenant_id": sub_tenant_id,
|
|
194
201
|
},
|
|
195
202
|
headers={
|
|
196
203
|
"content-type": "application/json",
|
|
@@ -315,7 +322,7 @@ class AsyncRawSourcesClient:
|
|
|
315
322
|
Unique identifier for the tenant/organization
|
|
316
323
|
|
|
317
324
|
sub_tenant_id : typing.Optional[str]
|
|
318
|
-
Optional sub-tenant identifier
|
|
325
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
319
326
|
|
|
320
327
|
request_options : typing.Optional[RequestOptions]
|
|
321
328
|
Request-specific configuration.
|
|
@@ -431,6 +438,7 @@ class AsyncRawSourcesClient:
|
|
|
431
438
|
*,
|
|
432
439
|
tenant_id: str,
|
|
433
440
|
source_ids: typing.Sequence[str],
|
|
441
|
+
sub_tenant_id: typing.Optional[str] = OMIT,
|
|
434
442
|
request_options: typing.Optional[RequestOptions] = None,
|
|
435
443
|
) -> AsyncHttpResponse[ListSourcesResponse]:
|
|
436
444
|
"""
|
|
@@ -443,8 +451,13 @@ class AsyncRawSourcesClient:
|
|
|
443
451
|
Parameters
|
|
444
452
|
----------
|
|
445
453
|
tenant_id : str
|
|
454
|
+
Unique identifier for the tenant/organization
|
|
446
455
|
|
|
447
456
|
source_ids : typing.Sequence[str]
|
|
457
|
+
List of source IDs to fetch
|
|
458
|
+
|
|
459
|
+
sub_tenant_id : typing.Optional[str]
|
|
460
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
448
461
|
|
|
449
462
|
request_options : typing.Optional[RequestOptions]
|
|
450
463
|
Request-specific configuration.
|
|
@@ -460,6 +473,7 @@ class AsyncRawSourcesClient:
|
|
|
460
473
|
json={
|
|
461
474
|
"tenant_id": tenant_id,
|
|
462
475
|
"source_ids": source_ids,
|
|
476
|
+
"sub_tenant_id": sub_tenant_id,
|
|
463
477
|
},
|
|
464
478
|
headers={
|
|
465
479
|
"content-type": "application/json",
|
usecortex_ai/tenant/client.py
CHANGED
|
@@ -47,7 +47,7 @@ class TenantClient:
|
|
|
47
47
|
Unique identifier for the tenant/organization
|
|
48
48
|
|
|
49
49
|
sub_tenant_id : typing.Optional[str]
|
|
50
|
-
Optional sub-tenant identifier
|
|
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.
|
|
51
51
|
|
|
52
52
|
request_options : typing.Optional[RequestOptions]
|
|
53
53
|
Request-specific configuration.
|
|
@@ -62,7 +62,7 @@ class TenantClient:
|
|
|
62
62
|
from usecortex-ai import CortexAI
|
|
63
63
|
|
|
64
64
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
65
|
-
client.tenant.stats(tenant_id='
|
|
65
|
+
client.tenant.stats(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
|
|
66
66
|
"""
|
|
67
67
|
_response = self._raw_client.stats(
|
|
68
68
|
tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
@@ -92,7 +92,7 @@ class TenantClient:
|
|
|
92
92
|
from usecortex-ai import CortexAI
|
|
93
93
|
|
|
94
94
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
95
|
-
client.tenant.get_sub_tenant_ids(tenant_id='
|
|
95
|
+
client.tenant.get_sub_tenant_ids(tenant_id='tenant_1234', )
|
|
96
96
|
"""
|
|
97
97
|
_response = self._raw_client.get_sub_tenant_ids(tenant_id=tenant_id, request_options=request_options)
|
|
98
98
|
return _response.data
|
|
@@ -125,7 +125,7 @@ class TenantClient:
|
|
|
125
125
|
from usecortex-ai import CortexAI
|
|
126
126
|
|
|
127
127
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
128
|
-
client.tenant.delete_sub_tenant(tenant_id='
|
|
128
|
+
client.tenant.delete_sub_tenant(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
|
|
129
129
|
"""
|
|
130
130
|
_response = self._raw_client.delete_sub_tenant(
|
|
131
131
|
tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
@@ -170,7 +170,7 @@ class AsyncTenantClient:
|
|
|
170
170
|
Unique identifier for the tenant/organization
|
|
171
171
|
|
|
172
172
|
sub_tenant_id : typing.Optional[str]
|
|
173
|
-
Optional sub-tenant identifier
|
|
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.
|
|
174
174
|
|
|
175
175
|
request_options : typing.Optional[RequestOptions]
|
|
176
176
|
Request-specific configuration.
|
|
@@ -188,7 +188,7 @@ class AsyncTenantClient:
|
|
|
188
188
|
|
|
189
189
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
190
190
|
async def main() -> None:
|
|
191
|
-
await client.tenant.stats(tenant_id='
|
|
191
|
+
await client.tenant.stats(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
|
|
192
192
|
asyncio.run(main())
|
|
193
193
|
"""
|
|
194
194
|
_response = await self._raw_client.stats(
|
|
@@ -222,7 +222,7 @@ class AsyncTenantClient:
|
|
|
222
222
|
|
|
223
223
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
224
224
|
async def main() -> None:
|
|
225
|
-
await client.tenant.get_sub_tenant_ids(tenant_id='
|
|
225
|
+
await client.tenant.get_sub_tenant_ids(tenant_id='tenant_1234', )
|
|
226
226
|
asyncio.run(main())
|
|
227
227
|
"""
|
|
228
228
|
_response = await self._raw_client.get_sub_tenant_ids(tenant_id=tenant_id, request_options=request_options)
|
|
@@ -259,7 +259,7 @@ class AsyncTenantClient:
|
|
|
259
259
|
|
|
260
260
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
261
261
|
async def main() -> None:
|
|
262
|
-
await client.tenant.delete_sub_tenant(tenant_id='
|
|
262
|
+
await client.tenant.delete_sub_tenant(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
|
|
263
263
|
asyncio.run(main())
|
|
264
264
|
"""
|
|
265
265
|
_response = await self._raw_client.delete_sub_tenant(
|
|
@@ -47,7 +47,7 @@ class RawTenantClient:
|
|
|
47
47
|
Unique identifier for the tenant/organization
|
|
48
48
|
|
|
49
49
|
sub_tenant_id : typing.Optional[str]
|
|
50
|
-
Optional sub-tenant identifier
|
|
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.
|
|
51
51
|
|
|
52
52
|
request_options : typing.Optional[RequestOptions]
|
|
53
53
|
Request-specific configuration.
|
|
@@ -427,7 +427,7 @@ class AsyncRawTenantClient:
|
|
|
427
427
|
Unique identifier for the tenant/organization
|
|
428
428
|
|
|
429
429
|
sub_tenant_id : typing.Optional[str]
|
|
430
|
-
Optional sub-tenant identifier
|
|
430
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
431
431
|
|
|
432
432
|
request_options : typing.Optional[RequestOptions]
|
|
433
433
|
Request-specific configuration.
|
|
@@ -19,7 +19,7 @@ class DeleteMemoryRequest(UniversalBaseModel):
|
|
|
19
19
|
|
|
20
20
|
sub_tenant_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
21
21
|
"""
|
|
22
|
-
Optional sub-tenant identifier
|
|
22
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
23
23
|
"""
|
|
24
24
|
|
|
25
25
|
if IS_PYDANTIC_V2:
|
|
@@ -12,6 +12,11 @@ class MarkdownUploadRequest(UniversalBaseModel):
|
|
|
12
12
|
The text or markdown content to upload
|
|
13
13
|
"""
|
|
14
14
|
|
|
15
|
+
file_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
16
|
+
"""
|
|
17
|
+
Optional file ID for the uploaded content. If not provided, will be generated automatically.
|
|
18
|
+
"""
|
|
19
|
+
|
|
15
20
|
tenant_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
|
|
16
21
|
"""
|
|
17
22
|
JSON string containing tenant-level document metadata (e.g., department, compliance_tag)
|
|
@@ -22,6 +22,11 @@ class SubTenantIdsData(UniversalBaseModel):
|
|
|
22
22
|
Total number of sub-tenants found
|
|
23
23
|
"""
|
|
24
24
|
|
|
25
|
+
tenant_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
|
|
26
|
+
"""
|
|
27
|
+
Schema configuration for the tenant collection
|
|
28
|
+
"""
|
|
29
|
+
|
|
25
30
|
success: typing.Optional[bool] = pydantic.Field(default=None)
|
|
26
31
|
"""
|
|
27
32
|
Indicates whether the sub-tenant retrieval was successful
|
|
@@ -12,9 +12,9 @@ class TenantStats(UniversalBaseModel):
|
|
|
12
12
|
Total number of objects stored for this tenant
|
|
13
13
|
"""
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
tenant_id: str = pydantic.Field()
|
|
16
16
|
"""
|
|
17
|
-
|
|
17
|
+
identifier for the tenant
|
|
18
18
|
"""
|
|
19
19
|
|
|
20
20
|
vector_dimension: typing.Optional[int] = pydantic.Field(default=None)
|