usecortex-ai 0.2.0__py3-none-any.whl → 0.2.2__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 +20 -3
- usecortex_ai/client.py +7 -78
- usecortex_ai/core/client_wrapper.py +6 -8
- 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 +50 -82
- usecortex_ai/embeddings/raw_client.py +48 -80
- usecortex_ai/fetch/client.py +10 -0
- usecortex_ai/fetch/raw_client.py +10 -0
- usecortex_ai/search/client.py +74 -80
- usecortex_ai/search/raw_client.py +74 -80
- usecortex_ai/sources/client.py +28 -0
- usecortex_ai/sources/raw_client.py +28 -0
- usecortex_ai/tenant/client.py +152 -4
- usecortex_ai/tenant/raw_client.py +502 -4
- usecortex_ai/types/__init__.py +18 -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 +18 -3
- usecortex_ai/types/processing_status.py +14 -3
- usecortex_ai/types/relations.py +2 -2
- usecortex_ai/types/retrieve_user_memory_response.py +32 -0
- usecortex_ai/types/search_chunk.py +54 -16
- usecortex_ai/types/single_upload_data.py +10 -2
- usecortex_ai/types/source.py +34 -14
- usecortex_ai/types/source_model.py +63 -12
- usecortex_ai/types/sub_tenant_ids_data.py +42 -0
- 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 +508 -132
- usecortex_ai/upload/raw_client.py +492 -152
- usecortex_ai/user/client.py +14 -6
- usecortex_ai/user/raw_client.py +14 -6
- usecortex_ai/user_memory/client.py +184 -50
- usecortex_ai/user_memory/raw_client.py +905 -88
- {usecortex_ai-0.2.0.dist-info → usecortex_ai-0.2.2.dist-info}/METADATA +1 -1
- usecortex_ai-0.2.2.dist-info/RECORD +100 -0
- usecortex_ai/raw_client.py +0 -90
- usecortex_ai/types/source_content.py +0 -26
- usecortex_ai-0.2.0.dist-info/RECORD +0 -90
- {usecortex_ai-0.2.0.dist-info → usecortex_ai-0.2.2.dist-info}/WHEEL +0 -0
- {usecortex_ai-0.2.0.dist-info → usecortex_ai-0.2.2.dist-info}/licenses/LICENSE +0 -0
- {usecortex_ai-0.2.0.dist-info → usecortex_ai-0.2.2.dist-info}/top_level.txt +0 -0
|
@@ -52,41 +52,60 @@ class RawSearchClient:
|
|
|
52
52
|
request_options: typing.Optional[RequestOptions] = None,
|
|
53
53
|
) -> HttpResponse[typing.Optional[typing.Any]]:
|
|
54
54
|
"""
|
|
55
|
+
Ask a question to your uploaded knowledge base and let Cortex AI answer it.
|
|
56
|
+
|
|
55
57
|
Parameters
|
|
56
58
|
----------
|
|
57
59
|
question : str
|
|
60
|
+
The question to be answered
|
|
58
61
|
|
|
59
62
|
session_id : str
|
|
63
|
+
Unique identifier for the conversation session. Keep it same when the current question refers to a previous answer or question
|
|
60
64
|
|
|
61
65
|
tenant_id : str
|
|
66
|
+
Identifier for the tenant/organization
|
|
62
67
|
|
|
63
68
|
context_list : typing.Optional[typing.Sequence[str]]
|
|
69
|
+
List of context strings to provide additional information
|
|
64
70
|
|
|
65
71
|
search_modes : typing.Optional[typing.Sequence[str]]
|
|
72
|
+
List of search modes to use for finding relevant information
|
|
66
73
|
|
|
67
74
|
sub_tenant_id : typing.Optional[str]
|
|
75
|
+
Identifier for sub-tenant within the tenant
|
|
68
76
|
|
|
69
77
|
highlight_chunks : typing.Optional[bool]
|
|
78
|
+
Whether to return text chunks in the response along with final LLM generated answer
|
|
70
79
|
|
|
71
80
|
stream : typing.Optional[bool]
|
|
81
|
+
Whether to stream the response
|
|
72
82
|
|
|
73
83
|
search_alpha : typing.Optional[float]
|
|
84
|
+
Closer to 0.0 means a exact keyword search will be performed, closer to 1.0 means semantics of the search will be considered. In most cases, you wont have to toggle it yourself.
|
|
74
85
|
|
|
75
86
|
recency_bias : typing.Optional[float]
|
|
87
|
+
Bias towards more recent information (0.0 to 1.0)
|
|
76
88
|
|
|
77
89
|
ai_generation : typing.Optional[bool]
|
|
90
|
+
Whether to use AI for generating responses
|
|
78
91
|
|
|
79
92
|
top_n : typing.Optional[int]
|
|
93
|
+
Number of top results to return
|
|
80
94
|
|
|
81
95
|
user_name : typing.Optional[str]
|
|
96
|
+
Name of the user making the request. This helps LLM to know the user's name if semantics around the username are involved in query. Its generally a good practice to include it possible.
|
|
82
97
|
|
|
83
98
|
user_instructions : typing.Optional[str]
|
|
99
|
+
Custom instructions for the AI response to add to our proprietary prompt. This can be used to provide additional context or instructions for the LLM to follow so that the answers are tailored towards your application style
|
|
84
100
|
|
|
85
101
|
multi_step_reasoning : typing.Optional[bool]
|
|
102
|
+
Enable advanced multi-step reasoning for complex queries. When enabled, the AI will automatically break down complex questions into multiple research steps to provide more comprehensive and accurate answers.
|
|
86
103
|
|
|
87
104
|
auto_agent_routing : typing.Optional[bool]
|
|
105
|
+
Enable intelligent agent routing to automatically select the most suitable AI agent for your specific query type. Different agents are optimized for various use cases like social media, code, conversations, general knowledge, etc.
|
|
88
106
|
|
|
89
107
|
metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
108
|
+
Additional metadata for the request
|
|
90
109
|
|
|
91
110
|
request_options : typing.Optional[RequestOptions]
|
|
92
111
|
Request-specific configuration.
|
|
@@ -227,45 +246,33 @@ class RawSearchClient:
|
|
|
227
246
|
max_chunks: typing.Optional[int] = OMIT,
|
|
228
247
|
alpha: typing.Optional[Alpha] = OMIT,
|
|
229
248
|
recency_bias: typing.Optional[float] = OMIT,
|
|
230
|
-
num_related_chunks: typing.Optional[int] = OMIT,
|
|
231
249
|
request_options: typing.Optional[RequestOptions] = None,
|
|
232
250
|
) -> HttpResponse[typing.List[SearchChunk]]:
|
|
233
251
|
"""
|
|
234
|
-
Search for content within indexed sources
|
|
235
|
-
|
|
236
|
-
This
|
|
237
|
-
|
|
238
|
-
with various parameters to control the number of results and search behavior.
|
|
239
|
-
|
|
240
|
-
Args:
|
|
241
|
-
request (SearchRequest): The search request containing:
|
|
242
|
-
- query (str): Search query string to find relevant content
|
|
243
|
-
- tenant_id (str, optional): Tenant identifier for multi-tenancy
|
|
244
|
-
- sub_tenant_id (str, optional): Sub-tenant identifier, defaults to tenant_id
|
|
245
|
-
- max_chunks (int, optional): Maximum number of content chunks to return
|
|
246
|
-
- alpha (Union[float, str], optional): Search algorithm parameter for result ranking (default: 0.8). Can be float-type (0.0-1.0) or 'auto' for dynamic selection
|
|
247
|
-
- recency_bias (float, optional): Bias towards more recent content (default: 0.5)
|
|
248
|
-
- num_related_chunks (int, optional): Number of related chunks to return (default: 0)
|
|
249
|
-
api_details (dict): Authentication details obtained from API key validation
|
|
250
|
-
|
|
251
|
-
Returns:
|
|
252
|
-
SearchData: Success response with search results
|
|
252
|
+
Search for relevant content within your indexed sources.
|
|
253
|
+
|
|
254
|
+
This API returns the chunks related to the query you make. We use neural (embedding) search to give you the most relevant chunks.
|
|
255
|
+
Results are ranked by relevance and can be customized with parameters like result limits and recency preferences.
|
|
253
256
|
|
|
254
257
|
Parameters
|
|
255
258
|
----------
|
|
256
259
|
query : str
|
|
260
|
+
Search terms to find relevant content
|
|
257
261
|
|
|
258
262
|
tenant_id : str
|
|
263
|
+
Unique identifier for the tenant/organization
|
|
259
264
|
|
|
260
265
|
sub_tenant_id : typing.Optional[str]
|
|
266
|
+
Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id
|
|
261
267
|
|
|
262
268
|
max_chunks : typing.Optional[int]
|
|
269
|
+
Maximum number of results to return
|
|
263
270
|
|
|
264
271
|
alpha : typing.Optional[Alpha]
|
|
272
|
+
Search ranking algorithm parameter (0.0-1.0 or 'auto')
|
|
265
273
|
|
|
266
274
|
recency_bias : typing.Optional[float]
|
|
267
|
-
|
|
268
|
-
num_related_chunks : typing.Optional[int]
|
|
275
|
+
Preference for newer content (0.0 = no bias, 1.0 = strong recency preference)
|
|
269
276
|
|
|
270
277
|
request_options : typing.Optional[RequestOptions]
|
|
271
278
|
Request-specific configuration.
|
|
@@ -285,7 +292,6 @@ class RawSearchClient:
|
|
|
285
292
|
"max_chunks": max_chunks,
|
|
286
293
|
"alpha": convert_and_respect_annotation_metadata(object_=alpha, annotation=Alpha, direction="write"),
|
|
287
294
|
"recency_bias": recency_bias,
|
|
288
|
-
"num_related_chunks": num_related_chunks,
|
|
289
295
|
},
|
|
290
296
|
headers={
|
|
291
297
|
"content-type": "application/json",
|
|
@@ -396,36 +402,27 @@ class RawSearchClient:
|
|
|
396
402
|
request_options: typing.Optional[RequestOptions] = None,
|
|
397
403
|
) -> HttpResponse[typing.List[SearchChunk]]:
|
|
398
404
|
"""
|
|
399
|
-
|
|
400
|
-
Performs full text search with configurable operators for precise text matching against the Findr backend.
|
|
401
|
-
|
|
402
|
-
This endpoint performs a full text search query against the Findr backend, allowing users to retrieve
|
|
403
|
-
relevant content chunks from their indexed documents and sources using BM25-based text matching.
|
|
404
|
-
The search can be customized with various operators to control the matching behavior.
|
|
405
|
-
|
|
406
|
-
Args:
|
|
407
|
-
request (FullTextSearchRequest): The full text search request containing:
|
|
408
|
-
- query (str): Search query string to find relevant content
|
|
409
|
-
- tenant_id (str): Tenant identifier for multi-tenancy
|
|
410
|
-
- sub_tenant_id (str, optional): Sub-tenant identifier, defaults to tenant_id
|
|
411
|
-
- operator (BM25OperatorType, optional): Full text search operator type (OR or AND). Defaults to OR
|
|
412
|
-
- max_chunks (int, optional): Maximum number of content chunks to return (1-1001, defaults to 25)
|
|
413
|
-
api_details (dict): Authentication details obtained from API key validation
|
|
405
|
+
Perform full text search for exact matches within your indexed sources.
|
|
414
406
|
|
|
415
|
-
|
|
416
|
-
|
|
407
|
+
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.
|
|
417
409
|
|
|
418
410
|
Parameters
|
|
419
411
|
----------
|
|
420
412
|
query : str
|
|
413
|
+
Search terms to find in your content
|
|
421
414
|
|
|
422
415
|
tenant_id : str
|
|
416
|
+
Unique identifier for the tenant/organization
|
|
423
417
|
|
|
424
418
|
sub_tenant_id : typing.Optional[str]
|
|
419
|
+
Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id
|
|
425
420
|
|
|
426
421
|
operator : typing.Optional[Bm25OperatorType]
|
|
422
|
+
How to combine search terms (OR or AND)
|
|
427
423
|
|
|
428
424
|
max_chunks : typing.Optional[int]
|
|
425
|
+
Maximum number of results to return
|
|
429
426
|
|
|
430
427
|
request_options : typing.Optional[RequestOptions]
|
|
431
428
|
Request-specific configuration.
|
|
@@ -571,41 +568,60 @@ class AsyncRawSearchClient:
|
|
|
571
568
|
request_options: typing.Optional[RequestOptions] = None,
|
|
572
569
|
) -> AsyncHttpResponse[typing.Optional[typing.Any]]:
|
|
573
570
|
"""
|
|
571
|
+
Ask a question to your uploaded knowledge base and let Cortex AI answer it.
|
|
572
|
+
|
|
574
573
|
Parameters
|
|
575
574
|
----------
|
|
576
575
|
question : str
|
|
576
|
+
The question to be answered
|
|
577
577
|
|
|
578
578
|
session_id : str
|
|
579
|
+
Unique identifier for the conversation session. Keep it same when the current question refers to a previous answer or question
|
|
579
580
|
|
|
580
581
|
tenant_id : str
|
|
582
|
+
Identifier for the tenant/organization
|
|
581
583
|
|
|
582
584
|
context_list : typing.Optional[typing.Sequence[str]]
|
|
585
|
+
List of context strings to provide additional information
|
|
583
586
|
|
|
584
587
|
search_modes : typing.Optional[typing.Sequence[str]]
|
|
588
|
+
List of search modes to use for finding relevant information
|
|
585
589
|
|
|
586
590
|
sub_tenant_id : typing.Optional[str]
|
|
591
|
+
Identifier for sub-tenant within the tenant
|
|
587
592
|
|
|
588
593
|
highlight_chunks : typing.Optional[bool]
|
|
594
|
+
Whether to return text chunks in the response along with final LLM generated answer
|
|
589
595
|
|
|
590
596
|
stream : typing.Optional[bool]
|
|
597
|
+
Whether to stream the response
|
|
591
598
|
|
|
592
599
|
search_alpha : typing.Optional[float]
|
|
600
|
+
Closer to 0.0 means a exact keyword search will be performed, closer to 1.0 means semantics of the search will be considered. In most cases, you wont have to toggle it yourself.
|
|
593
601
|
|
|
594
602
|
recency_bias : typing.Optional[float]
|
|
603
|
+
Bias towards more recent information (0.0 to 1.0)
|
|
595
604
|
|
|
596
605
|
ai_generation : typing.Optional[bool]
|
|
606
|
+
Whether to use AI for generating responses
|
|
597
607
|
|
|
598
608
|
top_n : typing.Optional[int]
|
|
609
|
+
Number of top results to return
|
|
599
610
|
|
|
600
611
|
user_name : typing.Optional[str]
|
|
612
|
+
Name of the user making the request. This helps LLM to know the user's name if semantics around the username are involved in query. Its generally a good practice to include it possible.
|
|
601
613
|
|
|
602
614
|
user_instructions : typing.Optional[str]
|
|
615
|
+
Custom instructions for the AI response to add to our proprietary prompt. This can be used to provide additional context or instructions for the LLM to follow so that the answers are tailored towards your application style
|
|
603
616
|
|
|
604
617
|
multi_step_reasoning : typing.Optional[bool]
|
|
618
|
+
Enable advanced multi-step reasoning for complex queries. When enabled, the AI will automatically break down complex questions into multiple research steps to provide more comprehensive and accurate answers.
|
|
605
619
|
|
|
606
620
|
auto_agent_routing : typing.Optional[bool]
|
|
621
|
+
Enable intelligent agent routing to automatically select the most suitable AI agent for your specific query type. Different agents are optimized for various use cases like social media, code, conversations, general knowledge, etc.
|
|
607
622
|
|
|
608
623
|
metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
624
|
+
Additional metadata for the request
|
|
609
625
|
|
|
610
626
|
request_options : typing.Optional[RequestOptions]
|
|
611
627
|
Request-specific configuration.
|
|
@@ -746,45 +762,33 @@ class AsyncRawSearchClient:
|
|
|
746
762
|
max_chunks: typing.Optional[int] = OMIT,
|
|
747
763
|
alpha: typing.Optional[Alpha] = OMIT,
|
|
748
764
|
recency_bias: typing.Optional[float] = OMIT,
|
|
749
|
-
num_related_chunks: typing.Optional[int] = OMIT,
|
|
750
765
|
request_options: typing.Optional[RequestOptions] = None,
|
|
751
766
|
) -> AsyncHttpResponse[typing.List[SearchChunk]]:
|
|
752
767
|
"""
|
|
753
|
-
Search for content within indexed sources
|
|
754
|
-
|
|
755
|
-
This
|
|
756
|
-
|
|
757
|
-
with various parameters to control the number of results and search behavior.
|
|
758
|
-
|
|
759
|
-
Args:
|
|
760
|
-
request (SearchRequest): The search request containing:
|
|
761
|
-
- query (str): Search query string to find relevant content
|
|
762
|
-
- tenant_id (str, optional): Tenant identifier for multi-tenancy
|
|
763
|
-
- sub_tenant_id (str, optional): Sub-tenant identifier, defaults to tenant_id
|
|
764
|
-
- max_chunks (int, optional): Maximum number of content chunks to return
|
|
765
|
-
- alpha (Union[float, str], optional): Search algorithm parameter for result ranking (default: 0.8). Can be float-type (0.0-1.0) or 'auto' for dynamic selection
|
|
766
|
-
- recency_bias (float, optional): Bias towards more recent content (default: 0.5)
|
|
767
|
-
- num_related_chunks (int, optional): Number of related chunks to return (default: 0)
|
|
768
|
-
api_details (dict): Authentication details obtained from API key validation
|
|
769
|
-
|
|
770
|
-
Returns:
|
|
771
|
-
SearchData: Success response with search results
|
|
768
|
+
Search for relevant content within your indexed sources.
|
|
769
|
+
|
|
770
|
+
This API returns the chunks related to the query you make. We use neural (embedding) search to give you the most relevant chunks.
|
|
771
|
+
Results are ranked by relevance and can be customized with parameters like result limits and recency preferences.
|
|
772
772
|
|
|
773
773
|
Parameters
|
|
774
774
|
----------
|
|
775
775
|
query : str
|
|
776
|
+
Search terms to find relevant content
|
|
776
777
|
|
|
777
778
|
tenant_id : str
|
|
779
|
+
Unique identifier for the tenant/organization
|
|
778
780
|
|
|
779
781
|
sub_tenant_id : typing.Optional[str]
|
|
782
|
+
Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id
|
|
780
783
|
|
|
781
784
|
max_chunks : typing.Optional[int]
|
|
785
|
+
Maximum number of results to return
|
|
782
786
|
|
|
783
787
|
alpha : typing.Optional[Alpha]
|
|
788
|
+
Search ranking algorithm parameter (0.0-1.0 or 'auto')
|
|
784
789
|
|
|
785
790
|
recency_bias : typing.Optional[float]
|
|
786
|
-
|
|
787
|
-
num_related_chunks : typing.Optional[int]
|
|
791
|
+
Preference for newer content (0.0 = no bias, 1.0 = strong recency preference)
|
|
788
792
|
|
|
789
793
|
request_options : typing.Optional[RequestOptions]
|
|
790
794
|
Request-specific configuration.
|
|
@@ -804,7 +808,6 @@ class AsyncRawSearchClient:
|
|
|
804
808
|
"max_chunks": max_chunks,
|
|
805
809
|
"alpha": convert_and_respect_annotation_metadata(object_=alpha, annotation=Alpha, direction="write"),
|
|
806
810
|
"recency_bias": recency_bias,
|
|
807
|
-
"num_related_chunks": num_related_chunks,
|
|
808
811
|
},
|
|
809
812
|
headers={
|
|
810
813
|
"content-type": "application/json",
|
|
@@ -915,36 +918,27 @@ class AsyncRawSearchClient:
|
|
|
915
918
|
request_options: typing.Optional[RequestOptions] = None,
|
|
916
919
|
) -> AsyncHttpResponse[typing.List[SearchChunk]]:
|
|
917
920
|
"""
|
|
918
|
-
|
|
919
|
-
Performs full text search with configurable operators for precise text matching against the Findr backend.
|
|
920
|
-
|
|
921
|
-
This endpoint performs a full text search query against the Findr backend, allowing users to retrieve
|
|
922
|
-
relevant content chunks from their indexed documents and sources using BM25-based text matching.
|
|
923
|
-
The search can be customized with various operators to control the matching behavior.
|
|
924
|
-
|
|
925
|
-
Args:
|
|
926
|
-
request (FullTextSearchRequest): The full text search request containing:
|
|
927
|
-
- query (str): Search query string to find relevant content
|
|
928
|
-
- tenant_id (str): Tenant identifier for multi-tenancy
|
|
929
|
-
- sub_tenant_id (str, optional): Sub-tenant identifier, defaults to tenant_id
|
|
930
|
-
- operator (BM25OperatorType, optional): Full text search operator type (OR or AND). Defaults to OR
|
|
931
|
-
- max_chunks (int, optional): Maximum number of content chunks to return (1-1001, defaults to 25)
|
|
932
|
-
api_details (dict): Authentication details obtained from API key validation
|
|
921
|
+
Perform full text search for exact matches within your indexed sources.
|
|
933
922
|
|
|
934
|
-
|
|
935
|
-
|
|
923
|
+
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.
|
|
936
925
|
|
|
937
926
|
Parameters
|
|
938
927
|
----------
|
|
939
928
|
query : str
|
|
929
|
+
Search terms to find in your content
|
|
940
930
|
|
|
941
931
|
tenant_id : str
|
|
932
|
+
Unique identifier for the tenant/organization
|
|
942
933
|
|
|
943
934
|
sub_tenant_id : typing.Optional[str]
|
|
935
|
+
Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id
|
|
944
936
|
|
|
945
937
|
operator : typing.Optional[Bm25OperatorType]
|
|
938
|
+
How to combine search terms (OR or AND)
|
|
946
939
|
|
|
947
940
|
max_chunks : typing.Optional[int]
|
|
941
|
+
Maximum number of results to return
|
|
948
942
|
|
|
949
943
|
request_options : typing.Optional[RequestOptions]
|
|
950
944
|
Request-specific configuration.
|
usecortex_ai/sources/client.py
CHANGED
|
@@ -34,11 +34,19 @@ class SourcesClient:
|
|
|
34
34
|
request_options: typing.Optional[RequestOptions] = None,
|
|
35
35
|
) -> ListSourcesResponse:
|
|
36
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
|
+
|
|
37
43
|
Parameters
|
|
38
44
|
----------
|
|
39
45
|
tenant_id : str
|
|
46
|
+
Unique identifier for the tenant/organization
|
|
40
47
|
|
|
41
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
|
|
42
50
|
|
|
43
51
|
request_options : typing.Optional[RequestOptions]
|
|
44
52
|
Request-specific configuration.
|
|
@@ -68,6 +76,12 @@ class SourcesClient:
|
|
|
68
76
|
request_options: typing.Optional[RequestOptions] = None,
|
|
69
77
|
) -> ListSourcesResponse:
|
|
70
78
|
"""
|
|
79
|
+
Retrieve specific sources by their IDs.
|
|
80
|
+
|
|
81
|
+
Use this endpoint to fetch one or more sources by providing their unique identifiers. This is useful when you need detailed information about specific documents or content you've previously uploaded.
|
|
82
|
+
|
|
83
|
+
Provide the source IDs in the request body along with your tenant information to get the exact sources you need.
|
|
84
|
+
|
|
71
85
|
Parameters
|
|
72
86
|
----------
|
|
73
87
|
tenant_id : str
|
|
@@ -118,11 +132,19 @@ class AsyncSourcesClient:
|
|
|
118
132
|
request_options: typing.Optional[RequestOptions] = None,
|
|
119
133
|
) -> ListSourcesResponse:
|
|
120
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
|
+
|
|
121
141
|
Parameters
|
|
122
142
|
----------
|
|
123
143
|
tenant_id : str
|
|
144
|
+
Unique identifier for the tenant/organization
|
|
124
145
|
|
|
125
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
|
|
126
148
|
|
|
127
149
|
request_options : typing.Optional[RequestOptions]
|
|
128
150
|
Request-specific configuration.
|
|
@@ -156,6 +178,12 @@ class AsyncSourcesClient:
|
|
|
156
178
|
request_options: typing.Optional[RequestOptions] = None,
|
|
157
179
|
) -> ListSourcesResponse:
|
|
158
180
|
"""
|
|
181
|
+
Retrieve specific sources by their IDs.
|
|
182
|
+
|
|
183
|
+
Use this endpoint to fetch one or more sources by providing their unique identifiers. This is useful when you need detailed information about specific documents or content you've previously uploaded.
|
|
184
|
+
|
|
185
|
+
Provide the source IDs in the request body along with your tenant information to get the exact sources you need.
|
|
186
|
+
|
|
159
187
|
Parameters
|
|
160
188
|
----------
|
|
161
189
|
tenant_id : str
|
|
@@ -34,11 +34,19 @@ class RawSourcesClient:
|
|
|
34
34
|
request_options: typing.Optional[RequestOptions] = None,
|
|
35
35
|
) -> HttpResponse[ListSourcesResponse]:
|
|
36
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
|
+
|
|
37
43
|
Parameters
|
|
38
44
|
----------
|
|
39
45
|
tenant_id : str
|
|
46
|
+
Unique identifier for the tenant/organization
|
|
40
47
|
|
|
41
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
|
|
42
50
|
|
|
43
51
|
request_options : typing.Optional[RequestOptions]
|
|
44
52
|
Request-specific configuration.
|
|
@@ -157,6 +165,12 @@ class RawSourcesClient:
|
|
|
157
165
|
request_options: typing.Optional[RequestOptions] = None,
|
|
158
166
|
) -> HttpResponse[ListSourcesResponse]:
|
|
159
167
|
"""
|
|
168
|
+
Retrieve specific sources by their IDs.
|
|
169
|
+
|
|
170
|
+
Use this endpoint to fetch one or more sources by providing their unique identifiers. This is useful when you need detailed information about specific documents or content you've previously uploaded.
|
|
171
|
+
|
|
172
|
+
Provide the source IDs in the request body along with your tenant information to get the exact sources you need.
|
|
173
|
+
|
|
160
174
|
Parameters
|
|
161
175
|
----------
|
|
162
176
|
tenant_id : str
|
|
@@ -289,11 +303,19 @@ class AsyncRawSourcesClient:
|
|
|
289
303
|
request_options: typing.Optional[RequestOptions] = None,
|
|
290
304
|
) -> AsyncHttpResponse[ListSourcesResponse]:
|
|
291
305
|
"""
|
|
306
|
+
Retrieve all sources for a specific tenant.
|
|
307
|
+
|
|
308
|
+
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.
|
|
309
|
+
|
|
310
|
+
You can optionally specify a sub-tenant to narrow down the results to sources within that specific sub-tenant scope.
|
|
311
|
+
|
|
292
312
|
Parameters
|
|
293
313
|
----------
|
|
294
314
|
tenant_id : str
|
|
315
|
+
Unique identifier for the tenant/organization
|
|
295
316
|
|
|
296
317
|
sub_tenant_id : typing.Optional[str]
|
|
318
|
+
Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id
|
|
297
319
|
|
|
298
320
|
request_options : typing.Optional[RequestOptions]
|
|
299
321
|
Request-specific configuration.
|
|
@@ -412,6 +434,12 @@ class AsyncRawSourcesClient:
|
|
|
412
434
|
request_options: typing.Optional[RequestOptions] = None,
|
|
413
435
|
) -> AsyncHttpResponse[ListSourcesResponse]:
|
|
414
436
|
"""
|
|
437
|
+
Retrieve specific sources by their IDs.
|
|
438
|
+
|
|
439
|
+
Use this endpoint to fetch one or more sources by providing their unique identifiers. This is useful when you need detailed information about specific documents or content you've previously uploaded.
|
|
440
|
+
|
|
441
|
+
Provide the source IDs in the request body along with your tenant information to get the exact sources you need.
|
|
442
|
+
|
|
415
443
|
Parameters
|
|
416
444
|
----------
|
|
417
445
|
tenant_id : str
|
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 for organizing data within a tenant. If not provided, defaults to tenant_id
|
|
43
51
|
|
|
44
52
|
request_options : typing.Optional[RequestOptions]
|
|
45
53
|
Request-specific configuration.
|
|
@@ -61,6 +69,69 @@ class TenantClient:
|
|
|
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_id', )
|
|
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_id', sub_tenant_id='sub_tenant_id', )
|
|
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 for organizing data within a tenant. If not provided, defaults to tenant_id
|
|
97
174
|
|
|
98
175
|
request_options : typing.Optional[RequestOptions]
|
|
99
176
|
Request-specific configuration.
|
|
@@ -118,3 +195,74 @@ class AsyncTenantClient:
|
|
|
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_id', )
|
|
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_id', sub_tenant_id='sub_tenant_id', )
|
|
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
|