usecortex-ai 0.2.2__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/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 +18 -94
- usecortex_ai/sources/raw_client.py +14 -262
- 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.2.2.dist-info → usecortex_ai-0.3.0.dist-info}/METADATA +1 -1
- {usecortex_ai-0.2.2.dist-info → usecortex_ai-0.3.0.dist-info}/RECORD +30 -29
- {usecortex_ai-0.2.2.dist-info → usecortex_ai-0.3.0.dist-info}/WHEEL +0 -0
- {usecortex_ai-0.2.2.dist-info → usecortex_ai-0.3.0.dist-info}/licenses/LICENSE +0 -0
- {usecortex_ai-0.2.2.dist-info → usecortex_ai-0.3.0.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
|
@@ -27,52 +27,11 @@ class SourcesClient:
|
|
|
27
27
|
return self._raw_client
|
|
28
28
|
|
|
29
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
|
-
Retrieve all sources for a specific tenant.
|
|
38
|
-
|
|
39
|
-
Use this endpoint to fetch a complete list of all sources associated with your tenant. This includes documents, files, and other content you've uploaded for processing.
|
|
40
|
-
|
|
41
|
-
You can optionally specify a sub-tenant to narrow down the results to sources within that specific sub-tenant scope.
|
|
42
|
-
|
|
43
|
-
Parameters
|
|
44
|
-
----------
|
|
45
|
-
tenant_id : str
|
|
46
|
-
Unique identifier for the tenant/organization
|
|
47
|
-
|
|
48
|
-
sub_tenant_id : typing.Optional[str]
|
|
49
|
-
Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id
|
|
50
|
-
|
|
51
|
-
request_options : typing.Optional[RequestOptions]
|
|
52
|
-
Request-specific configuration.
|
|
53
|
-
|
|
54
|
-
Returns
|
|
55
|
-
-------
|
|
56
|
-
ListSourcesResponse
|
|
57
|
-
Successful Response
|
|
58
|
-
|
|
59
|
-
Examples
|
|
60
|
-
--------
|
|
61
|
-
from usecortex-ai import CortexAI
|
|
62
|
-
|
|
63
|
-
client = CortexAI(token="YOUR_TOKEN", )
|
|
64
|
-
client.sources.get_all(tenant_id='tenant_id', )
|
|
65
|
-
"""
|
|
66
|
-
_response = self._raw_client.get_all(
|
|
67
|
-
tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
68
|
-
)
|
|
69
|
-
return _response.data
|
|
70
|
-
|
|
71
|
-
def get_by_ids(
|
|
72
30
|
self,
|
|
73
31
|
*,
|
|
74
32
|
tenant_id: str,
|
|
75
33
|
source_ids: typing.Sequence[str],
|
|
34
|
+
sub_tenant_id: typing.Optional[str] = OMIT,
|
|
76
35
|
request_options: typing.Optional[RequestOptions] = None,
|
|
77
36
|
) -> ListSourcesResponse:
|
|
78
37
|
"""
|
|
@@ -85,8 +44,13 @@ class SourcesClient:
|
|
|
85
44
|
Parameters
|
|
86
45
|
----------
|
|
87
46
|
tenant_id : str
|
|
47
|
+
Unique identifier for the tenant/organization
|
|
88
48
|
|
|
89
49
|
source_ids : typing.Sequence[str]
|
|
50
|
+
List of source IDs to fetch
|
|
51
|
+
|
|
52
|
+
sub_tenant_id : typing.Optional[str]
|
|
53
|
+
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
54
|
|
|
91
55
|
request_options : typing.Optional[RequestOptions]
|
|
92
56
|
Request-specific configuration.
|
|
@@ -101,10 +65,10 @@ class SourcesClient:
|
|
|
101
65
|
from usecortex-ai import CortexAI
|
|
102
66
|
|
|
103
67
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
104
|
-
client.sources.
|
|
68
|
+
client.sources.get_all(tenant_id='tenant_1234', source_ids=['CortexDoc1234', 'CortexDoc4567'], )
|
|
105
69
|
"""
|
|
106
|
-
_response = self._raw_client.
|
|
107
|
-
tenant_id=tenant_id, source_ids=source_ids, request_options=request_options
|
|
70
|
+
_response = self._raw_client.get_all(
|
|
71
|
+
tenant_id=tenant_id, source_ids=source_ids, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
108
72
|
)
|
|
109
73
|
return _response.data
|
|
110
74
|
|
|
@@ -125,56 +89,11 @@ class AsyncSourcesClient:
|
|
|
125
89
|
return self._raw_client
|
|
126
90
|
|
|
127
91
|
async def get_all(
|
|
128
|
-
self,
|
|
129
|
-
*,
|
|
130
|
-
tenant_id: str,
|
|
131
|
-
sub_tenant_id: typing.Optional[str] = None,
|
|
132
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
133
|
-
) -> ListSourcesResponse:
|
|
134
|
-
"""
|
|
135
|
-
Retrieve all sources for a specific tenant.
|
|
136
|
-
|
|
137
|
-
Use this endpoint to fetch a complete list of all sources associated with your tenant. This includes documents, files, and other content you've uploaded for processing.
|
|
138
|
-
|
|
139
|
-
You can optionally specify a sub-tenant to narrow down the results to sources within that specific sub-tenant scope.
|
|
140
|
-
|
|
141
|
-
Parameters
|
|
142
|
-
----------
|
|
143
|
-
tenant_id : str
|
|
144
|
-
Unique identifier for the tenant/organization
|
|
145
|
-
|
|
146
|
-
sub_tenant_id : typing.Optional[str]
|
|
147
|
-
Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id
|
|
148
|
-
|
|
149
|
-
request_options : typing.Optional[RequestOptions]
|
|
150
|
-
Request-specific configuration.
|
|
151
|
-
|
|
152
|
-
Returns
|
|
153
|
-
-------
|
|
154
|
-
ListSourcesResponse
|
|
155
|
-
Successful Response
|
|
156
|
-
|
|
157
|
-
Examples
|
|
158
|
-
--------
|
|
159
|
-
import asyncio
|
|
160
|
-
|
|
161
|
-
from usecortex-ai import AsyncCortexAI
|
|
162
|
-
|
|
163
|
-
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
164
|
-
async def main() -> None:
|
|
165
|
-
await client.sources.get_all(tenant_id='tenant_id', )
|
|
166
|
-
asyncio.run(main())
|
|
167
|
-
"""
|
|
168
|
-
_response = await self._raw_client.get_all(
|
|
169
|
-
tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
170
|
-
)
|
|
171
|
-
return _response.data
|
|
172
|
-
|
|
173
|
-
async def get_by_ids(
|
|
174
92
|
self,
|
|
175
93
|
*,
|
|
176
94
|
tenant_id: str,
|
|
177
95
|
source_ids: typing.Sequence[str],
|
|
96
|
+
sub_tenant_id: typing.Optional[str] = OMIT,
|
|
178
97
|
request_options: typing.Optional[RequestOptions] = None,
|
|
179
98
|
) -> ListSourcesResponse:
|
|
180
99
|
"""
|
|
@@ -187,8 +106,13 @@ class AsyncSourcesClient:
|
|
|
187
106
|
Parameters
|
|
188
107
|
----------
|
|
189
108
|
tenant_id : str
|
|
109
|
+
Unique identifier for the tenant/organization
|
|
190
110
|
|
|
191
111
|
source_ids : typing.Sequence[str]
|
|
112
|
+
List of source IDs to fetch
|
|
113
|
+
|
|
114
|
+
sub_tenant_id : typing.Optional[str]
|
|
115
|
+
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
116
|
|
|
193
117
|
request_options : typing.Optional[RequestOptions]
|
|
194
118
|
Request-specific configuration.
|
|
@@ -206,10 +130,10 @@ class AsyncSourcesClient:
|
|
|
206
130
|
|
|
207
131
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
208
132
|
async def main() -> None:
|
|
209
|
-
await client.sources.
|
|
133
|
+
await client.sources.get_all(tenant_id='tenant_1234', source_ids=['CortexDoc1234', 'CortexDoc4567'], )
|
|
210
134
|
asyncio.run(main())
|
|
211
135
|
"""
|
|
212
|
-
_response = await self._raw_client.
|
|
213
|
-
tenant_id=tenant_id, source_ids=source_ids, request_options=request_options
|
|
136
|
+
_response = await self._raw_client.get_all(
|
|
137
|
+
tenant_id=tenant_id, source_ids=source_ids, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
214
138
|
)
|
|
215
139
|
return _response.data
|