usecortex-ai 0.2.2__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.2.2 → usecortex_ai-0.3.1}/pyproject.toml +1 -1
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/client.py +80 -6
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/core/client_wrapper.py +8 -6
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/document/client.py +4 -4
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/document/raw_client.py +2 -2
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/embeddings/client.py +14 -14
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/embeddings/raw_client.py +10 -10
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/fetch/client.py +2 -12
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/fetch/raw_client.py +0 -10
- usecortex_ai-0.3.1/src/usecortex_ai/raw_client.py +90 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/search/client.py +22 -12
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/search/raw_client.py +16 -6
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/sources/client.py +20 -8
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/sources/raw_client.py +16 -2
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/tenant/client.py +8 -8
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/tenant/raw_client.py +2 -2
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/delete_memory_request.py +1 -1
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/markdown_upload_request.py +5 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/sub_tenant_ids_data.py +5 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/tenant_stats.py +2 -2
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/upload/client.py +122 -62
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/upload/raw_client.py +90 -30
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/user/client.py +16 -4
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/user/raw_client.py +8 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/user_memory/client.py +36 -26
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/user_memory/raw_client.py +26 -16
- usecortex_ai-0.3.1/src/usecortex_ai.egg-info/PKG-INFO +66 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai.egg-info/SOURCES.txt +1 -0
- usecortex_ai-0.2.2/PKG-INFO +0 -136
- usecortex_ai-0.2.2/README.md +0 -91
- usecortex_ai-0.2.2/src/usecortex_ai.egg-info/PKG-INFO +0 -136
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/LICENSE +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/setup.cfg +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/__init__.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/core/__init__.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/core/api_error.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/core/datetime_utils.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/core/file.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/core/force_multipart.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/core/http_client.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/core/http_response.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/core/jsonable_encoder.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/core/pydantic_utilities.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/core/query_encoder.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/core/remove_none_from_dict.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/core/request_options.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/core/serialization.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/document/__init__.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/embeddings/__init__.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/environment.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/errors/__init__.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/errors/bad_request_error.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/errors/forbidden_error.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/errors/internal_server_error.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/errors/not_found_error.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/errors/service_unavailable_error.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/errors/unauthorized_error.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/errors/unprocessable_entity_error.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/fetch/__init__.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/search/__init__.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/search/types/__init__.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/search/types/alpha.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/sources/__init__.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/tenant/__init__.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/__init__.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/actual_error_response.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/add_user_memory_response.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/app_sources_upload_data.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/attachment_model.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/batch_upload_data.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/bm_25_operator_type.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/body_scrape_webpage_upload_scrape_webpage_post.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/body_update_scrape_job_upload_update_webpage_patch.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/content_model.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/delete_sources.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/delete_sub_tenant_data.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/delete_user_memory_response.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/embeddings_create_collection_data.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/embeddings_delete_data.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/embeddings_get_data.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/embeddings_search_data.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/error_response.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/extended_context.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/fetch_content_data.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/file_upload_result.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/generate_user_memory_response.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/http_validation_error.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/list_sources_response.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/list_user_memories_response.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/processing_status.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/related_chunk.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/relations.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/retrieve_user_memory_response.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/search_chunk.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/single_upload_data.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/source.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/source_model.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/tenant_create_data.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/user_memory.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/validation_error.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/types/validation_error_loc_item.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/upload/__init__.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/user/__init__.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai/user_memory/__init__.py +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai.egg-info/dependency_links.txt +0 -0
- {usecortex_ai-0.2.2 → usecortex_ai-0.3.1}/src/usecortex_ai.egg-info/requires.txt +0 -0
- {usecortex_ai-0.2.2 → 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).
|
|
@@ -4,10 +4,12 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import httpx
|
|
6
6
|
from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
7
|
+
from .core.request_options import RequestOptions
|
|
7
8
|
from .document.client import AsyncDocumentClient, DocumentClient
|
|
8
9
|
from .embeddings.client import AsyncEmbeddingsClient, EmbeddingsClient
|
|
9
10
|
from .environment import CortexAIEnvironment
|
|
10
11
|
from .fetch.client import AsyncFetchClient, FetchClient
|
|
12
|
+
from .raw_client import AsyncRawCortexAI, RawCortexAI
|
|
11
13
|
from .search.client import AsyncSearchClient, SearchClient
|
|
12
14
|
from .sources.client import AsyncSourcesClient, SourcesClient
|
|
13
15
|
from .tenant.client import AsyncTenantClient, TenantClient
|
|
@@ -34,7 +36,7 @@ class CortexAI:
|
|
|
34
36
|
|
|
35
37
|
|
|
36
38
|
|
|
37
|
-
token : typing.Union[str, typing.Callable[[], str]]
|
|
39
|
+
token : typing.Optional[typing.Union[str, typing.Callable[[], str]]]
|
|
38
40
|
headers : typing.Optional[typing.Dict[str, str]]
|
|
39
41
|
Additional headers to send with every request.
|
|
40
42
|
|
|
@@ -59,7 +61,7 @@ class CortexAI:
|
|
|
59
61
|
*,
|
|
60
62
|
base_url: typing.Optional[str] = None,
|
|
61
63
|
environment: CortexAIEnvironment = CortexAIEnvironment.CORTEX_PROD,
|
|
62
|
-
token: typing.Union[str, typing.Callable[[], str]],
|
|
64
|
+
token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
|
|
63
65
|
headers: typing.Optional[typing.Dict[str, str]] = None,
|
|
64
66
|
timeout: typing.Optional[float] = None,
|
|
65
67
|
follow_redirects: typing.Optional[bool] = True,
|
|
@@ -79,15 +81,49 @@ class CortexAI:
|
|
|
79
81
|
else httpx.Client(timeout=_defaulted_timeout),
|
|
80
82
|
timeout=_defaulted_timeout,
|
|
81
83
|
)
|
|
84
|
+
self._raw_client = RawCortexAI(client_wrapper=self._client_wrapper)
|
|
82
85
|
self.search = SearchClient(client_wrapper=self._client_wrapper)
|
|
83
86
|
self.sources = SourcesClient(client_wrapper=self._client_wrapper)
|
|
84
87
|
self.user_memory = UserMemoryClient(client_wrapper=self._client_wrapper)
|
|
85
88
|
self.fetch = FetchClient(client_wrapper=self._client_wrapper)
|
|
86
89
|
self.upload = UploadClient(client_wrapper=self._client_wrapper)
|
|
87
|
-
self.document = DocumentClient(client_wrapper=self._client_wrapper)
|
|
88
90
|
self.embeddings = EmbeddingsClient(client_wrapper=self._client_wrapper)
|
|
89
91
|
self.user = UserClient(client_wrapper=self._client_wrapper)
|
|
90
92
|
self.tenant = TenantClient(client_wrapper=self._client_wrapper)
|
|
93
|
+
self.document = DocumentClient(client_wrapper=self._client_wrapper)
|
|
94
|
+
|
|
95
|
+
@property
|
|
96
|
+
def with_raw_response(self) -> RawCortexAI:
|
|
97
|
+
"""
|
|
98
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
99
|
+
|
|
100
|
+
Returns
|
|
101
|
+
-------
|
|
102
|
+
RawCortexAI
|
|
103
|
+
"""
|
|
104
|
+
return self._raw_client
|
|
105
|
+
|
|
106
|
+
def root_get(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Optional[typing.Any]:
|
|
107
|
+
"""
|
|
108
|
+
Parameters
|
|
109
|
+
----------
|
|
110
|
+
request_options : typing.Optional[RequestOptions]
|
|
111
|
+
Request-specific configuration.
|
|
112
|
+
|
|
113
|
+
Returns
|
|
114
|
+
-------
|
|
115
|
+
typing.Optional[typing.Any]
|
|
116
|
+
Successful Response
|
|
117
|
+
|
|
118
|
+
Examples
|
|
119
|
+
--------
|
|
120
|
+
from usecortex-ai import CortexAI
|
|
121
|
+
|
|
122
|
+
client = CortexAI(token="YOUR_TOKEN", )
|
|
123
|
+
client.root_get()
|
|
124
|
+
"""
|
|
125
|
+
_response = self._raw_client.root_get(request_options=request_options)
|
|
126
|
+
return _response.data
|
|
91
127
|
|
|
92
128
|
|
|
93
129
|
class AsyncCortexAI:
|
|
@@ -108,7 +144,7 @@ class AsyncCortexAI:
|
|
|
108
144
|
|
|
109
145
|
|
|
110
146
|
|
|
111
|
-
token : typing.Union[str, typing.Callable[[], str]]
|
|
147
|
+
token : typing.Optional[typing.Union[str, typing.Callable[[], str]]]
|
|
112
148
|
headers : typing.Optional[typing.Dict[str, str]]
|
|
113
149
|
Additional headers to send with every request.
|
|
114
150
|
|
|
@@ -133,7 +169,7 @@ class AsyncCortexAI:
|
|
|
133
169
|
*,
|
|
134
170
|
base_url: typing.Optional[str] = None,
|
|
135
171
|
environment: CortexAIEnvironment = CortexAIEnvironment.CORTEX_PROD,
|
|
136
|
-
token: typing.Union[str, typing.Callable[[], str]],
|
|
172
|
+
token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
|
|
137
173
|
headers: typing.Optional[typing.Dict[str, str]] = None,
|
|
138
174
|
timeout: typing.Optional[float] = None,
|
|
139
175
|
follow_redirects: typing.Optional[bool] = True,
|
|
@@ -153,15 +189,53 @@ class AsyncCortexAI:
|
|
|
153
189
|
else httpx.AsyncClient(timeout=_defaulted_timeout),
|
|
154
190
|
timeout=_defaulted_timeout,
|
|
155
191
|
)
|
|
192
|
+
self._raw_client = AsyncRawCortexAI(client_wrapper=self._client_wrapper)
|
|
156
193
|
self.search = AsyncSearchClient(client_wrapper=self._client_wrapper)
|
|
157
194
|
self.sources = AsyncSourcesClient(client_wrapper=self._client_wrapper)
|
|
158
195
|
self.user_memory = AsyncUserMemoryClient(client_wrapper=self._client_wrapper)
|
|
159
196
|
self.fetch = AsyncFetchClient(client_wrapper=self._client_wrapper)
|
|
160
197
|
self.upload = AsyncUploadClient(client_wrapper=self._client_wrapper)
|
|
161
|
-
self.document = AsyncDocumentClient(client_wrapper=self._client_wrapper)
|
|
162
198
|
self.embeddings = AsyncEmbeddingsClient(client_wrapper=self._client_wrapper)
|
|
163
199
|
self.user = AsyncUserClient(client_wrapper=self._client_wrapper)
|
|
164
200
|
self.tenant = AsyncTenantClient(client_wrapper=self._client_wrapper)
|
|
201
|
+
self.document = AsyncDocumentClient(client_wrapper=self._client_wrapper)
|
|
202
|
+
|
|
203
|
+
@property
|
|
204
|
+
def with_raw_response(self) -> AsyncRawCortexAI:
|
|
205
|
+
"""
|
|
206
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
207
|
+
|
|
208
|
+
Returns
|
|
209
|
+
-------
|
|
210
|
+
AsyncRawCortexAI
|
|
211
|
+
"""
|
|
212
|
+
return self._raw_client
|
|
213
|
+
|
|
214
|
+
async def root_get(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Optional[typing.Any]:
|
|
215
|
+
"""
|
|
216
|
+
Parameters
|
|
217
|
+
----------
|
|
218
|
+
request_options : typing.Optional[RequestOptions]
|
|
219
|
+
Request-specific configuration.
|
|
220
|
+
|
|
221
|
+
Returns
|
|
222
|
+
-------
|
|
223
|
+
typing.Optional[typing.Any]
|
|
224
|
+
Successful Response
|
|
225
|
+
|
|
226
|
+
Examples
|
|
227
|
+
--------
|
|
228
|
+
import asyncio
|
|
229
|
+
|
|
230
|
+
from usecortex-ai import AsyncCortexAI
|
|
231
|
+
|
|
232
|
+
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
233
|
+
async def main() -> None:
|
|
234
|
+
await client.root_get()
|
|
235
|
+
asyncio.run(main())
|
|
236
|
+
"""
|
|
237
|
+
_response = await self._raw_client.root_get(request_options=request_options)
|
|
238
|
+
return _response.data
|
|
165
239
|
|
|
166
240
|
|
|
167
241
|
def _get_base_url(*, base_url: typing.Optional[str] = None, environment: CortexAIEnvironment) -> str:
|
|
@@ -10,7 +10,7 @@ class BaseClientWrapper:
|
|
|
10
10
|
def __init__(
|
|
11
11
|
self,
|
|
12
12
|
*,
|
|
13
|
-
token: typing.Union[str, typing.Callable[[], str]],
|
|
13
|
+
token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
|
|
14
14
|
headers: typing.Optional[typing.Dict[str, str]] = None,
|
|
15
15
|
base_url: str,
|
|
16
16
|
timeout: typing.Optional[float] = None,
|
|
@@ -25,11 +25,13 @@ class BaseClientWrapper:
|
|
|
25
25
|
"X-Fern-Language": "Python",
|
|
26
26
|
**(self.get_custom_headers() or {}),
|
|
27
27
|
}
|
|
28
|
-
|
|
28
|
+
token = self._get_token()
|
|
29
|
+
if token is not None:
|
|
30
|
+
headers["Authorization"] = f"Bearer {token}"
|
|
29
31
|
return headers
|
|
30
32
|
|
|
31
|
-
def _get_token(self) -> str:
|
|
32
|
-
if isinstance(self._token, str):
|
|
33
|
+
def _get_token(self) -> typing.Optional[str]:
|
|
34
|
+
if isinstance(self._token, str) or self._token is None:
|
|
33
35
|
return self._token
|
|
34
36
|
else:
|
|
35
37
|
return self._token()
|
|
@@ -48,7 +50,7 @@ class SyncClientWrapper(BaseClientWrapper):
|
|
|
48
50
|
def __init__(
|
|
49
51
|
self,
|
|
50
52
|
*,
|
|
51
|
-
token: typing.Union[str, typing.Callable[[], str]],
|
|
53
|
+
token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
|
|
52
54
|
headers: typing.Optional[typing.Dict[str, str]] = None,
|
|
53
55
|
base_url: str,
|
|
54
56
|
timeout: typing.Optional[float] = None,
|
|
@@ -67,7 +69,7 @@ class AsyncClientWrapper(BaseClientWrapper):
|
|
|
67
69
|
def __init__(
|
|
68
70
|
self,
|
|
69
71
|
*,
|
|
70
|
-
token: typing.Union[str, typing.Callable[[], str]],
|
|
72
|
+
token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
|
|
71
73
|
headers: typing.Optional[typing.Dict[str, str]] = None,
|
|
72
74
|
base_url: str,
|
|
73
75
|
timeout: typing.Optional[float] = None,
|
|
@@ -50,7 +50,7 @@ class DocumentClient:
|
|
|
50
50
|
List of source IDs to delete
|
|
51
51
|
|
|
52
52
|
sub_tenant_id : typing.Optional[str]
|
|
53
|
-
Optional sub-tenant identifier
|
|
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.
|
|
54
54
|
|
|
55
55
|
request_options : typing.Optional[RequestOptions]
|
|
56
56
|
Request-specific configuration.
|
|
@@ -65,7 +65,7 @@ class DocumentClient:
|
|
|
65
65
|
from usecortex-ai import CortexAI
|
|
66
66
|
|
|
67
67
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
68
|
-
client.document.delete(tenant_id='
|
|
68
|
+
client.document.delete(tenant_id='tenant_1234', source_ids=['CortexDoc1234', 'CortexDoc4567'], )
|
|
69
69
|
"""
|
|
70
70
|
_response = self._raw_client.delete(
|
|
71
71
|
tenant_id=tenant_id, source_ids=source_ids, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
@@ -112,7 +112,7 @@ class AsyncDocumentClient:
|
|
|
112
112
|
List of source IDs to delete
|
|
113
113
|
|
|
114
114
|
sub_tenant_id : typing.Optional[str]
|
|
115
|
-
Optional sub-tenant identifier
|
|
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.
|
|
116
116
|
|
|
117
117
|
request_options : typing.Optional[RequestOptions]
|
|
118
118
|
Request-specific configuration.
|
|
@@ -130,7 +130,7 @@ class AsyncDocumentClient:
|
|
|
130
130
|
|
|
131
131
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
132
132
|
async def main() -> None:
|
|
133
|
-
await client.document.delete(tenant_id='
|
|
133
|
+
await client.document.delete(tenant_id='tenant_1234', source_ids=['CortexDoc1234', 'CortexDoc4567'], )
|
|
134
134
|
asyncio.run(main())
|
|
135
135
|
"""
|
|
136
136
|
_response = await self._raw_client.delete(
|
|
@@ -50,7 +50,7 @@ class RawDocumentClient:
|
|
|
50
50
|
List of source IDs to delete
|
|
51
51
|
|
|
52
52
|
sub_tenant_id : typing.Optional[str]
|
|
53
|
-
Optional sub-tenant identifier
|
|
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.
|
|
54
54
|
|
|
55
55
|
request_options : typing.Optional[RequestOptions]
|
|
56
56
|
Request-specific configuration.
|
|
@@ -195,7 +195,7 @@ class AsyncRawDocumentClient:
|
|
|
195
195
|
List of source IDs to delete
|
|
196
196
|
|
|
197
197
|
sub_tenant_id : typing.Optional[str]
|
|
198
|
-
Optional sub-tenant identifier
|
|
198
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
199
199
|
|
|
200
200
|
request_options : typing.Optional[RequestOptions]
|
|
201
201
|
Request-specific configuration.
|
|
@@ -51,7 +51,7 @@ class EmbeddingsClient:
|
|
|
51
51
|
Unique identifier for the tenant/organization
|
|
52
52
|
|
|
53
53
|
sub_tenant_id : typing.Optional[str]
|
|
54
|
-
Optional sub-tenant identifier
|
|
54
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
55
55
|
|
|
56
56
|
request_options : typing.Optional[RequestOptions]
|
|
57
57
|
Request-specific configuration.
|
|
@@ -66,7 +66,7 @@ class EmbeddingsClient:
|
|
|
66
66
|
from usecortex-ai import CortexAI
|
|
67
67
|
|
|
68
68
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
69
|
-
client.embeddings.delete(chunk_ids=['
|
|
69
|
+
client.embeddings.delete(chunk_ids=['CortexEmbeddings123_0', 'CortexEmbeddings123_1'], tenant_id='tenant_1234', )
|
|
70
70
|
"""
|
|
71
71
|
_response = self._raw_client.delete(
|
|
72
72
|
chunk_ids=chunk_ids, tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
@@ -100,7 +100,7 @@ class EmbeddingsClient:
|
|
|
100
100
|
The embedding vector for search
|
|
101
101
|
|
|
102
102
|
sub_tenant_id : typing.Optional[str]
|
|
103
|
-
Optional sub-tenant identifier
|
|
103
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
104
104
|
|
|
105
105
|
max_chunks : typing.Optional[int]
|
|
106
106
|
|
|
@@ -117,7 +117,7 @@ class EmbeddingsClient:
|
|
|
117
117
|
from usecortex-ai import CortexAI
|
|
118
118
|
|
|
119
119
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
120
|
-
client.embeddings.search(tenant_id='
|
|
120
|
+
client.embeddings.search(tenant_id='tenant_1234', )
|
|
121
121
|
"""
|
|
122
122
|
_response = self._raw_client.search(
|
|
123
123
|
tenant_id=tenant_id,
|
|
@@ -150,7 +150,7 @@ class EmbeddingsClient:
|
|
|
150
150
|
Unique identifier for the tenant/organization
|
|
151
151
|
|
|
152
152
|
sub_tenant_id : typing.Optional[str]
|
|
153
|
-
Optional sub-tenant identifier
|
|
153
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
154
154
|
|
|
155
155
|
request_options : typing.Optional[RequestOptions]
|
|
156
156
|
Request-specific configuration.
|
|
@@ -165,7 +165,7 @@ class EmbeddingsClient:
|
|
|
165
165
|
from usecortex-ai import CortexAI
|
|
166
166
|
|
|
167
167
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
168
|
-
client.embeddings.get_by_chunk_ids(chunk_ids=['
|
|
168
|
+
client.embeddings.get_by_chunk_ids(chunk_ids=['CortexEmbeddings123_0', 'CortexEmbeddings123_1'], tenant_id='tenant_1234', )
|
|
169
169
|
"""
|
|
170
170
|
_response = self._raw_client.get_by_chunk_ids(
|
|
171
171
|
chunk_ids=chunk_ids, tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
@@ -198,7 +198,7 @@ class EmbeddingsClient:
|
|
|
198
198
|
from usecortex-ai import CortexAI
|
|
199
199
|
|
|
200
200
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
201
|
-
client.embeddings.create_collection(tenant_id='
|
|
201
|
+
client.embeddings.create_collection(tenant_id='tenant_1234', )
|
|
202
202
|
"""
|
|
203
203
|
_response = self._raw_client.create_collection(tenant_id=tenant_id, request_options=request_options)
|
|
204
204
|
return _response.data
|
|
@@ -241,7 +241,7 @@ class AsyncEmbeddingsClient:
|
|
|
241
241
|
Unique identifier for the tenant/organization
|
|
242
242
|
|
|
243
243
|
sub_tenant_id : typing.Optional[str]
|
|
244
|
-
Optional sub-tenant identifier
|
|
244
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
245
245
|
|
|
246
246
|
request_options : typing.Optional[RequestOptions]
|
|
247
247
|
Request-specific configuration.
|
|
@@ -259,7 +259,7 @@ class AsyncEmbeddingsClient:
|
|
|
259
259
|
|
|
260
260
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
261
261
|
async def main() -> None:
|
|
262
|
-
await client.embeddings.delete(chunk_ids=['
|
|
262
|
+
await client.embeddings.delete(chunk_ids=['CortexEmbeddings123_0', 'CortexEmbeddings123_1'], tenant_id='tenant_1234', )
|
|
263
263
|
asyncio.run(main())
|
|
264
264
|
"""
|
|
265
265
|
_response = await self._raw_client.delete(
|
|
@@ -294,7 +294,7 @@ class AsyncEmbeddingsClient:
|
|
|
294
294
|
The embedding vector for search
|
|
295
295
|
|
|
296
296
|
sub_tenant_id : typing.Optional[str]
|
|
297
|
-
Optional sub-tenant identifier
|
|
297
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
298
298
|
|
|
299
299
|
max_chunks : typing.Optional[int]
|
|
300
300
|
|
|
@@ -314,7 +314,7 @@ class AsyncEmbeddingsClient:
|
|
|
314
314
|
|
|
315
315
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
316
316
|
async def main() -> None:
|
|
317
|
-
await client.embeddings.search(tenant_id='
|
|
317
|
+
await client.embeddings.search(tenant_id='tenant_1234', )
|
|
318
318
|
asyncio.run(main())
|
|
319
319
|
"""
|
|
320
320
|
_response = await self._raw_client.search(
|
|
@@ -348,7 +348,7 @@ class AsyncEmbeddingsClient:
|
|
|
348
348
|
Unique identifier for the tenant/organization
|
|
349
349
|
|
|
350
350
|
sub_tenant_id : typing.Optional[str]
|
|
351
|
-
Optional sub-tenant identifier
|
|
351
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
352
352
|
|
|
353
353
|
request_options : typing.Optional[RequestOptions]
|
|
354
354
|
Request-specific configuration.
|
|
@@ -366,7 +366,7 @@ class AsyncEmbeddingsClient:
|
|
|
366
366
|
|
|
367
367
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
368
368
|
async def main() -> None:
|
|
369
|
-
await client.embeddings.get_by_chunk_ids(chunk_ids=['
|
|
369
|
+
await client.embeddings.get_by_chunk_ids(chunk_ids=['CortexEmbeddings123_0', 'CortexEmbeddings123_1'], tenant_id='tenant_1234', )
|
|
370
370
|
asyncio.run(main())
|
|
371
371
|
"""
|
|
372
372
|
_response = await self._raw_client.get_by_chunk_ids(
|
|
@@ -403,7 +403,7 @@ class AsyncEmbeddingsClient:
|
|
|
403
403
|
|
|
404
404
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
405
405
|
async def main() -> None:
|
|
406
|
-
await client.embeddings.create_collection(tenant_id='
|
|
406
|
+
await client.embeddings.create_collection(tenant_id='tenant_1234', )
|
|
407
407
|
asyncio.run(main())
|
|
408
408
|
"""
|
|
409
409
|
_response = await self._raw_client.create_collection(tenant_id=tenant_id, request_options=request_options)
|
|
@@ -51,7 +51,7 @@ class RawEmbeddingsClient:
|
|
|
51
51
|
Unique identifier for the tenant/organization
|
|
52
52
|
|
|
53
53
|
sub_tenant_id : typing.Optional[str]
|
|
54
|
-
Optional sub-tenant identifier
|
|
54
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
55
55
|
|
|
56
56
|
request_options : typing.Optional[RequestOptions]
|
|
57
57
|
Request-specific configuration.
|
|
@@ -194,7 +194,7 @@ class RawEmbeddingsClient:
|
|
|
194
194
|
The embedding vector for search
|
|
195
195
|
|
|
196
196
|
sub_tenant_id : typing.Optional[str]
|
|
197
|
-
Optional sub-tenant identifier
|
|
197
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
198
198
|
|
|
199
199
|
max_chunks : typing.Optional[int]
|
|
200
200
|
|
|
@@ -335,7 +335,7 @@ class RawEmbeddingsClient:
|
|
|
335
335
|
Unique identifier for the tenant/organization
|
|
336
336
|
|
|
337
337
|
sub_tenant_id : typing.Optional[str]
|
|
338
|
-
Optional sub-tenant identifier
|
|
338
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
339
339
|
|
|
340
340
|
request_options : typing.Optional[RequestOptions]
|
|
341
341
|
Request-specific configuration.
|
|
@@ -346,7 +346,7 @@ class RawEmbeddingsClient:
|
|
|
346
346
|
Successful Response
|
|
347
347
|
"""
|
|
348
348
|
_response = self._client_wrapper.httpx_client.request(
|
|
349
|
-
"embeddings/
|
|
349
|
+
"embeddings/retrieve_by_ids",
|
|
350
350
|
method="POST",
|
|
351
351
|
json={
|
|
352
352
|
"chunk_ids": chunk_ids,
|
|
@@ -473,7 +473,7 @@ class RawEmbeddingsClient:
|
|
|
473
473
|
Successful Response
|
|
474
474
|
"""
|
|
475
475
|
_response = self._client_wrapper.httpx_client.request(
|
|
476
|
-
"embeddings/
|
|
476
|
+
"embeddings/create_tenant",
|
|
477
477
|
method="POST",
|
|
478
478
|
params={
|
|
479
479
|
"tenant_id": tenant_id,
|
|
@@ -599,7 +599,7 @@ class AsyncRawEmbeddingsClient:
|
|
|
599
599
|
Unique identifier for the tenant/organization
|
|
600
600
|
|
|
601
601
|
sub_tenant_id : typing.Optional[str]
|
|
602
|
-
Optional sub-tenant identifier
|
|
602
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
603
603
|
|
|
604
604
|
request_options : typing.Optional[RequestOptions]
|
|
605
605
|
Request-specific configuration.
|
|
@@ -742,7 +742,7 @@ class AsyncRawEmbeddingsClient:
|
|
|
742
742
|
The embedding vector for search
|
|
743
743
|
|
|
744
744
|
sub_tenant_id : typing.Optional[str]
|
|
745
|
-
Optional sub-tenant identifier
|
|
745
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
746
746
|
|
|
747
747
|
max_chunks : typing.Optional[int]
|
|
748
748
|
|
|
@@ -883,7 +883,7 @@ class AsyncRawEmbeddingsClient:
|
|
|
883
883
|
Unique identifier for the tenant/organization
|
|
884
884
|
|
|
885
885
|
sub_tenant_id : typing.Optional[str]
|
|
886
|
-
Optional sub-tenant identifier
|
|
886
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
887
887
|
|
|
888
888
|
request_options : typing.Optional[RequestOptions]
|
|
889
889
|
Request-specific configuration.
|
|
@@ -894,7 +894,7 @@ class AsyncRawEmbeddingsClient:
|
|
|
894
894
|
Successful Response
|
|
895
895
|
"""
|
|
896
896
|
_response = await self._client_wrapper.httpx_client.request(
|
|
897
|
-
"embeddings/
|
|
897
|
+
"embeddings/retrieve_by_ids",
|
|
898
898
|
method="POST",
|
|
899
899
|
json={
|
|
900
900
|
"chunk_ids": chunk_ids,
|
|
@@ -1021,7 +1021,7 @@ class AsyncRawEmbeddingsClient:
|
|
|
1021
1021
|
Successful Response
|
|
1022
1022
|
"""
|
|
1023
1023
|
_response = await self._client_wrapper.httpx_client.request(
|
|
1024
|
-
"embeddings/
|
|
1024
|
+
"embeddings/create_tenant",
|
|
1025
1025
|
method="POST",
|
|
1026
1026
|
params={
|
|
1027
1027
|
"tenant_id": tenant_id,
|
|
@@ -40,19 +40,14 @@ class FetchClient:
|
|
|
40
40
|
Parameters
|
|
41
41
|
----------
|
|
42
42
|
file_id : str
|
|
43
|
-
Unique identifier for the file to fetch
|
|
44
43
|
|
|
45
44
|
file_type : str
|
|
46
|
-
Type of file (e.g., 'app', 'file', or other)
|
|
47
45
|
|
|
48
46
|
tenant_id : str
|
|
49
|
-
Tenant identifier for multi-tenancy
|
|
50
47
|
|
|
51
48
|
return_content : typing.Optional[bool]
|
|
52
|
-
Whether to return the file content along with the URL
|
|
53
49
|
|
|
54
50
|
sub_tenant_id : typing.Optional[str]
|
|
55
|
-
Sub-tenant identifier, defaults to tenant_id if not provided
|
|
56
51
|
|
|
57
52
|
request_options : typing.Optional[RequestOptions]
|
|
58
53
|
Request-specific configuration.
|
|
@@ -67,7 +62,7 @@ class FetchClient:
|
|
|
67
62
|
from usecortex-ai import CortexAI
|
|
68
63
|
|
|
69
64
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
70
|
-
client.fetch.fetch_content(file_id='
|
|
65
|
+
client.fetch.fetch_content(file_id='CortexDoc1234', file_type='<file_type>', tenant_id='tenant_1234', )
|
|
71
66
|
"""
|
|
72
67
|
_response = self._raw_client.fetch_content(
|
|
73
68
|
file_id=file_id,
|
|
@@ -109,19 +104,14 @@ class AsyncFetchClient:
|
|
|
109
104
|
Parameters
|
|
110
105
|
----------
|
|
111
106
|
file_id : str
|
|
112
|
-
Unique identifier for the file to fetch
|
|
113
107
|
|
|
114
108
|
file_type : str
|
|
115
|
-
Type of file (e.g., 'app', 'file', or other)
|
|
116
109
|
|
|
117
110
|
tenant_id : str
|
|
118
|
-
Tenant identifier for multi-tenancy
|
|
119
111
|
|
|
120
112
|
return_content : typing.Optional[bool]
|
|
121
|
-
Whether to return the file content along with the URL
|
|
122
113
|
|
|
123
114
|
sub_tenant_id : typing.Optional[str]
|
|
124
|
-
Sub-tenant identifier, defaults to tenant_id if not provided
|
|
125
115
|
|
|
126
116
|
request_options : typing.Optional[RequestOptions]
|
|
127
117
|
Request-specific configuration.
|
|
@@ -139,7 +129,7 @@ class AsyncFetchClient:
|
|
|
139
129
|
|
|
140
130
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
141
131
|
async def main() -> None:
|
|
142
|
-
await client.fetch.fetch_content(file_id='
|
|
132
|
+
await client.fetch.fetch_content(file_id='CortexDoc1234', file_type='<file_type>', tenant_id='tenant_1234', )
|
|
143
133
|
asyncio.run(main())
|
|
144
134
|
"""
|
|
145
135
|
_response = await self._raw_client.fetch_content(
|
|
@@ -40,19 +40,14 @@ class RawFetchClient:
|
|
|
40
40
|
Parameters
|
|
41
41
|
----------
|
|
42
42
|
file_id : str
|
|
43
|
-
Unique identifier for the file to fetch
|
|
44
43
|
|
|
45
44
|
file_type : str
|
|
46
|
-
Type of file (e.g., 'app', 'file', or other)
|
|
47
45
|
|
|
48
46
|
tenant_id : str
|
|
49
|
-
Tenant identifier for multi-tenancy
|
|
50
47
|
|
|
51
48
|
return_content : typing.Optional[bool]
|
|
52
|
-
Whether to return the file content along with the URL
|
|
53
49
|
|
|
54
50
|
sub_tenant_id : typing.Optional[str]
|
|
55
|
-
Sub-tenant identifier, defaults to tenant_id if not provided
|
|
56
51
|
|
|
57
52
|
request_options : typing.Optional[RequestOptions]
|
|
58
53
|
Request-specific configuration.
|
|
@@ -189,19 +184,14 @@ class AsyncRawFetchClient:
|
|
|
189
184
|
Parameters
|
|
190
185
|
----------
|
|
191
186
|
file_id : str
|
|
192
|
-
Unique identifier for the file to fetch
|
|
193
187
|
|
|
194
188
|
file_type : str
|
|
195
|
-
Type of file (e.g., 'app', 'file', or other)
|
|
196
189
|
|
|
197
190
|
tenant_id : str
|
|
198
|
-
Tenant identifier for multi-tenancy
|
|
199
191
|
|
|
200
192
|
return_content : typing.Optional[bool]
|
|
201
|
-
Whether to return the file content along with the URL
|
|
202
193
|
|
|
203
194
|
sub_tenant_id : typing.Optional[str]
|
|
204
|
-
Sub-tenant identifier, defaults to tenant_id if not provided
|
|
205
195
|
|
|
206
196
|
request_options : typing.Optional[RequestOptions]
|
|
207
197
|
Request-specific configuration.
|