usecortex-ai 0.3.0__tar.gz → 0.3.1__tar.gz
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-0.3.1/PKG-INFO +66 -0
- usecortex_ai-0.3.1/README.md +21 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/pyproject.toml +1 -1
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/sources/client.py +92 -4
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/sources/raw_client.py +262 -0
- usecortex_ai-0.3.1/src/usecortex_ai.egg-info/PKG-INFO +66 -0
- usecortex_ai-0.3.0/PKG-INFO +0 -136
- usecortex_ai-0.3.0/README.md +0 -91
- usecortex_ai-0.3.0/src/usecortex_ai.egg-info/PKG-INFO +0 -136
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/LICENSE +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/setup.cfg +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/__init__.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/client.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/core/__init__.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/core/api_error.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/core/client_wrapper.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/core/datetime_utils.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/core/file.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/core/force_multipart.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/core/http_client.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/core/http_response.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/core/jsonable_encoder.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/core/pydantic_utilities.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/core/query_encoder.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/core/remove_none_from_dict.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/core/request_options.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/core/serialization.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/document/__init__.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/document/client.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/document/raw_client.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/embeddings/__init__.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/embeddings/client.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/embeddings/raw_client.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/environment.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/errors/__init__.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/errors/bad_request_error.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/errors/forbidden_error.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/errors/internal_server_error.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/errors/not_found_error.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/errors/service_unavailable_error.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/errors/unauthorized_error.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/errors/unprocessable_entity_error.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/fetch/__init__.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/fetch/client.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/fetch/raw_client.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/raw_client.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/search/__init__.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/search/client.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/search/raw_client.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/search/types/__init__.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/search/types/alpha.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/sources/__init__.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/tenant/__init__.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/tenant/client.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/tenant/raw_client.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/__init__.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/actual_error_response.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/add_user_memory_response.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/app_sources_upload_data.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/attachment_model.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/batch_upload_data.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/bm_25_operator_type.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/body_scrape_webpage_upload_scrape_webpage_post.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/body_update_scrape_job_upload_update_webpage_patch.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/content_model.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/delete_memory_request.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/delete_sources.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/delete_sub_tenant_data.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/delete_user_memory_response.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/embeddings_create_collection_data.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/embeddings_delete_data.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/embeddings_get_data.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/embeddings_search_data.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/error_response.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/extended_context.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/fetch_content_data.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/file_upload_result.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/generate_user_memory_response.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/http_validation_error.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/list_sources_response.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/list_user_memories_response.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/markdown_upload_request.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/processing_status.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/related_chunk.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/relations.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/retrieve_user_memory_response.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/search_chunk.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/single_upload_data.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/source.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/source_model.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/sub_tenant_ids_data.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/tenant_create_data.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/tenant_stats.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/user_memory.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/validation_error.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/types/validation_error_loc_item.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/upload/__init__.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/upload/client.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/upload/raw_client.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/user/__init__.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/user/client.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/user/raw_client.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/user_memory/__init__.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/user_memory/client.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai/user_memory/raw_client.py +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai.egg-info/SOURCES.txt +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai.egg-info/dependency_links.txt +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai.egg-info/requires.txt +0 -0
- {usecortex_ai-0.3.0 → usecortex_ai-0.3.1}/src/usecortex_ai.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: usecortex-ai
|
|
3
|
+
Version: 0.3.1
|
|
4
|
+
Summary: The official Python SDK for the Cortex AI platform.
|
|
5
|
+
Author-email: Nishkarsh Shrivastava <nishkarsh@usecortex.ai>
|
|
6
|
+
License: Copyright (c) 2024 Cortex AI
|
|
7
|
+
|
|
8
|
+
All Rights Reserved.
|
|
9
|
+
|
|
10
|
+
PROPRIETARY AND CONFIDENTIAL
|
|
11
|
+
|
|
12
|
+
This software is the proprietary and confidential property of Cortex AI ("the Company").
|
|
13
|
+
Permission is hereby granted to authorized users to install and use this software as part of the Cortex AI service, subject to the terms and conditions of the service agreement entered into with the Company.
|
|
14
|
+
|
|
15
|
+
You may not, without the express written permission of the Company:
|
|
16
|
+
|
|
17
|
+
1. Copy, modify, or create derivative works of the software.
|
|
18
|
+
2. Distribute, sell, rent, lease, sublicense, or otherwise transfer the software to any third party.
|
|
19
|
+
3. Reverse engineer, decompile, or disassemble the software, except and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
28
|
+
Project-URL: Homepage, https://www.usecortex.ai/
|
|
29
|
+
Project-URL: Documentation, https://docs.usecortex.ai/
|
|
30
|
+
Keywords: cortex,ai,sdk,api,generative ai,rag
|
|
31
|
+
Classifier: Development Status :: 4 - Beta
|
|
32
|
+
Classifier: Programming Language :: Python :: 3
|
|
33
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
34
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
35
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
36
|
+
Classifier: Intended Audience :: Developers
|
|
37
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
38
|
+
Classifier: Typing :: Typed
|
|
39
|
+
Requires-Python: >=3.10
|
|
40
|
+
Description-Content-Type: text/markdown
|
|
41
|
+
License-File: LICENSE
|
|
42
|
+
Requires-Dist: httpx>=0.24
|
|
43
|
+
Requires-Dist: pydantic<3,>=1.10
|
|
44
|
+
Dynamic: license-file
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
# Cortex AI Python SDK
|
|
52
|
+
|
|
53
|
+
The official Python SDK for the Cortex AI platform. Build powerful, context-aware AI applications in your Python applications.
|
|
54
|
+
|
|
55
|
+
## Links
|
|
56
|
+
|
|
57
|
+
- **Homepage:** [usecortex.ai](https://www.usecortex.ai/)
|
|
58
|
+
- **Documentation:** [docs.usecortex.ai](https://docs.usecortex.ai/)
|
|
59
|
+
|
|
60
|
+
## Getting Started
|
|
61
|
+
|
|
62
|
+
Please refer to our [SDK documentation](https://docs.usecortex.ai/api-reference/sdks) and [API reference](https://docs.usecortex.ai/api-reference/introduction) to get started.
|
|
63
|
+
|
|
64
|
+
## Support
|
|
65
|
+
|
|
66
|
+
If you have any questions or need help, please reach out to our support team at [founders@usecortex.ai](mailto:founders@usecortex.ai).
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
```
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
# Cortex AI Python SDK
|
|
7
|
+
|
|
8
|
+
The official Python SDK for the Cortex AI platform. Build powerful, context-aware AI applications in your Python applications.
|
|
9
|
+
|
|
10
|
+
## Links
|
|
11
|
+
|
|
12
|
+
- **Homepage:** [usecortex.ai](https://www.usecortex.ai/)
|
|
13
|
+
- **Documentation:** [docs.usecortex.ai](https://docs.usecortex.ai/)
|
|
14
|
+
|
|
15
|
+
## Getting Started
|
|
16
|
+
|
|
17
|
+
Please refer to our [SDK documentation](https://docs.usecortex.ai/api-reference/sdks) and [API reference](https://docs.usecortex.ai/api-reference/introduction) to get started.
|
|
18
|
+
|
|
19
|
+
## Support
|
|
20
|
+
|
|
21
|
+
If you have any questions or need help, please reach out to our support team at [founders@usecortex.ai](mailto:founders@usecortex.ai).
|
|
@@ -27,6 +27,48 @@ 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 used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
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_1234', sub_tenant_id='sub_tenant_4567', )
|
|
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(
|
|
30
72
|
self,
|
|
31
73
|
*,
|
|
32
74
|
tenant_id: str,
|
|
@@ -65,9 +107,9 @@ class SourcesClient:
|
|
|
65
107
|
from usecortex-ai import CortexAI
|
|
66
108
|
|
|
67
109
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
68
|
-
client.sources.
|
|
110
|
+
client.sources.get_by_ids(tenant_id='tenant_1234', source_ids=['CortexDoc1234', 'CortexDoc4567'], )
|
|
69
111
|
"""
|
|
70
|
-
_response = self._raw_client.
|
|
112
|
+
_response = self._raw_client.get_by_ids(
|
|
71
113
|
tenant_id=tenant_id, source_ids=source_ids, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
72
114
|
)
|
|
73
115
|
return _response.data
|
|
@@ -89,6 +131,52 @@ class AsyncSourcesClient:
|
|
|
89
131
|
return self._raw_client
|
|
90
132
|
|
|
91
133
|
async def get_all(
|
|
134
|
+
self,
|
|
135
|
+
*,
|
|
136
|
+
tenant_id: str,
|
|
137
|
+
sub_tenant_id: typing.Optional[str] = None,
|
|
138
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
139
|
+
) -> ListSourcesResponse:
|
|
140
|
+
"""
|
|
141
|
+
Retrieve all sources for a specific tenant.
|
|
142
|
+
|
|
143
|
+
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.
|
|
144
|
+
|
|
145
|
+
You can optionally specify a sub-tenant to narrow down the results to sources within that specific sub-tenant scope.
|
|
146
|
+
|
|
147
|
+
Parameters
|
|
148
|
+
----------
|
|
149
|
+
tenant_id : str
|
|
150
|
+
Unique identifier for the tenant/organization
|
|
151
|
+
|
|
152
|
+
sub_tenant_id : typing.Optional[str]
|
|
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.
|
|
154
|
+
|
|
155
|
+
request_options : typing.Optional[RequestOptions]
|
|
156
|
+
Request-specific configuration.
|
|
157
|
+
|
|
158
|
+
Returns
|
|
159
|
+
-------
|
|
160
|
+
ListSourcesResponse
|
|
161
|
+
Successful Response
|
|
162
|
+
|
|
163
|
+
Examples
|
|
164
|
+
--------
|
|
165
|
+
import asyncio
|
|
166
|
+
|
|
167
|
+
from usecortex-ai import AsyncCortexAI
|
|
168
|
+
|
|
169
|
+
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
170
|
+
async def main() -> None:
|
|
171
|
+
await client.sources.get_all(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
|
|
172
|
+
asyncio.run(main())
|
|
173
|
+
"""
|
|
174
|
+
_response = await self._raw_client.get_all(
|
|
175
|
+
tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
176
|
+
)
|
|
177
|
+
return _response.data
|
|
178
|
+
|
|
179
|
+
async def get_by_ids(
|
|
92
180
|
self,
|
|
93
181
|
*,
|
|
94
182
|
tenant_id: str,
|
|
@@ -130,10 +218,10 @@ class AsyncSourcesClient:
|
|
|
130
218
|
|
|
131
219
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
132
220
|
async def main() -> None:
|
|
133
|
-
await client.sources.
|
|
221
|
+
await client.sources.get_by_ids(tenant_id='tenant_1234', source_ids=['CortexDoc1234', 'CortexDoc4567'], )
|
|
134
222
|
asyncio.run(main())
|
|
135
223
|
"""
|
|
136
|
-
_response = await self._raw_client.
|
|
224
|
+
_response = await self._raw_client.get_by_ids(
|
|
137
225
|
tenant_id=tenant_id, source_ids=source_ids, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
138
226
|
)
|
|
139
227
|
return _response.data
|
|
@@ -27,6 +27,137 @@ class RawSourcesClient:
|
|
|
27
27
|
self._client_wrapper = client_wrapper
|
|
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
|
+
) -> HttpResponse[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 used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
50
|
+
|
|
51
|
+
request_options : typing.Optional[RequestOptions]
|
|
52
|
+
Request-specific configuration.
|
|
53
|
+
|
|
54
|
+
Returns
|
|
55
|
+
-------
|
|
56
|
+
HttpResponse[ListSourcesResponse]
|
|
57
|
+
Successful Response
|
|
58
|
+
"""
|
|
59
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
60
|
+
"list/sources",
|
|
61
|
+
method="GET",
|
|
62
|
+
params={
|
|
63
|
+
"tenant_id": tenant_id,
|
|
64
|
+
"sub_tenant_id": sub_tenant_id,
|
|
65
|
+
},
|
|
66
|
+
request_options=request_options,
|
|
67
|
+
)
|
|
68
|
+
try:
|
|
69
|
+
if 200 <= _response.status_code < 300:
|
|
70
|
+
_data = typing.cast(
|
|
71
|
+
ListSourcesResponse,
|
|
72
|
+
parse_obj_as(
|
|
73
|
+
type_=ListSourcesResponse, # type: ignore
|
|
74
|
+
object_=_response.json(),
|
|
75
|
+
),
|
|
76
|
+
)
|
|
77
|
+
return HttpResponse(response=_response, data=_data)
|
|
78
|
+
if _response.status_code == 400:
|
|
79
|
+
raise BadRequestError(
|
|
80
|
+
headers=dict(_response.headers),
|
|
81
|
+
body=typing.cast(
|
|
82
|
+
ActualErrorResponse,
|
|
83
|
+
parse_obj_as(
|
|
84
|
+
type_=ActualErrorResponse, # type: ignore
|
|
85
|
+
object_=_response.json(),
|
|
86
|
+
),
|
|
87
|
+
),
|
|
88
|
+
)
|
|
89
|
+
if _response.status_code == 401:
|
|
90
|
+
raise UnauthorizedError(
|
|
91
|
+
headers=dict(_response.headers),
|
|
92
|
+
body=typing.cast(
|
|
93
|
+
ActualErrorResponse,
|
|
94
|
+
parse_obj_as(
|
|
95
|
+
type_=ActualErrorResponse, # type: ignore
|
|
96
|
+
object_=_response.json(),
|
|
97
|
+
),
|
|
98
|
+
),
|
|
99
|
+
)
|
|
100
|
+
if _response.status_code == 403:
|
|
101
|
+
raise ForbiddenError(
|
|
102
|
+
headers=dict(_response.headers),
|
|
103
|
+
body=typing.cast(
|
|
104
|
+
ActualErrorResponse,
|
|
105
|
+
parse_obj_as(
|
|
106
|
+
type_=ActualErrorResponse, # type: ignore
|
|
107
|
+
object_=_response.json(),
|
|
108
|
+
),
|
|
109
|
+
),
|
|
110
|
+
)
|
|
111
|
+
if _response.status_code == 404:
|
|
112
|
+
raise NotFoundError(
|
|
113
|
+
headers=dict(_response.headers),
|
|
114
|
+
body=typing.cast(
|
|
115
|
+
ActualErrorResponse,
|
|
116
|
+
parse_obj_as(
|
|
117
|
+
type_=ActualErrorResponse, # type: ignore
|
|
118
|
+
object_=_response.json(),
|
|
119
|
+
),
|
|
120
|
+
),
|
|
121
|
+
)
|
|
122
|
+
if _response.status_code == 422:
|
|
123
|
+
raise UnprocessableEntityError(
|
|
124
|
+
headers=dict(_response.headers),
|
|
125
|
+
body=typing.cast(
|
|
126
|
+
typing.Optional[typing.Any],
|
|
127
|
+
parse_obj_as(
|
|
128
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
129
|
+
object_=_response.json(),
|
|
130
|
+
),
|
|
131
|
+
),
|
|
132
|
+
)
|
|
133
|
+
if _response.status_code == 500:
|
|
134
|
+
raise InternalServerError(
|
|
135
|
+
headers=dict(_response.headers),
|
|
136
|
+
body=typing.cast(
|
|
137
|
+
ActualErrorResponse,
|
|
138
|
+
parse_obj_as(
|
|
139
|
+
type_=ActualErrorResponse, # type: ignore
|
|
140
|
+
object_=_response.json(),
|
|
141
|
+
),
|
|
142
|
+
),
|
|
143
|
+
)
|
|
144
|
+
if _response.status_code == 503:
|
|
145
|
+
raise ServiceUnavailableError(
|
|
146
|
+
headers=dict(_response.headers),
|
|
147
|
+
body=typing.cast(
|
|
148
|
+
ActualErrorResponse,
|
|
149
|
+
parse_obj_as(
|
|
150
|
+
type_=ActualErrorResponse, # type: ignore
|
|
151
|
+
object_=_response.json(),
|
|
152
|
+
),
|
|
153
|
+
),
|
|
154
|
+
)
|
|
155
|
+
_response_json = _response.json()
|
|
156
|
+
except JSONDecodeError:
|
|
157
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
158
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
159
|
+
|
|
160
|
+
def get_by_ids(
|
|
30
161
|
self,
|
|
31
162
|
*,
|
|
32
163
|
tenant_id: str,
|
|
@@ -172,6 +303,137 @@ class AsyncRawSourcesClient:
|
|
|
172
303
|
self._client_wrapper = client_wrapper
|
|
173
304
|
|
|
174
305
|
async def get_all(
|
|
306
|
+
self,
|
|
307
|
+
*,
|
|
308
|
+
tenant_id: str,
|
|
309
|
+
sub_tenant_id: typing.Optional[str] = None,
|
|
310
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
311
|
+
) -> AsyncHttpResponse[ListSourcesResponse]:
|
|
312
|
+
"""
|
|
313
|
+
Retrieve all sources for a specific tenant.
|
|
314
|
+
|
|
315
|
+
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.
|
|
316
|
+
|
|
317
|
+
You can optionally specify a sub-tenant to narrow down the results to sources within that specific sub-tenant scope.
|
|
318
|
+
|
|
319
|
+
Parameters
|
|
320
|
+
----------
|
|
321
|
+
tenant_id : str
|
|
322
|
+
Unique identifier for the tenant/organization
|
|
323
|
+
|
|
324
|
+
sub_tenant_id : typing.Optional[str]
|
|
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.
|
|
326
|
+
|
|
327
|
+
request_options : typing.Optional[RequestOptions]
|
|
328
|
+
Request-specific configuration.
|
|
329
|
+
|
|
330
|
+
Returns
|
|
331
|
+
-------
|
|
332
|
+
AsyncHttpResponse[ListSourcesResponse]
|
|
333
|
+
Successful Response
|
|
334
|
+
"""
|
|
335
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
336
|
+
"list/sources",
|
|
337
|
+
method="GET",
|
|
338
|
+
params={
|
|
339
|
+
"tenant_id": tenant_id,
|
|
340
|
+
"sub_tenant_id": sub_tenant_id,
|
|
341
|
+
},
|
|
342
|
+
request_options=request_options,
|
|
343
|
+
)
|
|
344
|
+
try:
|
|
345
|
+
if 200 <= _response.status_code < 300:
|
|
346
|
+
_data = typing.cast(
|
|
347
|
+
ListSourcesResponse,
|
|
348
|
+
parse_obj_as(
|
|
349
|
+
type_=ListSourcesResponse, # type: ignore
|
|
350
|
+
object_=_response.json(),
|
|
351
|
+
),
|
|
352
|
+
)
|
|
353
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
354
|
+
if _response.status_code == 400:
|
|
355
|
+
raise BadRequestError(
|
|
356
|
+
headers=dict(_response.headers),
|
|
357
|
+
body=typing.cast(
|
|
358
|
+
ActualErrorResponse,
|
|
359
|
+
parse_obj_as(
|
|
360
|
+
type_=ActualErrorResponse, # type: ignore
|
|
361
|
+
object_=_response.json(),
|
|
362
|
+
),
|
|
363
|
+
),
|
|
364
|
+
)
|
|
365
|
+
if _response.status_code == 401:
|
|
366
|
+
raise UnauthorizedError(
|
|
367
|
+
headers=dict(_response.headers),
|
|
368
|
+
body=typing.cast(
|
|
369
|
+
ActualErrorResponse,
|
|
370
|
+
parse_obj_as(
|
|
371
|
+
type_=ActualErrorResponse, # type: ignore
|
|
372
|
+
object_=_response.json(),
|
|
373
|
+
),
|
|
374
|
+
),
|
|
375
|
+
)
|
|
376
|
+
if _response.status_code == 403:
|
|
377
|
+
raise ForbiddenError(
|
|
378
|
+
headers=dict(_response.headers),
|
|
379
|
+
body=typing.cast(
|
|
380
|
+
ActualErrorResponse,
|
|
381
|
+
parse_obj_as(
|
|
382
|
+
type_=ActualErrorResponse, # type: ignore
|
|
383
|
+
object_=_response.json(),
|
|
384
|
+
),
|
|
385
|
+
),
|
|
386
|
+
)
|
|
387
|
+
if _response.status_code == 404:
|
|
388
|
+
raise NotFoundError(
|
|
389
|
+
headers=dict(_response.headers),
|
|
390
|
+
body=typing.cast(
|
|
391
|
+
ActualErrorResponse,
|
|
392
|
+
parse_obj_as(
|
|
393
|
+
type_=ActualErrorResponse, # type: ignore
|
|
394
|
+
object_=_response.json(),
|
|
395
|
+
),
|
|
396
|
+
),
|
|
397
|
+
)
|
|
398
|
+
if _response.status_code == 422:
|
|
399
|
+
raise UnprocessableEntityError(
|
|
400
|
+
headers=dict(_response.headers),
|
|
401
|
+
body=typing.cast(
|
|
402
|
+
typing.Optional[typing.Any],
|
|
403
|
+
parse_obj_as(
|
|
404
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
405
|
+
object_=_response.json(),
|
|
406
|
+
),
|
|
407
|
+
),
|
|
408
|
+
)
|
|
409
|
+
if _response.status_code == 500:
|
|
410
|
+
raise InternalServerError(
|
|
411
|
+
headers=dict(_response.headers),
|
|
412
|
+
body=typing.cast(
|
|
413
|
+
ActualErrorResponse,
|
|
414
|
+
parse_obj_as(
|
|
415
|
+
type_=ActualErrorResponse, # type: ignore
|
|
416
|
+
object_=_response.json(),
|
|
417
|
+
),
|
|
418
|
+
),
|
|
419
|
+
)
|
|
420
|
+
if _response.status_code == 503:
|
|
421
|
+
raise ServiceUnavailableError(
|
|
422
|
+
headers=dict(_response.headers),
|
|
423
|
+
body=typing.cast(
|
|
424
|
+
ActualErrorResponse,
|
|
425
|
+
parse_obj_as(
|
|
426
|
+
type_=ActualErrorResponse, # type: ignore
|
|
427
|
+
object_=_response.json(),
|
|
428
|
+
),
|
|
429
|
+
),
|
|
430
|
+
)
|
|
431
|
+
_response_json = _response.json()
|
|
432
|
+
except JSONDecodeError:
|
|
433
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
434
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
435
|
+
|
|
436
|
+
async def get_by_ids(
|
|
175
437
|
self,
|
|
176
438
|
*,
|
|
177
439
|
tenant_id: str,
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: usecortex-ai
|
|
3
|
+
Version: 0.3.1
|
|
4
|
+
Summary: The official Python SDK for the Cortex AI platform.
|
|
5
|
+
Author-email: Nishkarsh Shrivastava <nishkarsh@usecortex.ai>
|
|
6
|
+
License: Copyright (c) 2024 Cortex AI
|
|
7
|
+
|
|
8
|
+
All Rights Reserved.
|
|
9
|
+
|
|
10
|
+
PROPRIETARY AND CONFIDENTIAL
|
|
11
|
+
|
|
12
|
+
This software is the proprietary and confidential property of Cortex AI ("the Company").
|
|
13
|
+
Permission is hereby granted to authorized users to install and use this software as part of the Cortex AI service, subject to the terms and conditions of the service agreement entered into with the Company.
|
|
14
|
+
|
|
15
|
+
You may not, without the express written permission of the Company:
|
|
16
|
+
|
|
17
|
+
1. Copy, modify, or create derivative works of the software.
|
|
18
|
+
2. Distribute, sell, rent, lease, sublicense, or otherwise transfer the software to any third party.
|
|
19
|
+
3. Reverse engineer, decompile, or disassemble the software, except and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
28
|
+
Project-URL: Homepage, https://www.usecortex.ai/
|
|
29
|
+
Project-URL: Documentation, https://docs.usecortex.ai/
|
|
30
|
+
Keywords: cortex,ai,sdk,api,generative ai,rag
|
|
31
|
+
Classifier: Development Status :: 4 - Beta
|
|
32
|
+
Classifier: Programming Language :: Python :: 3
|
|
33
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
34
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
35
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
36
|
+
Classifier: Intended Audience :: Developers
|
|
37
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
38
|
+
Classifier: Typing :: Typed
|
|
39
|
+
Requires-Python: >=3.10
|
|
40
|
+
Description-Content-Type: text/markdown
|
|
41
|
+
License-File: LICENSE
|
|
42
|
+
Requires-Dist: httpx>=0.24
|
|
43
|
+
Requires-Dist: pydantic<3,>=1.10
|
|
44
|
+
Dynamic: license-file
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
# Cortex AI Python SDK
|
|
52
|
+
|
|
53
|
+
The official Python SDK for the Cortex AI platform. Build powerful, context-aware AI applications in your Python applications.
|
|
54
|
+
|
|
55
|
+
## Links
|
|
56
|
+
|
|
57
|
+
- **Homepage:** [usecortex.ai](https://www.usecortex.ai/)
|
|
58
|
+
- **Documentation:** [docs.usecortex.ai](https://docs.usecortex.ai/)
|
|
59
|
+
|
|
60
|
+
## Getting Started
|
|
61
|
+
|
|
62
|
+
Please refer to our [SDK documentation](https://docs.usecortex.ai/api-reference/sdks) and [API reference](https://docs.usecortex.ai/api-reference/introduction) to get started.
|
|
63
|
+
|
|
64
|
+
## Support
|
|
65
|
+
|
|
66
|
+
If you have any questions or need help, please reach out to our support team at [founders@usecortex.ai](mailto:founders@usecortex.ai).
|