usecortex-ai 0.2.1__py3-none-any.whl → 0.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- usecortex_ai/__init__.py +18 -3
- usecortex_ai/client.py +3 -0
- 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 +48 -78
- usecortex_ai/embeddings/raw_client.py +44 -74
- usecortex_ai/fetch/client.py +2 -2
- usecortex_ai/search/client.py +88 -84
- usecortex_ai/search/raw_client.py +82 -78
- usecortex_ai/sources/client.py +26 -157
- usecortex_ai/sources/raw_client.py +22 -501
- usecortex_ai/tenant/client.py +154 -6
- usecortex_ai/tenant/raw_client.py +502 -4
- usecortex_ai/types/__init__.py +16 -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 +23 -5
- usecortex_ai/types/processing_status.py +14 -3
- usecortex_ai/types/relations.py +9 -2
- usecortex_ai/types/retrieve_user_memory_response.py +32 -0
- usecortex_ai/types/search_chunk.py +54 -17
- usecortex_ai/types/single_upload_data.py +10 -2
- usecortex_ai/types/source.py +34 -15
- usecortex_ai/types/source_model.py +63 -14
- usecortex_ai/types/sub_tenant_ids_data.py +29 -5
- 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 +486 -111
- usecortex_ai/upload/raw_client.py +458 -103
- usecortex_ai/user/client.py +30 -10
- usecortex_ai/user/raw_client.py +22 -6
- usecortex_ai/user_memory/client.py +200 -56
- usecortex_ai/user_memory/raw_client.py +921 -94
- {usecortex_ai-0.2.1.dist-info → usecortex_ai-0.3.0.dist-info}/METADATA +1 -1
- usecortex_ai-0.3.0.dist-info/RECORD +101 -0
- usecortex_ai/types/source_content.py +0 -26
- usecortex_ai-0.2.1.dist-info/RECORD +0 -91
- {usecortex_ai-0.2.1.dist-info → usecortex_ai-0.3.0.dist-info}/WHEEL +0 -0
- {usecortex_ai-0.2.1.dist-info → usecortex_ai-0.3.0.dist-info}/licenses/LICENSE +0 -0
- {usecortex_ai-0.2.1.dist-info → usecortex_ai-0.3.0.dist-info}/top_level.txt +0 -0
usecortex_ai/upload/client.py
CHANGED
|
@@ -8,7 +8,6 @@ from ..core.request_options import RequestOptions
|
|
|
8
8
|
from ..types.app_sources_upload_data import AppSourcesUploadData
|
|
9
9
|
from ..types.batch_upload_data import BatchUploadData
|
|
10
10
|
from ..types.processing_status import ProcessingStatus
|
|
11
|
-
from ..types.relations import Relations
|
|
12
11
|
from ..types.single_upload_data import SingleUploadData
|
|
13
12
|
from ..types.source_model import SourceModel
|
|
14
13
|
from .raw_client import AsyncRawUploadClient, RawUploadClient
|
|
@@ -38,26 +37,44 @@ class UploadClient:
|
|
|
38
37
|
tenant_id: str,
|
|
39
38
|
files: typing.List[core.File],
|
|
40
39
|
sub_tenant_id: typing.Optional[str] = None,
|
|
40
|
+
file_ids: typing.Optional[str] = OMIT,
|
|
41
41
|
tenant_metadata: typing.Optional[str] = OMIT,
|
|
42
42
|
document_metadata: typing.Optional[str] = OMIT,
|
|
43
|
-
relations: typing.Optional[str] = OMIT,
|
|
44
43
|
request_options: typing.Optional[RequestOptions] = None,
|
|
45
44
|
) -> BatchUploadData:
|
|
46
45
|
"""
|
|
46
|
+
Upload multiple documents simultaneously for efficient bulk processing.
|
|
47
|
+
|
|
48
|
+
This endpoint allows you to upload several files at once, which is ideal for large document collections or periodic data imports. Each file gets processed asynchronously, and you can track the progress of individual files using their returned file IDs.
|
|
49
|
+
|
|
50
|
+
The system automatically handles file parsing, content extraction, and indexing across all uploaded documents. You'll receive confirmation once all files are queued for processing.
|
|
51
|
+
|
|
47
52
|
Parameters
|
|
48
53
|
----------
|
|
49
54
|
tenant_id : str
|
|
55
|
+
Unique identifier for the tenant/organization
|
|
50
56
|
|
|
51
57
|
files : typing.List[core.File]
|
|
52
58
|
See core.File for more documentation
|
|
53
59
|
|
|
54
60
|
sub_tenant_id : typing.Optional[str]
|
|
61
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
62
|
+
|
|
63
|
+
file_ids : typing.Optional[str]
|
|
64
|
+
Optional JSON string array of file IDs for the uploaded content. If not provided or empty, will be generated automatically.
|
|
55
65
|
|
|
56
66
|
tenant_metadata : typing.Optional[str]
|
|
67
|
+
JSON string containing tenant-level document metadata (e.g., department, compliance_tag)
|
|
68
|
+
|
|
69
|
+
Example: > "{"department":"Finance","compliance_tag":"GDPR"}"
|
|
70
|
+
|
|
57
71
|
|
|
58
72
|
document_metadata : typing.Optional[str]
|
|
73
|
+
JSON string containing document-specific metadata (e.g., title, author, file_id). If file_id is not provided, the system will generate an ID automatically.
|
|
74
|
+
|
|
75
|
+
Example: > "{"title":"Q1 Report.pdf","author":"Alice Smith","file_id":"custom_file_123"}"
|
|
76
|
+
|
|
59
77
|
|
|
60
|
-
relations : typing.Optional[str]
|
|
61
78
|
|
|
62
79
|
request_options : typing.Optional[RequestOptions]
|
|
63
80
|
Request-specific configuration.
|
|
@@ -72,15 +89,15 @@ class UploadClient:
|
|
|
72
89
|
from usecortex-ai import CortexAI
|
|
73
90
|
|
|
74
91
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
75
|
-
client.upload.batch_upload(tenant_id='
|
|
92
|
+
client.upload.batch_upload(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
|
|
76
93
|
"""
|
|
77
94
|
_response = self._raw_client.batch_upload(
|
|
78
95
|
tenant_id=tenant_id,
|
|
79
96
|
files=files,
|
|
80
97
|
sub_tenant_id=sub_tenant_id,
|
|
98
|
+
file_ids=file_ids,
|
|
81
99
|
tenant_metadata=tenant_metadata,
|
|
82
100
|
document_metadata=document_metadata,
|
|
83
|
-
relations=relations,
|
|
84
101
|
request_options=request_options,
|
|
85
102
|
)
|
|
86
103
|
return _response.data
|
|
@@ -94,26 +111,41 @@ class UploadClient:
|
|
|
94
111
|
source_ids: typing.Optional[typing.List[str]] = OMIT,
|
|
95
112
|
tenant_metadata: typing.Optional[str] = OMIT,
|
|
96
113
|
document_metadata: typing.Optional[str] = OMIT,
|
|
97
|
-
relations: typing.Optional[str] = OMIT,
|
|
98
114
|
request_options: typing.Optional[RequestOptions] = None,
|
|
99
115
|
) -> BatchUploadData:
|
|
100
116
|
"""
|
|
117
|
+
Update multiple existing documents with new content and metadata.
|
|
118
|
+
|
|
119
|
+
Use this endpoint when you need to replace or modify several documents that are already in your knowledge base. Each file must correspond to an existing source ID, ensuring that updates are applied to the correct documents.
|
|
120
|
+
|
|
121
|
+
The system processes updates asynchronously, allowing you to continue working while your documents are re-indexed. Track the progress using the returned file IDs to know when updates are complete.
|
|
122
|
+
|
|
101
123
|
Parameters
|
|
102
124
|
----------
|
|
103
125
|
tenant_id : str
|
|
126
|
+
Unique identifier for the tenant/organization
|
|
104
127
|
|
|
105
128
|
files : typing.List[core.File]
|
|
106
129
|
See core.File for more documentation
|
|
107
130
|
|
|
108
131
|
sub_tenant_id : typing.Optional[str]
|
|
132
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
109
133
|
|
|
110
134
|
source_ids : typing.Optional[typing.List[str]]
|
|
135
|
+
List of source IDs corresponding to the files being updated
|
|
111
136
|
|
|
112
137
|
tenant_metadata : typing.Optional[str]
|
|
138
|
+
JSON string containing tenant-level document metadata (e.g., department, compliance_tag)
|
|
139
|
+
|
|
140
|
+
Example: > "{"department":"Finance","compliance_tag":"GDPR"}"
|
|
141
|
+
|
|
113
142
|
|
|
114
143
|
document_metadata : typing.Optional[str]
|
|
144
|
+
JSON string containing document-specific metadata (e.g., title, author, file_id). If file_id is not provided, the system will generate an ID automatically.
|
|
145
|
+
|
|
146
|
+
Example: > "{"title":"Q1 Report.pdf","author":"Alice Smith","file_id":"custom_file_123"}"
|
|
147
|
+
|
|
115
148
|
|
|
116
|
-
relations : typing.Optional[str]
|
|
117
149
|
|
|
118
150
|
request_options : typing.Optional[RequestOptions]
|
|
119
151
|
Request-specific configuration.
|
|
@@ -128,7 +160,7 @@ class UploadClient:
|
|
|
128
160
|
from usecortex-ai import CortexAI
|
|
129
161
|
|
|
130
162
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
131
|
-
client.upload.batch_update(tenant_id='
|
|
163
|
+
client.upload.batch_update(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
|
|
132
164
|
"""
|
|
133
165
|
_response = self._raw_client.batch_update(
|
|
134
166
|
tenant_id=tenant_id,
|
|
@@ -137,7 +169,6 @@ class UploadClient:
|
|
|
137
169
|
source_ids=source_ids,
|
|
138
170
|
tenant_metadata=tenant_metadata,
|
|
139
171
|
document_metadata=document_metadata,
|
|
140
|
-
relations=relations,
|
|
141
172
|
request_options=request_options,
|
|
142
173
|
)
|
|
143
174
|
return _response.data
|
|
@@ -148,26 +179,44 @@ class UploadClient:
|
|
|
148
179
|
tenant_id: str,
|
|
149
180
|
file: core.File,
|
|
150
181
|
sub_tenant_id: typing.Optional[str] = None,
|
|
182
|
+
file_id: typing.Optional[str] = OMIT,
|
|
151
183
|
tenant_metadata: typing.Optional[str] = OMIT,
|
|
152
184
|
document_metadata: typing.Optional[str] = OMIT,
|
|
153
|
-
relations: typing.Optional[str] = OMIT,
|
|
154
185
|
request_options: typing.Optional[RequestOptions] = None,
|
|
155
186
|
) -> SingleUploadData:
|
|
156
187
|
"""
|
|
188
|
+
Upload a single document for processing and indexing into your knowledge base.
|
|
189
|
+
|
|
190
|
+
This endpoint accepts documents in various formats and processes them for search and retrieval. You can include custom metadata to help organize and categorize your content.
|
|
191
|
+
|
|
192
|
+
The system extracts text content, processes it asynchronously, and makes it available for search queries. You can track the processing status using the returned file ID.
|
|
193
|
+
|
|
157
194
|
Parameters
|
|
158
195
|
----------
|
|
159
196
|
tenant_id : str
|
|
197
|
+
Unique identifier for the tenant/organization
|
|
160
198
|
|
|
161
199
|
file : core.File
|
|
162
200
|
See core.File for more documentation
|
|
163
201
|
|
|
164
202
|
sub_tenant_id : typing.Optional[str]
|
|
203
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
204
|
+
|
|
205
|
+
file_id : typing.Optional[str]
|
|
206
|
+
Optional file ID for the uploaded content. If not provided, will be generated automatically.
|
|
165
207
|
|
|
166
208
|
tenant_metadata : typing.Optional[str]
|
|
209
|
+
JSON string containing tenant-level document metadata (e.g., department, compliance_tag)
|
|
210
|
+
|
|
211
|
+
Example: > "{"department":"Finance","compliance_tag":"GDPR"}"
|
|
212
|
+
|
|
167
213
|
|
|
168
214
|
document_metadata : typing.Optional[str]
|
|
215
|
+
JSON string containing document-specific metadata (e.g., title, author, file_id). If file_id is not provided, the system will generate an ID automatically.
|
|
216
|
+
|
|
217
|
+
Example: > "{"title":"Q1 Report.pdf","author":"Alice Smith","file_id":"custom_file_123"}"
|
|
218
|
+
|
|
169
219
|
|
|
170
|
-
relations : typing.Optional[str]
|
|
171
220
|
|
|
172
221
|
request_options : typing.Optional[RequestOptions]
|
|
173
222
|
Request-specific configuration.
|
|
@@ -182,15 +231,15 @@ class UploadClient:
|
|
|
182
231
|
from usecortex-ai import CortexAI
|
|
183
232
|
|
|
184
233
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
185
|
-
client.upload.upload_document(tenant_id='
|
|
234
|
+
client.upload.upload_document(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
|
|
186
235
|
"""
|
|
187
236
|
_response = self._raw_client.upload_document(
|
|
188
237
|
tenant_id=tenant_id,
|
|
189
238
|
file=file,
|
|
190
239
|
sub_tenant_id=sub_tenant_id,
|
|
240
|
+
file_id=file_id,
|
|
191
241
|
tenant_metadata=tenant_metadata,
|
|
192
242
|
document_metadata=document_metadata,
|
|
193
|
-
relations=relations,
|
|
194
243
|
request_options=request_options,
|
|
195
244
|
)
|
|
196
245
|
return _response.data
|
|
@@ -204,26 +253,41 @@ class UploadClient:
|
|
|
204
253
|
sub_tenant_id: typing.Optional[str] = None,
|
|
205
254
|
tenant_metadata: typing.Optional[str] = OMIT,
|
|
206
255
|
document_metadata: typing.Optional[str] = OMIT,
|
|
207
|
-
relations: typing.Optional[str] = OMIT,
|
|
208
256
|
request_options: typing.Optional[RequestOptions] = None,
|
|
209
257
|
) -> SingleUploadData:
|
|
210
258
|
"""
|
|
259
|
+
Replace an existing document with updated content.
|
|
260
|
+
|
|
261
|
+
This endpoint allows you to update a specific document that's already in your knowledge base. Provide the source ID of the document you want to modify, along with the new file content.
|
|
262
|
+
|
|
263
|
+
The system will process your update asynchronously and re-index the document with the new content. You can monitor the progress using the returned file ID.
|
|
264
|
+
|
|
211
265
|
Parameters
|
|
212
266
|
----------
|
|
213
267
|
source_id : str
|
|
268
|
+
The source ID of the document to update
|
|
214
269
|
|
|
215
270
|
tenant_id : str
|
|
271
|
+
Unique identifier for the tenant/organization
|
|
216
272
|
|
|
217
273
|
file : core.File
|
|
218
274
|
See core.File for more documentation
|
|
219
275
|
|
|
220
276
|
sub_tenant_id : typing.Optional[str]
|
|
277
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
221
278
|
|
|
222
279
|
tenant_metadata : typing.Optional[str]
|
|
280
|
+
JSON string containing tenant-level document metadata (e.g., department, compliance_tag)
|
|
281
|
+
|
|
282
|
+
Example: > "{"department":"Finance","compliance_tag":"GDPR"}"
|
|
283
|
+
|
|
223
284
|
|
|
224
285
|
document_metadata : typing.Optional[str]
|
|
286
|
+
JSON string containing document-specific metadata (e.g., title, author, file_id). If file_id is not provided, the system will generate an ID automatically.
|
|
287
|
+
|
|
288
|
+
Example: > "{"title":"Q1 Report.pdf","author":"Alice Smith","file_id":"custom_file_123"}"
|
|
289
|
+
|
|
225
290
|
|
|
226
|
-
relations : typing.Optional[str]
|
|
227
291
|
|
|
228
292
|
request_options : typing.Optional[RequestOptions]
|
|
229
293
|
Request-specific configuration.
|
|
@@ -238,7 +302,7 @@ class UploadClient:
|
|
|
238
302
|
from usecortex-ai import CortexAI
|
|
239
303
|
|
|
240
304
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
241
|
-
client.upload.update_document(source_id='
|
|
305
|
+
client.upload.update_document(source_id='CortexDoc1234', tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
|
|
242
306
|
"""
|
|
243
307
|
_response = self._raw_client.update_document(
|
|
244
308
|
source_id=source_id,
|
|
@@ -247,7 +311,6 @@ class UploadClient:
|
|
|
247
311
|
sub_tenant_id=sub_tenant_id,
|
|
248
312
|
tenant_metadata=tenant_metadata,
|
|
249
313
|
document_metadata=document_metadata,
|
|
250
|
-
relations=relations,
|
|
251
314
|
request_options=request_options,
|
|
252
315
|
)
|
|
253
316
|
return _response.data
|
|
@@ -261,13 +324,21 @@ class UploadClient:
|
|
|
261
324
|
request_options: typing.Optional[RequestOptions] = None,
|
|
262
325
|
) -> AppSourcesUploadData:
|
|
263
326
|
"""
|
|
327
|
+
Upload structured data from applications or APIs for indexing.
|
|
328
|
+
|
|
329
|
+
This endpoint is designed for importing data from applications. If you are specifically using Cortex to provide search to an application, you should prefer this endpoint. It accepts structured source objects and allows you to clearly define contents of attachments
|
|
330
|
+
|
|
331
|
+
The system processes each source asynchronously and makes the content available for search and retrieval. Use this when you need to integrate search and indexing from data in your applications into your knowledge base.
|
|
332
|
+
|
|
264
333
|
Parameters
|
|
265
334
|
----------
|
|
266
335
|
tenant_id : str
|
|
336
|
+
Unique identifier for the tenant/organization
|
|
267
337
|
|
|
268
338
|
request : typing.Sequence[SourceModel]
|
|
269
339
|
|
|
270
340
|
sub_tenant_id : typing.Optional[str]
|
|
341
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
271
342
|
|
|
272
343
|
request_options : typing.Optional[RequestOptions]
|
|
273
344
|
Request-specific configuration.
|
|
@@ -282,7 +353,7 @@ class UploadClient:
|
|
|
282
353
|
from usecortex-ai import CortexAI, SourceModel
|
|
283
354
|
|
|
284
355
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
285
|
-
client.upload.upload_app_sources(tenant_id='
|
|
356
|
+
client.upload.upload_app_sources(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', request=[SourceModel()], )
|
|
286
357
|
"""
|
|
287
358
|
_response = self._raw_client.upload_app_sources(
|
|
288
359
|
tenant_id=tenant_id, request=request, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
@@ -295,28 +366,42 @@ class UploadClient:
|
|
|
295
366
|
tenant_id: str,
|
|
296
367
|
content: str,
|
|
297
368
|
sub_tenant_id: typing.Optional[str] = None,
|
|
369
|
+
file_id: typing.Optional[str] = OMIT,
|
|
298
370
|
tenant_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
299
371
|
document_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
300
|
-
relations: typing.Optional[Relations] = OMIT,
|
|
301
372
|
request_options: typing.Optional[RequestOptions] = None,
|
|
302
373
|
) -> SingleUploadData:
|
|
303
374
|
"""
|
|
304
|
-
Upload markdown content
|
|
305
|
-
|
|
375
|
+
Upload text or markdown content directly for processing.
|
|
376
|
+
|
|
377
|
+
This endpoint accepts plain text or markdown-formatted content that you want to add to your knowledge base. It's perfect for notes, documentation, articles, or any text-based content you want to make searchable.
|
|
378
|
+
|
|
379
|
+
You can include custom metadata to help organize and categorize your content. You can track the processing status using the returned file ID.
|
|
306
380
|
|
|
307
381
|
Parameters
|
|
308
382
|
----------
|
|
309
383
|
tenant_id : str
|
|
384
|
+
Unique identifier for the tenant/organization
|
|
310
385
|
|
|
311
386
|
content : str
|
|
387
|
+
The text or markdown content to upload
|
|
312
388
|
|
|
313
389
|
sub_tenant_id : typing.Optional[str]
|
|
390
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
391
|
+
|
|
392
|
+
file_id : typing.Optional[str]
|
|
393
|
+
Optional file ID for the uploaded content. If not provided, will be generated automatically.
|
|
314
394
|
|
|
315
395
|
tenant_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
396
|
+
JSON string containing tenant-level document metadata (e.g., department, compliance_tag)
|
|
397
|
+
|
|
398
|
+
Example: > "{"department":"Finance","compliance_tag":"GDPR"}"
|
|
316
399
|
|
|
317
400
|
document_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
401
|
+
JSON string containing document-specific metadata (e.g., title, author, file_id). If file_id is not provided, the system will generate an ID automatically.
|
|
402
|
+
|
|
403
|
+
Example: > "{"title":"Q1 Report.pdf","author":"Alice Smith","file_id":"custom_file_123"}"
|
|
318
404
|
|
|
319
|
-
relations : typing.Optional[Relations]
|
|
320
405
|
|
|
321
406
|
request_options : typing.Optional[RequestOptions]
|
|
322
407
|
Request-specific configuration.
|
|
@@ -331,15 +416,15 @@ class UploadClient:
|
|
|
331
416
|
from usecortex-ai import CortexAI
|
|
332
417
|
|
|
333
418
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
334
|
-
client.upload.upload_markdown(tenant_id='
|
|
419
|
+
client.upload.upload_markdown(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', content='<content>', )
|
|
335
420
|
"""
|
|
336
421
|
_response = self._raw_client.upload_markdown(
|
|
337
422
|
tenant_id=tenant_id,
|
|
338
423
|
content=content,
|
|
339
424
|
sub_tenant_id=sub_tenant_id,
|
|
425
|
+
file_id=file_id,
|
|
340
426
|
tenant_metadata=tenant_metadata,
|
|
341
427
|
document_metadata=document_metadata,
|
|
342
|
-
relations=relations,
|
|
343
428
|
request_options=request_options,
|
|
344
429
|
)
|
|
345
430
|
return _response.data
|
|
@@ -350,28 +435,42 @@ class UploadClient:
|
|
|
350
435
|
tenant_id: str,
|
|
351
436
|
content: str,
|
|
352
437
|
sub_tenant_id: typing.Optional[str] = None,
|
|
438
|
+
file_id: typing.Optional[str] = OMIT,
|
|
353
439
|
tenant_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
354
440
|
document_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
355
|
-
relations: typing.Optional[Relations] = OMIT,
|
|
356
441
|
request_options: typing.Optional[RequestOptions] = None,
|
|
357
442
|
) -> SingleUploadData:
|
|
358
443
|
"""
|
|
359
|
-
Upload markdown content
|
|
360
|
-
|
|
444
|
+
Upload text or markdown content directly for processing.
|
|
445
|
+
|
|
446
|
+
This endpoint accepts plain text or markdown-formatted content that you want to add to your knowledge base. It's perfect for notes, documentation, articles, or any text-based content you want to make searchable.
|
|
447
|
+
|
|
448
|
+
You can include custom metadata to help organize and categorize your content. You can track the processing status using the returned file ID.
|
|
361
449
|
|
|
362
450
|
Parameters
|
|
363
451
|
----------
|
|
364
452
|
tenant_id : str
|
|
453
|
+
Unique identifier for the tenant/organization
|
|
365
454
|
|
|
366
455
|
content : str
|
|
456
|
+
The text or markdown content to upload
|
|
367
457
|
|
|
368
458
|
sub_tenant_id : typing.Optional[str]
|
|
459
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
460
|
+
|
|
461
|
+
file_id : typing.Optional[str]
|
|
462
|
+
Optional file ID for the uploaded content. If not provided, will be generated automatically.
|
|
369
463
|
|
|
370
464
|
tenant_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
465
|
+
JSON string containing tenant-level document metadata (e.g., department, compliance_tag)
|
|
466
|
+
|
|
467
|
+
Example: > "{"department":"Finance","compliance_tag":"GDPR"}"
|
|
371
468
|
|
|
372
469
|
document_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
470
|
+
JSON string containing document-specific metadata (e.g., title, author, file_id). If file_id is not provided, the system will generate an ID automatically.
|
|
471
|
+
|
|
472
|
+
Example: > "{"title":"Q1 Report.pdf","author":"Alice Smith","file_id":"custom_file_123"}"
|
|
373
473
|
|
|
374
|
-
relations : typing.Optional[Relations]
|
|
375
474
|
|
|
376
475
|
request_options : typing.Optional[RequestOptions]
|
|
377
476
|
Request-specific configuration.
|
|
@@ -386,15 +485,15 @@ class UploadClient:
|
|
|
386
485
|
from usecortex-ai import CortexAI
|
|
387
486
|
|
|
388
487
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
389
|
-
client.upload.upload_text(tenant_id='
|
|
488
|
+
client.upload.upload_text(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', content='<content>', )
|
|
390
489
|
"""
|
|
391
490
|
_response = self._raw_client.upload_text(
|
|
392
491
|
tenant_id=tenant_id,
|
|
393
492
|
content=content,
|
|
394
493
|
sub_tenant_id=sub_tenant_id,
|
|
494
|
+
file_id=file_id,
|
|
395
495
|
tenant_metadata=tenant_metadata,
|
|
396
496
|
document_metadata=document_metadata,
|
|
397
|
-
relations=relations,
|
|
398
497
|
request_options=request_options,
|
|
399
498
|
)
|
|
400
499
|
return _response.data
|
|
@@ -406,27 +505,45 @@ class UploadClient:
|
|
|
406
505
|
tenant_id: str,
|
|
407
506
|
content: str,
|
|
408
507
|
sub_tenant_id: typing.Optional[str] = None,
|
|
508
|
+
file_id: typing.Optional[str] = OMIT,
|
|
409
509
|
tenant_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
410
510
|
document_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
411
|
-
relations: typing.Optional[Relations] = OMIT,
|
|
412
511
|
request_options: typing.Optional[RequestOptions] = None,
|
|
413
512
|
) -> SingleUploadData:
|
|
414
513
|
"""
|
|
514
|
+
Update existing text or markdown content with new information.
|
|
515
|
+
|
|
516
|
+
This endpoint allows you to modify text or markdown content that's already in your knowledge base. Provide the source ID of the content you want to update, along with the new text.
|
|
517
|
+
|
|
518
|
+
The system will reprocess and re-index the updated content asynchronously. Use this when you need to correct information, add details, or refresh existing documentation.
|
|
519
|
+
|
|
415
520
|
Parameters
|
|
416
521
|
----------
|
|
417
522
|
source_id : str
|
|
523
|
+
The source ID of the document to update
|
|
418
524
|
|
|
419
525
|
tenant_id : str
|
|
526
|
+
Unique identifier for the tenant/organization
|
|
420
527
|
|
|
421
528
|
content : str
|
|
529
|
+
The text or markdown content to upload
|
|
422
530
|
|
|
423
531
|
sub_tenant_id : typing.Optional[str]
|
|
532
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
533
|
+
|
|
534
|
+
file_id : typing.Optional[str]
|
|
535
|
+
Optional file ID for the uploaded content. If not provided, will be generated automatically.
|
|
424
536
|
|
|
425
537
|
tenant_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
538
|
+
JSON string containing tenant-level document metadata (e.g., department, compliance_tag)
|
|
539
|
+
|
|
540
|
+
Example: > "{"department":"Finance","compliance_tag":"GDPR"}"
|
|
426
541
|
|
|
427
542
|
document_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
543
|
+
JSON string containing document-specific metadata (e.g., title, author, file_id). If file_id is not provided, the system will generate an ID automatically.
|
|
544
|
+
|
|
545
|
+
Example: > "{"title":"Q1 Report.pdf","author":"Alice Smith","file_id":"custom_file_123"}"
|
|
428
546
|
|
|
429
|
-
relations : typing.Optional[Relations]
|
|
430
547
|
|
|
431
548
|
request_options : typing.Optional[RequestOptions]
|
|
432
549
|
Request-specific configuration.
|
|
@@ -441,16 +558,16 @@ class UploadClient:
|
|
|
441
558
|
from usecortex-ai import CortexAI
|
|
442
559
|
|
|
443
560
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
444
|
-
client.upload.update_markdown(source_id='
|
|
561
|
+
client.upload.update_markdown(source_id='CortexDoc1234', tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', content='<content>', )
|
|
445
562
|
"""
|
|
446
563
|
_response = self._raw_client.update_markdown(
|
|
447
564
|
source_id=source_id,
|
|
448
565
|
tenant_id=tenant_id,
|
|
449
566
|
content=content,
|
|
450
567
|
sub_tenant_id=sub_tenant_id,
|
|
568
|
+
file_id=file_id,
|
|
451
569
|
tenant_metadata=tenant_metadata,
|
|
452
570
|
document_metadata=document_metadata,
|
|
453
|
-
relations=relations,
|
|
454
571
|
request_options=request_options,
|
|
455
572
|
)
|
|
456
573
|
return _response.data
|
|
@@ -462,27 +579,45 @@ class UploadClient:
|
|
|
462
579
|
tenant_id: str,
|
|
463
580
|
content: str,
|
|
464
581
|
sub_tenant_id: typing.Optional[str] = None,
|
|
582
|
+
file_id: typing.Optional[str] = OMIT,
|
|
465
583
|
tenant_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
466
584
|
document_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
467
|
-
relations: typing.Optional[Relations] = OMIT,
|
|
468
585
|
request_options: typing.Optional[RequestOptions] = None,
|
|
469
586
|
) -> SingleUploadData:
|
|
470
587
|
"""
|
|
588
|
+
Update existing text or markdown content with new information.
|
|
589
|
+
|
|
590
|
+
This endpoint allows you to modify text or markdown content that's already in your knowledge base. Provide the source ID of the content you want to update, along with the new text.
|
|
591
|
+
|
|
592
|
+
The system will reprocess and re-index the updated content asynchronously. Use this when you need to correct information, add details, or refresh existing documentation.
|
|
593
|
+
|
|
471
594
|
Parameters
|
|
472
595
|
----------
|
|
473
596
|
source_id : str
|
|
597
|
+
The source ID of the document to update
|
|
474
598
|
|
|
475
599
|
tenant_id : str
|
|
600
|
+
Unique identifier for the tenant/organization
|
|
476
601
|
|
|
477
602
|
content : str
|
|
603
|
+
The text or markdown content to upload
|
|
478
604
|
|
|
479
605
|
sub_tenant_id : typing.Optional[str]
|
|
606
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
607
|
+
|
|
608
|
+
file_id : typing.Optional[str]
|
|
609
|
+
Optional file ID for the uploaded content. If not provided, will be generated automatically.
|
|
480
610
|
|
|
481
611
|
tenant_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
612
|
+
JSON string containing tenant-level document metadata (e.g., department, compliance_tag)
|
|
613
|
+
|
|
614
|
+
Example: > "{"department":"Finance","compliance_tag":"GDPR"}"
|
|
482
615
|
|
|
483
616
|
document_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
617
|
+
JSON string containing document-specific metadata (e.g., title, author, file_id). If file_id is not provided, the system will generate an ID automatically.
|
|
618
|
+
|
|
619
|
+
Example: > "{"title":"Q1 Report.pdf","author":"Alice Smith","file_id":"custom_file_123"}"
|
|
484
620
|
|
|
485
|
-
relations : typing.Optional[Relations]
|
|
486
621
|
|
|
487
622
|
request_options : typing.Optional[RequestOptions]
|
|
488
623
|
Request-specific configuration.
|
|
@@ -497,16 +632,16 @@ class UploadClient:
|
|
|
497
632
|
from usecortex-ai import CortexAI
|
|
498
633
|
|
|
499
634
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
500
|
-
client.upload.update_text(source_id='
|
|
635
|
+
client.upload.update_text(source_id='CortexDoc1234', tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', content='<content>', )
|
|
501
636
|
"""
|
|
502
637
|
_response = self._raw_client.update_text(
|
|
503
638
|
source_id=source_id,
|
|
504
639
|
tenant_id=tenant_id,
|
|
505
640
|
content=content,
|
|
506
641
|
sub_tenant_id=sub_tenant_id,
|
|
642
|
+
file_id=file_id,
|
|
507
643
|
tenant_metadata=tenant_metadata,
|
|
508
644
|
document_metadata=document_metadata,
|
|
509
|
-
relations=relations,
|
|
510
645
|
request_options=request_options,
|
|
511
646
|
)
|
|
512
647
|
return _response.data
|
|
@@ -521,15 +656,25 @@ class UploadClient:
|
|
|
521
656
|
request_options: typing.Optional[RequestOptions] = None,
|
|
522
657
|
) -> SingleUploadData:
|
|
523
658
|
"""
|
|
659
|
+
Upload pre-computed embeddings for advanced similarity search.
|
|
660
|
+
|
|
661
|
+
This endpoint accepts vector embeddings that you've generated externally, allowing you to integrate with custom embedding models or existing vector databases. The embeddings represent chunks of your content as numerical vectors.
|
|
662
|
+
|
|
663
|
+
The system stores these embeddings and makes them available for semantic search and similarity matching. Use this when you want to leverage specialized embedding models or have existing vector representations.
|
|
664
|
+
|
|
524
665
|
Parameters
|
|
525
666
|
----------
|
|
526
667
|
tenant_id : str
|
|
668
|
+
Unique identifier for the tenant/organization
|
|
527
669
|
|
|
528
670
|
embeddings : typing.Sequence[typing.Sequence[float]]
|
|
671
|
+
The embeddings of source you want to index
|
|
529
672
|
|
|
530
673
|
sub_tenant_id : typing.Optional[str]
|
|
674
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
531
675
|
|
|
532
676
|
file_id : typing.Optional[str]
|
|
677
|
+
The Source ID of the target source you want to index
|
|
533
678
|
|
|
534
679
|
request_options : typing.Optional[RequestOptions]
|
|
535
680
|
Request-specific configuration.
|
|
@@ -544,7 +689,7 @@ class UploadClient:
|
|
|
544
689
|
from usecortex-ai import CortexAI
|
|
545
690
|
|
|
546
691
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
547
|
-
client.upload.upload_embeddings(tenant_id='
|
|
692
|
+
client.upload.upload_embeddings(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', embeddings=[[0.123413, 0.655367, 0.987654, 0.123456, 0.789012], [0.123413, 0.655367, 0.987654, 0.123456, 0.789012]], )
|
|
548
693
|
"""
|
|
549
694
|
_response = self._raw_client.upload_embeddings(
|
|
550
695
|
tenant_id=tenant_id,
|
|
@@ -564,13 +709,22 @@ class UploadClient:
|
|
|
564
709
|
request_options: typing.Optional[RequestOptions] = None,
|
|
565
710
|
) -> SingleUploadData:
|
|
566
711
|
"""
|
|
712
|
+
Update existing embeddings with new vector representations.
|
|
713
|
+
|
|
714
|
+
This endpoint allows you to modify embeddings that are already stored in your knowledge base. Provide updated vector representations for specific chunks of content, identified by their chunk IDs.
|
|
715
|
+
|
|
716
|
+
The system will replace the existing embeddings with your new ones, ensuring that similarity searches reflect the most current vector representations. Use this when you need to update embeddings due to model improvements or content changes.
|
|
717
|
+
|
|
567
718
|
Parameters
|
|
568
719
|
----------
|
|
569
720
|
tenant_id : str
|
|
721
|
+
Unique identifier for the tenant/organization
|
|
570
722
|
|
|
571
723
|
sub_tenant_id : typing.Optional[str]
|
|
724
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
572
725
|
|
|
573
726
|
embeddings : typing.Optional[typing.Dict[str, typing.Sequence[float]]]
|
|
727
|
+
The embeddings of source you want to index
|
|
574
728
|
|
|
575
729
|
request_options : typing.Optional[RequestOptions]
|
|
576
730
|
Request-specific configuration.
|
|
@@ -585,7 +739,7 @@ class UploadClient:
|
|
|
585
739
|
from usecortex-ai import CortexAI
|
|
586
740
|
|
|
587
741
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
588
|
-
client.upload.update_embeddings(tenant_id='
|
|
742
|
+
client.upload.update_embeddings(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
|
|
589
743
|
"""
|
|
590
744
|
_response = self._raw_client.update_embeddings(
|
|
591
745
|
tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, embeddings=embeddings, request_options=request_options
|
|
@@ -599,21 +753,28 @@ class UploadClient:
|
|
|
599
753
|
tenant_id: str,
|
|
600
754
|
sub_tenant_id: typing.Optional[str] = None,
|
|
601
755
|
file_id: typing.Optional[str] = None,
|
|
602
|
-
relations: typing.Optional[str] = OMIT,
|
|
603
756
|
request_options: typing.Optional[RequestOptions] = None,
|
|
604
757
|
) -> SingleUploadData:
|
|
605
758
|
"""
|
|
759
|
+
Extract and index content from web pages automatically.
|
|
760
|
+
|
|
761
|
+
This endpoint initiates web scraping for the specified URL, extracting the main content, text, and structure from the webpage. It's perfect for capturing articles, documentation, or any web content you want to include in your knowledge base.
|
|
762
|
+
|
|
763
|
+
The system processes the webpage content asynchronously, cleaning and structuring the information for optimal search and retrieval. Use this when you need to add web content without manual copying and pasting.
|
|
764
|
+
|
|
606
765
|
Parameters
|
|
607
766
|
----------
|
|
608
767
|
web_url : str
|
|
768
|
+
The URL of the webpage to scrape and index
|
|
609
769
|
|
|
610
770
|
tenant_id : str
|
|
771
|
+
Unique identifier for the tenant/organization
|
|
611
772
|
|
|
612
773
|
sub_tenant_id : typing.Optional[str]
|
|
774
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
613
775
|
|
|
614
776
|
file_id : typing.Optional[str]
|
|
615
|
-
|
|
616
|
-
relations : typing.Optional[str]
|
|
777
|
+
Optional custom file ID for the scraped content. If not provided, a unique ID will be generated
|
|
617
778
|
|
|
618
779
|
request_options : typing.Optional[RequestOptions]
|
|
619
780
|
Request-specific configuration.
|
|
@@ -628,14 +789,13 @@ class UploadClient:
|
|
|
628
789
|
from usecortex-ai import CortexAI
|
|
629
790
|
|
|
630
791
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
631
|
-
client.upload.scrape_webpage(web_url='
|
|
792
|
+
client.upload.scrape_webpage(web_url='https://www.usecortex.ai/', tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', file_id='CortexDoc1234', )
|
|
632
793
|
"""
|
|
633
794
|
_response = self._raw_client.scrape_webpage(
|
|
634
795
|
web_url=web_url,
|
|
635
796
|
tenant_id=tenant_id,
|
|
636
797
|
sub_tenant_id=sub_tenant_id,
|
|
637
798
|
file_id=file_id,
|
|
638
|
-
relations=relations,
|
|
639
799
|
request_options=request_options,
|
|
640
800
|
)
|
|
641
801
|
return _response.data
|
|
@@ -647,21 +807,28 @@ class UploadClient:
|
|
|
647
807
|
source_id: str,
|
|
648
808
|
tenant_id: str,
|
|
649
809
|
sub_tenant_id: typing.Optional[str] = None,
|
|
650
|
-
relations: typing.Optional[str] = OMIT,
|
|
651
810
|
request_options: typing.Optional[RequestOptions] = None,
|
|
652
811
|
) -> SingleUploadData:
|
|
653
812
|
"""
|
|
813
|
+
Update web scraping content with fresh data from the source URL.
|
|
814
|
+
|
|
815
|
+
This endpoint refreshes the content for an existing web scraping job. Provide the source ID of the webpage content you want to update, and the system will re-scrape the URL to capture any changes.
|
|
816
|
+
|
|
817
|
+
The updated content gets processed asynchronously and re-indexed in your knowledge base. Use this to keep web content current when the source pages are frequently updated.
|
|
818
|
+
|
|
654
819
|
Parameters
|
|
655
820
|
----------
|
|
656
821
|
web_url : str
|
|
822
|
+
The URL of the webpage to re-scrape
|
|
657
823
|
|
|
658
824
|
source_id : str
|
|
825
|
+
The file ID of the existing web scraping job to update
|
|
659
826
|
|
|
660
827
|
tenant_id : str
|
|
828
|
+
Unique identifier for the tenant/organization
|
|
661
829
|
|
|
662
830
|
sub_tenant_id : typing.Optional[str]
|
|
663
|
-
|
|
664
|
-
relations : typing.Optional[str]
|
|
831
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
665
832
|
|
|
666
833
|
request_options : typing.Optional[RequestOptions]
|
|
667
834
|
Request-specific configuration.
|
|
@@ -676,14 +843,13 @@ class UploadClient:
|
|
|
676
843
|
from usecortex-ai import CortexAI
|
|
677
844
|
|
|
678
845
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
679
|
-
client.upload.update_webpage(web_url='
|
|
846
|
+
client.upload.update_webpage(web_url='https://www.usecortex.ai/', source_id='CortexDoc1234', tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
|
|
680
847
|
"""
|
|
681
848
|
_response = self._raw_client.update_webpage(
|
|
682
849
|
web_url=web_url,
|
|
683
850
|
source_id=source_id,
|
|
684
851
|
tenant_id=tenant_id,
|
|
685
852
|
sub_tenant_id=sub_tenant_id,
|
|
686
|
-
relations=relations,
|
|
687
853
|
request_options=request_options,
|
|
688
854
|
)
|
|
689
855
|
return _response.data
|
|
@@ -697,13 +863,22 @@ class UploadClient:
|
|
|
697
863
|
request_options: typing.Optional[RequestOptions] = None,
|
|
698
864
|
) -> typing.Optional[typing.Any]:
|
|
699
865
|
"""
|
|
866
|
+
Remove documents and content from your knowledge base.
|
|
867
|
+
|
|
868
|
+
This endpoint permanently deletes the specified sources from your knowledge base. Once deleted, the content will no longer be available for search or retrieval.
|
|
869
|
+
|
|
870
|
+
Use this carefully as the action cannot be undone. The system will confirm successful deletion of each source ID you specify.
|
|
871
|
+
|
|
700
872
|
Parameters
|
|
701
873
|
----------
|
|
702
874
|
tenant_id : str
|
|
875
|
+
Unique identifier for the tenant/organization
|
|
703
876
|
|
|
704
877
|
source_ids : typing.Sequence[str]
|
|
878
|
+
List of source IDs to delete
|
|
705
879
|
|
|
706
880
|
sub_tenant_id : typing.Optional[str]
|
|
881
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
707
882
|
|
|
708
883
|
request_options : typing.Optional[RequestOptions]
|
|
709
884
|
Request-specific configuration.
|
|
@@ -718,7 +893,7 @@ class UploadClient:
|
|
|
718
893
|
from usecortex-ai import CortexAI
|
|
719
894
|
|
|
720
895
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
721
|
-
client.upload.delete_source(tenant_id='
|
|
896
|
+
client.upload.delete_source(tenant_id='tenant_1234', source_ids=['CortexDoc1234', 'CortexDoc4567'], )
|
|
722
897
|
"""
|
|
723
898
|
_response = self._raw_client.delete_source(
|
|
724
899
|
tenant_id=tenant_id, source_ids=source_ids, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
@@ -734,13 +909,22 @@ class UploadClient:
|
|
|
734
909
|
request_options: typing.Optional[RequestOptions] = None,
|
|
735
910
|
) -> typing.Optional[typing.Any]:
|
|
736
911
|
"""
|
|
912
|
+
Remove documents and content from your knowledge base.
|
|
913
|
+
|
|
914
|
+
This endpoint permanently deletes the specified sources from your knowledge base. Once deleted, the content will no longer be available for search or retrieval.
|
|
915
|
+
|
|
916
|
+
Use this carefully as the action cannot be undone. The system will confirm successful deletion of each source ID you specify.
|
|
917
|
+
|
|
737
918
|
Parameters
|
|
738
919
|
----------
|
|
739
920
|
tenant_id : str
|
|
921
|
+
Unique identifier for the tenant/organization
|
|
740
922
|
|
|
741
923
|
source_ids : typing.Sequence[str]
|
|
924
|
+
List of source IDs to delete
|
|
742
925
|
|
|
743
926
|
sub_tenant_id : typing.Optional[str]
|
|
927
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
744
928
|
|
|
745
929
|
request_options : typing.Optional[RequestOptions]
|
|
746
930
|
Request-specific configuration.
|
|
@@ -755,7 +939,7 @@ class UploadClient:
|
|
|
755
939
|
from usecortex-ai import CortexAI
|
|
756
940
|
|
|
757
941
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
758
|
-
client.upload.delete_memory(tenant_id='
|
|
942
|
+
client.upload.delete_memory(tenant_id='tenant_1234', source_ids=['CortexDoc1234', 'CortexDoc4567'], )
|
|
759
943
|
"""
|
|
760
944
|
_response = self._raw_client.delete_memory(
|
|
761
945
|
tenant_id=tenant_id, source_ids=source_ids, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
@@ -770,16 +954,19 @@ class UploadClient:
|
|
|
770
954
|
request_options: typing.Optional[RequestOptions] = None,
|
|
771
955
|
) -> ProcessingStatus:
|
|
772
956
|
"""
|
|
773
|
-
|
|
957
|
+
Check the current processing status of your uploaded content.
|
|
958
|
+
|
|
959
|
+
This endpoint allows you to monitor the progress of documents, text, or other content you've uploaded. Simply provide the file ID to see whether processing is complete, still in progress, or if any errors occurred.
|
|
774
960
|
|
|
775
|
-
|
|
776
|
-
ProcessingStatusResponse: Processing status information
|
|
961
|
+
Use this to determine when your content is ready for search and retrieval, or to troubleshoot any processing issues.
|
|
777
962
|
|
|
778
963
|
Parameters
|
|
779
964
|
----------
|
|
780
965
|
file_id : str
|
|
966
|
+
The file ID to check processing status for
|
|
781
967
|
|
|
782
968
|
tenant_id : typing.Optional[str]
|
|
969
|
+
Unique identifier for the tenant/organization
|
|
783
970
|
|
|
784
971
|
request_options : typing.Optional[RequestOptions]
|
|
785
972
|
Request-specific configuration.
|
|
@@ -794,7 +981,7 @@ class UploadClient:
|
|
|
794
981
|
from usecortex-ai import CortexAI
|
|
795
982
|
|
|
796
983
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
797
|
-
client.upload.verify_processing(file_id='
|
|
984
|
+
client.upload.verify_processing(file_id='CortexDoc1234', tenant_id='tenant_1234', )
|
|
798
985
|
"""
|
|
799
986
|
_response = self._raw_client.verify_processing(
|
|
800
987
|
file_id=file_id, tenant_id=tenant_id, request_options=request_options
|
|
@@ -823,26 +1010,44 @@ class AsyncUploadClient:
|
|
|
823
1010
|
tenant_id: str,
|
|
824
1011
|
files: typing.List[core.File],
|
|
825
1012
|
sub_tenant_id: typing.Optional[str] = None,
|
|
1013
|
+
file_ids: typing.Optional[str] = OMIT,
|
|
826
1014
|
tenant_metadata: typing.Optional[str] = OMIT,
|
|
827
1015
|
document_metadata: typing.Optional[str] = OMIT,
|
|
828
|
-
relations: typing.Optional[str] = OMIT,
|
|
829
1016
|
request_options: typing.Optional[RequestOptions] = None,
|
|
830
1017
|
) -> BatchUploadData:
|
|
831
1018
|
"""
|
|
1019
|
+
Upload multiple documents simultaneously for efficient bulk processing.
|
|
1020
|
+
|
|
1021
|
+
This endpoint allows you to upload several files at once, which is ideal for large document collections or periodic data imports. Each file gets processed asynchronously, and you can track the progress of individual files using their returned file IDs.
|
|
1022
|
+
|
|
1023
|
+
The system automatically handles file parsing, content extraction, and indexing across all uploaded documents. You'll receive confirmation once all files are queued for processing.
|
|
1024
|
+
|
|
832
1025
|
Parameters
|
|
833
1026
|
----------
|
|
834
1027
|
tenant_id : str
|
|
1028
|
+
Unique identifier for the tenant/organization
|
|
835
1029
|
|
|
836
1030
|
files : typing.List[core.File]
|
|
837
1031
|
See core.File for more documentation
|
|
838
1032
|
|
|
839
1033
|
sub_tenant_id : typing.Optional[str]
|
|
1034
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
1035
|
+
|
|
1036
|
+
file_ids : typing.Optional[str]
|
|
1037
|
+
Optional JSON string array of file IDs for the uploaded content. If not provided or empty, will be generated automatically.
|
|
840
1038
|
|
|
841
1039
|
tenant_metadata : typing.Optional[str]
|
|
1040
|
+
JSON string containing tenant-level document metadata (e.g., department, compliance_tag)
|
|
1041
|
+
|
|
1042
|
+
Example: > "{"department":"Finance","compliance_tag":"GDPR"}"
|
|
1043
|
+
|
|
842
1044
|
|
|
843
1045
|
document_metadata : typing.Optional[str]
|
|
1046
|
+
JSON string containing document-specific metadata (e.g., title, author, file_id). If file_id is not provided, the system will generate an ID automatically.
|
|
1047
|
+
|
|
1048
|
+
Example: > "{"title":"Q1 Report.pdf","author":"Alice Smith","file_id":"custom_file_123"}"
|
|
1049
|
+
|
|
844
1050
|
|
|
845
|
-
relations : typing.Optional[str]
|
|
846
1051
|
|
|
847
1052
|
request_options : typing.Optional[RequestOptions]
|
|
848
1053
|
Request-specific configuration.
|
|
@@ -860,16 +1065,16 @@ class AsyncUploadClient:
|
|
|
860
1065
|
|
|
861
1066
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
862
1067
|
async def main() -> None:
|
|
863
|
-
await client.upload.batch_upload(tenant_id='
|
|
1068
|
+
await client.upload.batch_upload(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
|
|
864
1069
|
asyncio.run(main())
|
|
865
1070
|
"""
|
|
866
1071
|
_response = await self._raw_client.batch_upload(
|
|
867
1072
|
tenant_id=tenant_id,
|
|
868
1073
|
files=files,
|
|
869
1074
|
sub_tenant_id=sub_tenant_id,
|
|
1075
|
+
file_ids=file_ids,
|
|
870
1076
|
tenant_metadata=tenant_metadata,
|
|
871
1077
|
document_metadata=document_metadata,
|
|
872
|
-
relations=relations,
|
|
873
1078
|
request_options=request_options,
|
|
874
1079
|
)
|
|
875
1080
|
return _response.data
|
|
@@ -883,26 +1088,41 @@ class AsyncUploadClient:
|
|
|
883
1088
|
source_ids: typing.Optional[typing.List[str]] = OMIT,
|
|
884
1089
|
tenant_metadata: typing.Optional[str] = OMIT,
|
|
885
1090
|
document_metadata: typing.Optional[str] = OMIT,
|
|
886
|
-
relations: typing.Optional[str] = OMIT,
|
|
887
1091
|
request_options: typing.Optional[RequestOptions] = None,
|
|
888
1092
|
) -> BatchUploadData:
|
|
889
1093
|
"""
|
|
1094
|
+
Update multiple existing documents with new content and metadata.
|
|
1095
|
+
|
|
1096
|
+
Use this endpoint when you need to replace or modify several documents that are already in your knowledge base. Each file must correspond to an existing source ID, ensuring that updates are applied to the correct documents.
|
|
1097
|
+
|
|
1098
|
+
The system processes updates asynchronously, allowing you to continue working while your documents are re-indexed. Track the progress using the returned file IDs to know when updates are complete.
|
|
1099
|
+
|
|
890
1100
|
Parameters
|
|
891
1101
|
----------
|
|
892
1102
|
tenant_id : str
|
|
1103
|
+
Unique identifier for the tenant/organization
|
|
893
1104
|
|
|
894
1105
|
files : typing.List[core.File]
|
|
895
1106
|
See core.File for more documentation
|
|
896
1107
|
|
|
897
1108
|
sub_tenant_id : typing.Optional[str]
|
|
1109
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
898
1110
|
|
|
899
1111
|
source_ids : typing.Optional[typing.List[str]]
|
|
1112
|
+
List of source IDs corresponding to the files being updated
|
|
900
1113
|
|
|
901
1114
|
tenant_metadata : typing.Optional[str]
|
|
1115
|
+
JSON string containing tenant-level document metadata (e.g., department, compliance_tag)
|
|
1116
|
+
|
|
1117
|
+
Example: > "{"department":"Finance","compliance_tag":"GDPR"}"
|
|
1118
|
+
|
|
902
1119
|
|
|
903
1120
|
document_metadata : typing.Optional[str]
|
|
1121
|
+
JSON string containing document-specific metadata (e.g., title, author, file_id). If file_id is not provided, the system will generate an ID automatically.
|
|
1122
|
+
|
|
1123
|
+
Example: > "{"title":"Q1 Report.pdf","author":"Alice Smith","file_id":"custom_file_123"}"
|
|
1124
|
+
|
|
904
1125
|
|
|
905
|
-
relations : typing.Optional[str]
|
|
906
1126
|
|
|
907
1127
|
request_options : typing.Optional[RequestOptions]
|
|
908
1128
|
Request-specific configuration.
|
|
@@ -920,7 +1140,7 @@ class AsyncUploadClient:
|
|
|
920
1140
|
|
|
921
1141
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
922
1142
|
async def main() -> None:
|
|
923
|
-
await client.upload.batch_update(tenant_id='
|
|
1143
|
+
await client.upload.batch_update(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
|
|
924
1144
|
asyncio.run(main())
|
|
925
1145
|
"""
|
|
926
1146
|
_response = await self._raw_client.batch_update(
|
|
@@ -930,7 +1150,6 @@ class AsyncUploadClient:
|
|
|
930
1150
|
source_ids=source_ids,
|
|
931
1151
|
tenant_metadata=tenant_metadata,
|
|
932
1152
|
document_metadata=document_metadata,
|
|
933
|
-
relations=relations,
|
|
934
1153
|
request_options=request_options,
|
|
935
1154
|
)
|
|
936
1155
|
return _response.data
|
|
@@ -941,26 +1160,44 @@ class AsyncUploadClient:
|
|
|
941
1160
|
tenant_id: str,
|
|
942
1161
|
file: core.File,
|
|
943
1162
|
sub_tenant_id: typing.Optional[str] = None,
|
|
1163
|
+
file_id: typing.Optional[str] = OMIT,
|
|
944
1164
|
tenant_metadata: typing.Optional[str] = OMIT,
|
|
945
1165
|
document_metadata: typing.Optional[str] = OMIT,
|
|
946
|
-
relations: typing.Optional[str] = OMIT,
|
|
947
1166
|
request_options: typing.Optional[RequestOptions] = None,
|
|
948
1167
|
) -> SingleUploadData:
|
|
949
1168
|
"""
|
|
1169
|
+
Upload a single document for processing and indexing into your knowledge base.
|
|
1170
|
+
|
|
1171
|
+
This endpoint accepts documents in various formats and processes them for search and retrieval. You can include custom metadata to help organize and categorize your content.
|
|
1172
|
+
|
|
1173
|
+
The system extracts text content, processes it asynchronously, and makes it available for search queries. You can track the processing status using the returned file ID.
|
|
1174
|
+
|
|
950
1175
|
Parameters
|
|
951
1176
|
----------
|
|
952
1177
|
tenant_id : str
|
|
1178
|
+
Unique identifier for the tenant/organization
|
|
953
1179
|
|
|
954
1180
|
file : core.File
|
|
955
1181
|
See core.File for more documentation
|
|
956
1182
|
|
|
957
1183
|
sub_tenant_id : typing.Optional[str]
|
|
1184
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
1185
|
+
|
|
1186
|
+
file_id : typing.Optional[str]
|
|
1187
|
+
Optional file ID for the uploaded content. If not provided, will be generated automatically.
|
|
958
1188
|
|
|
959
1189
|
tenant_metadata : typing.Optional[str]
|
|
1190
|
+
JSON string containing tenant-level document metadata (e.g., department, compliance_tag)
|
|
1191
|
+
|
|
1192
|
+
Example: > "{"department":"Finance","compliance_tag":"GDPR"}"
|
|
1193
|
+
|
|
960
1194
|
|
|
961
1195
|
document_metadata : typing.Optional[str]
|
|
1196
|
+
JSON string containing document-specific metadata (e.g., title, author, file_id). If file_id is not provided, the system will generate an ID automatically.
|
|
1197
|
+
|
|
1198
|
+
Example: > "{"title":"Q1 Report.pdf","author":"Alice Smith","file_id":"custom_file_123"}"
|
|
1199
|
+
|
|
962
1200
|
|
|
963
|
-
relations : typing.Optional[str]
|
|
964
1201
|
|
|
965
1202
|
request_options : typing.Optional[RequestOptions]
|
|
966
1203
|
Request-specific configuration.
|
|
@@ -978,16 +1215,16 @@ class AsyncUploadClient:
|
|
|
978
1215
|
|
|
979
1216
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
980
1217
|
async def main() -> None:
|
|
981
|
-
await client.upload.upload_document(tenant_id='
|
|
1218
|
+
await client.upload.upload_document(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
|
|
982
1219
|
asyncio.run(main())
|
|
983
1220
|
"""
|
|
984
1221
|
_response = await self._raw_client.upload_document(
|
|
985
1222
|
tenant_id=tenant_id,
|
|
986
1223
|
file=file,
|
|
987
1224
|
sub_tenant_id=sub_tenant_id,
|
|
1225
|
+
file_id=file_id,
|
|
988
1226
|
tenant_metadata=tenant_metadata,
|
|
989
1227
|
document_metadata=document_metadata,
|
|
990
|
-
relations=relations,
|
|
991
1228
|
request_options=request_options,
|
|
992
1229
|
)
|
|
993
1230
|
return _response.data
|
|
@@ -1001,26 +1238,41 @@ class AsyncUploadClient:
|
|
|
1001
1238
|
sub_tenant_id: typing.Optional[str] = None,
|
|
1002
1239
|
tenant_metadata: typing.Optional[str] = OMIT,
|
|
1003
1240
|
document_metadata: typing.Optional[str] = OMIT,
|
|
1004
|
-
relations: typing.Optional[str] = OMIT,
|
|
1005
1241
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1006
1242
|
) -> SingleUploadData:
|
|
1007
1243
|
"""
|
|
1244
|
+
Replace an existing document with updated content.
|
|
1245
|
+
|
|
1246
|
+
This endpoint allows you to update a specific document that's already in your knowledge base. Provide the source ID of the document you want to modify, along with the new file content.
|
|
1247
|
+
|
|
1248
|
+
The system will process your update asynchronously and re-index the document with the new content. You can monitor the progress using the returned file ID.
|
|
1249
|
+
|
|
1008
1250
|
Parameters
|
|
1009
1251
|
----------
|
|
1010
1252
|
source_id : str
|
|
1253
|
+
The source ID of the document to update
|
|
1011
1254
|
|
|
1012
1255
|
tenant_id : str
|
|
1256
|
+
Unique identifier for the tenant/organization
|
|
1013
1257
|
|
|
1014
1258
|
file : core.File
|
|
1015
1259
|
See core.File for more documentation
|
|
1016
1260
|
|
|
1017
1261
|
sub_tenant_id : typing.Optional[str]
|
|
1262
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
1018
1263
|
|
|
1019
1264
|
tenant_metadata : typing.Optional[str]
|
|
1265
|
+
JSON string containing tenant-level document metadata (e.g., department, compliance_tag)
|
|
1266
|
+
|
|
1267
|
+
Example: > "{"department":"Finance","compliance_tag":"GDPR"}"
|
|
1268
|
+
|
|
1020
1269
|
|
|
1021
1270
|
document_metadata : typing.Optional[str]
|
|
1271
|
+
JSON string containing document-specific metadata (e.g., title, author, file_id). If file_id is not provided, the system will generate an ID automatically.
|
|
1272
|
+
|
|
1273
|
+
Example: > "{"title":"Q1 Report.pdf","author":"Alice Smith","file_id":"custom_file_123"}"
|
|
1274
|
+
|
|
1022
1275
|
|
|
1023
|
-
relations : typing.Optional[str]
|
|
1024
1276
|
|
|
1025
1277
|
request_options : typing.Optional[RequestOptions]
|
|
1026
1278
|
Request-specific configuration.
|
|
@@ -1038,7 +1290,7 @@ class AsyncUploadClient:
|
|
|
1038
1290
|
|
|
1039
1291
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
1040
1292
|
async def main() -> None:
|
|
1041
|
-
await client.upload.update_document(source_id='
|
|
1293
|
+
await client.upload.update_document(source_id='CortexDoc1234', tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
|
|
1042
1294
|
asyncio.run(main())
|
|
1043
1295
|
"""
|
|
1044
1296
|
_response = await self._raw_client.update_document(
|
|
@@ -1048,7 +1300,6 @@ class AsyncUploadClient:
|
|
|
1048
1300
|
sub_tenant_id=sub_tenant_id,
|
|
1049
1301
|
tenant_metadata=tenant_metadata,
|
|
1050
1302
|
document_metadata=document_metadata,
|
|
1051
|
-
relations=relations,
|
|
1052
1303
|
request_options=request_options,
|
|
1053
1304
|
)
|
|
1054
1305
|
return _response.data
|
|
@@ -1062,13 +1313,21 @@ class AsyncUploadClient:
|
|
|
1062
1313
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1063
1314
|
) -> AppSourcesUploadData:
|
|
1064
1315
|
"""
|
|
1316
|
+
Upload structured data from applications or APIs for indexing.
|
|
1317
|
+
|
|
1318
|
+
This endpoint is designed for importing data from applications. If you are specifically using Cortex to provide search to an application, you should prefer this endpoint. It accepts structured source objects and allows you to clearly define contents of attachments
|
|
1319
|
+
|
|
1320
|
+
The system processes each source asynchronously and makes the content available for search and retrieval. Use this when you need to integrate search and indexing from data in your applications into your knowledge base.
|
|
1321
|
+
|
|
1065
1322
|
Parameters
|
|
1066
1323
|
----------
|
|
1067
1324
|
tenant_id : str
|
|
1325
|
+
Unique identifier for the tenant/organization
|
|
1068
1326
|
|
|
1069
1327
|
request : typing.Sequence[SourceModel]
|
|
1070
1328
|
|
|
1071
1329
|
sub_tenant_id : typing.Optional[str]
|
|
1330
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
1072
1331
|
|
|
1073
1332
|
request_options : typing.Optional[RequestOptions]
|
|
1074
1333
|
Request-specific configuration.
|
|
@@ -1086,7 +1345,7 @@ class AsyncUploadClient:
|
|
|
1086
1345
|
|
|
1087
1346
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
1088
1347
|
async def main() -> None:
|
|
1089
|
-
await client.upload.upload_app_sources(tenant_id='
|
|
1348
|
+
await client.upload.upload_app_sources(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', request=[SourceModel()], )
|
|
1090
1349
|
asyncio.run(main())
|
|
1091
1350
|
"""
|
|
1092
1351
|
_response = await self._raw_client.upload_app_sources(
|
|
@@ -1100,28 +1359,42 @@ class AsyncUploadClient:
|
|
|
1100
1359
|
tenant_id: str,
|
|
1101
1360
|
content: str,
|
|
1102
1361
|
sub_tenant_id: typing.Optional[str] = None,
|
|
1362
|
+
file_id: typing.Optional[str] = OMIT,
|
|
1103
1363
|
tenant_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
1104
1364
|
document_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
1105
|
-
relations: typing.Optional[Relations] = OMIT,
|
|
1106
1365
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1107
1366
|
) -> SingleUploadData:
|
|
1108
1367
|
"""
|
|
1109
|
-
Upload markdown content
|
|
1110
|
-
|
|
1368
|
+
Upload text or markdown content directly for processing.
|
|
1369
|
+
|
|
1370
|
+
This endpoint accepts plain text or markdown-formatted content that you want to add to your knowledge base. It's perfect for notes, documentation, articles, or any text-based content you want to make searchable.
|
|
1371
|
+
|
|
1372
|
+
You can include custom metadata to help organize and categorize your content. You can track the processing status using the returned file ID.
|
|
1111
1373
|
|
|
1112
1374
|
Parameters
|
|
1113
1375
|
----------
|
|
1114
1376
|
tenant_id : str
|
|
1377
|
+
Unique identifier for the tenant/organization
|
|
1115
1378
|
|
|
1116
1379
|
content : str
|
|
1380
|
+
The text or markdown content to upload
|
|
1117
1381
|
|
|
1118
1382
|
sub_tenant_id : typing.Optional[str]
|
|
1383
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
1384
|
+
|
|
1385
|
+
file_id : typing.Optional[str]
|
|
1386
|
+
Optional file ID for the uploaded content. If not provided, will be generated automatically.
|
|
1119
1387
|
|
|
1120
1388
|
tenant_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
1389
|
+
JSON string containing tenant-level document metadata (e.g., department, compliance_tag)
|
|
1390
|
+
|
|
1391
|
+
Example: > "{"department":"Finance","compliance_tag":"GDPR"}"
|
|
1121
1392
|
|
|
1122
1393
|
document_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
1394
|
+
JSON string containing document-specific metadata (e.g., title, author, file_id). If file_id is not provided, the system will generate an ID automatically.
|
|
1395
|
+
|
|
1396
|
+
Example: > "{"title":"Q1 Report.pdf","author":"Alice Smith","file_id":"custom_file_123"}"
|
|
1123
1397
|
|
|
1124
|
-
relations : typing.Optional[Relations]
|
|
1125
1398
|
|
|
1126
1399
|
request_options : typing.Optional[RequestOptions]
|
|
1127
1400
|
Request-specific configuration.
|
|
@@ -1139,16 +1412,16 @@ class AsyncUploadClient:
|
|
|
1139
1412
|
|
|
1140
1413
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
1141
1414
|
async def main() -> None:
|
|
1142
|
-
await client.upload.upload_markdown(tenant_id='
|
|
1415
|
+
await client.upload.upload_markdown(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', content='<content>', )
|
|
1143
1416
|
asyncio.run(main())
|
|
1144
1417
|
"""
|
|
1145
1418
|
_response = await self._raw_client.upload_markdown(
|
|
1146
1419
|
tenant_id=tenant_id,
|
|
1147
1420
|
content=content,
|
|
1148
1421
|
sub_tenant_id=sub_tenant_id,
|
|
1422
|
+
file_id=file_id,
|
|
1149
1423
|
tenant_metadata=tenant_metadata,
|
|
1150
1424
|
document_metadata=document_metadata,
|
|
1151
|
-
relations=relations,
|
|
1152
1425
|
request_options=request_options,
|
|
1153
1426
|
)
|
|
1154
1427
|
return _response.data
|
|
@@ -1159,28 +1432,42 @@ class AsyncUploadClient:
|
|
|
1159
1432
|
tenant_id: str,
|
|
1160
1433
|
content: str,
|
|
1161
1434
|
sub_tenant_id: typing.Optional[str] = None,
|
|
1435
|
+
file_id: typing.Optional[str] = OMIT,
|
|
1162
1436
|
tenant_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
1163
1437
|
document_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
1164
|
-
relations: typing.Optional[Relations] = OMIT,
|
|
1165
1438
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1166
1439
|
) -> SingleUploadData:
|
|
1167
1440
|
"""
|
|
1168
|
-
Upload markdown content
|
|
1169
|
-
|
|
1441
|
+
Upload text or markdown content directly for processing.
|
|
1442
|
+
|
|
1443
|
+
This endpoint accepts plain text or markdown-formatted content that you want to add to your knowledge base. It's perfect for notes, documentation, articles, or any text-based content you want to make searchable.
|
|
1444
|
+
|
|
1445
|
+
You can include custom metadata to help organize and categorize your content. You can track the processing status using the returned file ID.
|
|
1170
1446
|
|
|
1171
1447
|
Parameters
|
|
1172
1448
|
----------
|
|
1173
1449
|
tenant_id : str
|
|
1450
|
+
Unique identifier for the tenant/organization
|
|
1174
1451
|
|
|
1175
1452
|
content : str
|
|
1453
|
+
The text or markdown content to upload
|
|
1176
1454
|
|
|
1177
1455
|
sub_tenant_id : typing.Optional[str]
|
|
1456
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
1457
|
+
|
|
1458
|
+
file_id : typing.Optional[str]
|
|
1459
|
+
Optional file ID for the uploaded content. If not provided, will be generated automatically.
|
|
1178
1460
|
|
|
1179
1461
|
tenant_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
1462
|
+
JSON string containing tenant-level document metadata (e.g., department, compliance_tag)
|
|
1463
|
+
|
|
1464
|
+
Example: > "{"department":"Finance","compliance_tag":"GDPR"}"
|
|
1180
1465
|
|
|
1181
1466
|
document_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
1467
|
+
JSON string containing document-specific metadata (e.g., title, author, file_id). If file_id is not provided, the system will generate an ID automatically.
|
|
1468
|
+
|
|
1469
|
+
Example: > "{"title":"Q1 Report.pdf","author":"Alice Smith","file_id":"custom_file_123"}"
|
|
1182
1470
|
|
|
1183
|
-
relations : typing.Optional[Relations]
|
|
1184
1471
|
|
|
1185
1472
|
request_options : typing.Optional[RequestOptions]
|
|
1186
1473
|
Request-specific configuration.
|
|
@@ -1198,16 +1485,16 @@ class AsyncUploadClient:
|
|
|
1198
1485
|
|
|
1199
1486
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
1200
1487
|
async def main() -> None:
|
|
1201
|
-
await client.upload.upload_text(tenant_id='
|
|
1488
|
+
await client.upload.upload_text(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', content='<content>', )
|
|
1202
1489
|
asyncio.run(main())
|
|
1203
1490
|
"""
|
|
1204
1491
|
_response = await self._raw_client.upload_text(
|
|
1205
1492
|
tenant_id=tenant_id,
|
|
1206
1493
|
content=content,
|
|
1207
1494
|
sub_tenant_id=sub_tenant_id,
|
|
1495
|
+
file_id=file_id,
|
|
1208
1496
|
tenant_metadata=tenant_metadata,
|
|
1209
1497
|
document_metadata=document_metadata,
|
|
1210
|
-
relations=relations,
|
|
1211
1498
|
request_options=request_options,
|
|
1212
1499
|
)
|
|
1213
1500
|
return _response.data
|
|
@@ -1219,27 +1506,45 @@ class AsyncUploadClient:
|
|
|
1219
1506
|
tenant_id: str,
|
|
1220
1507
|
content: str,
|
|
1221
1508
|
sub_tenant_id: typing.Optional[str] = None,
|
|
1509
|
+
file_id: typing.Optional[str] = OMIT,
|
|
1222
1510
|
tenant_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
1223
1511
|
document_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
1224
|
-
relations: typing.Optional[Relations] = OMIT,
|
|
1225
1512
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1226
1513
|
) -> SingleUploadData:
|
|
1227
1514
|
"""
|
|
1515
|
+
Update existing text or markdown content with new information.
|
|
1516
|
+
|
|
1517
|
+
This endpoint allows you to modify text or markdown content that's already in your knowledge base. Provide the source ID of the content you want to update, along with the new text.
|
|
1518
|
+
|
|
1519
|
+
The system will reprocess and re-index the updated content asynchronously. Use this when you need to correct information, add details, or refresh existing documentation.
|
|
1520
|
+
|
|
1228
1521
|
Parameters
|
|
1229
1522
|
----------
|
|
1230
1523
|
source_id : str
|
|
1524
|
+
The source ID of the document to update
|
|
1231
1525
|
|
|
1232
1526
|
tenant_id : str
|
|
1527
|
+
Unique identifier for the tenant/organization
|
|
1233
1528
|
|
|
1234
1529
|
content : str
|
|
1530
|
+
The text or markdown content to upload
|
|
1235
1531
|
|
|
1236
1532
|
sub_tenant_id : typing.Optional[str]
|
|
1533
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
1534
|
+
|
|
1535
|
+
file_id : typing.Optional[str]
|
|
1536
|
+
Optional file ID for the uploaded content. If not provided, will be generated automatically.
|
|
1237
1537
|
|
|
1238
1538
|
tenant_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
1539
|
+
JSON string containing tenant-level document metadata (e.g., department, compliance_tag)
|
|
1540
|
+
|
|
1541
|
+
Example: > "{"department":"Finance","compliance_tag":"GDPR"}"
|
|
1239
1542
|
|
|
1240
1543
|
document_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
1544
|
+
JSON string containing document-specific metadata (e.g., title, author, file_id). If file_id is not provided, the system will generate an ID automatically.
|
|
1545
|
+
|
|
1546
|
+
Example: > "{"title":"Q1 Report.pdf","author":"Alice Smith","file_id":"custom_file_123"}"
|
|
1241
1547
|
|
|
1242
|
-
relations : typing.Optional[Relations]
|
|
1243
1548
|
|
|
1244
1549
|
request_options : typing.Optional[RequestOptions]
|
|
1245
1550
|
Request-specific configuration.
|
|
@@ -1257,7 +1562,7 @@ class AsyncUploadClient:
|
|
|
1257
1562
|
|
|
1258
1563
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
1259
1564
|
async def main() -> None:
|
|
1260
|
-
await client.upload.update_markdown(source_id='
|
|
1565
|
+
await client.upload.update_markdown(source_id='CortexDoc1234', tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', content='<content>', )
|
|
1261
1566
|
asyncio.run(main())
|
|
1262
1567
|
"""
|
|
1263
1568
|
_response = await self._raw_client.update_markdown(
|
|
@@ -1265,9 +1570,9 @@ class AsyncUploadClient:
|
|
|
1265
1570
|
tenant_id=tenant_id,
|
|
1266
1571
|
content=content,
|
|
1267
1572
|
sub_tenant_id=sub_tenant_id,
|
|
1573
|
+
file_id=file_id,
|
|
1268
1574
|
tenant_metadata=tenant_metadata,
|
|
1269
1575
|
document_metadata=document_metadata,
|
|
1270
|
-
relations=relations,
|
|
1271
1576
|
request_options=request_options,
|
|
1272
1577
|
)
|
|
1273
1578
|
return _response.data
|
|
@@ -1279,27 +1584,45 @@ class AsyncUploadClient:
|
|
|
1279
1584
|
tenant_id: str,
|
|
1280
1585
|
content: str,
|
|
1281
1586
|
sub_tenant_id: typing.Optional[str] = None,
|
|
1587
|
+
file_id: typing.Optional[str] = OMIT,
|
|
1282
1588
|
tenant_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
1283
1589
|
document_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
1284
|
-
relations: typing.Optional[Relations] = OMIT,
|
|
1285
1590
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1286
1591
|
) -> SingleUploadData:
|
|
1287
1592
|
"""
|
|
1593
|
+
Update existing text or markdown content with new information.
|
|
1594
|
+
|
|
1595
|
+
This endpoint allows you to modify text or markdown content that's already in your knowledge base. Provide the source ID of the content you want to update, along with the new text.
|
|
1596
|
+
|
|
1597
|
+
The system will reprocess and re-index the updated content asynchronously. Use this when you need to correct information, add details, or refresh existing documentation.
|
|
1598
|
+
|
|
1288
1599
|
Parameters
|
|
1289
1600
|
----------
|
|
1290
1601
|
source_id : str
|
|
1602
|
+
The source ID of the document to update
|
|
1291
1603
|
|
|
1292
1604
|
tenant_id : str
|
|
1605
|
+
Unique identifier for the tenant/organization
|
|
1293
1606
|
|
|
1294
1607
|
content : str
|
|
1608
|
+
The text or markdown content to upload
|
|
1295
1609
|
|
|
1296
1610
|
sub_tenant_id : typing.Optional[str]
|
|
1611
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
1612
|
+
|
|
1613
|
+
file_id : typing.Optional[str]
|
|
1614
|
+
Optional file ID for the uploaded content. If not provided, will be generated automatically.
|
|
1297
1615
|
|
|
1298
1616
|
tenant_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
1617
|
+
JSON string containing tenant-level document metadata (e.g., department, compliance_tag)
|
|
1618
|
+
|
|
1619
|
+
Example: > "{"department":"Finance","compliance_tag":"GDPR"}"
|
|
1299
1620
|
|
|
1300
1621
|
document_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
1622
|
+
JSON string containing document-specific metadata (e.g., title, author, file_id). If file_id is not provided, the system will generate an ID automatically.
|
|
1623
|
+
|
|
1624
|
+
Example: > "{"title":"Q1 Report.pdf","author":"Alice Smith","file_id":"custom_file_123"}"
|
|
1301
1625
|
|
|
1302
|
-
relations : typing.Optional[Relations]
|
|
1303
1626
|
|
|
1304
1627
|
request_options : typing.Optional[RequestOptions]
|
|
1305
1628
|
Request-specific configuration.
|
|
@@ -1317,7 +1640,7 @@ class AsyncUploadClient:
|
|
|
1317
1640
|
|
|
1318
1641
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
1319
1642
|
async def main() -> None:
|
|
1320
|
-
await client.upload.update_text(source_id='
|
|
1643
|
+
await client.upload.update_text(source_id='CortexDoc1234', tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', content='<content>', )
|
|
1321
1644
|
asyncio.run(main())
|
|
1322
1645
|
"""
|
|
1323
1646
|
_response = await self._raw_client.update_text(
|
|
@@ -1325,9 +1648,9 @@ class AsyncUploadClient:
|
|
|
1325
1648
|
tenant_id=tenant_id,
|
|
1326
1649
|
content=content,
|
|
1327
1650
|
sub_tenant_id=sub_tenant_id,
|
|
1651
|
+
file_id=file_id,
|
|
1328
1652
|
tenant_metadata=tenant_metadata,
|
|
1329
1653
|
document_metadata=document_metadata,
|
|
1330
|
-
relations=relations,
|
|
1331
1654
|
request_options=request_options,
|
|
1332
1655
|
)
|
|
1333
1656
|
return _response.data
|
|
@@ -1342,15 +1665,25 @@ class AsyncUploadClient:
|
|
|
1342
1665
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1343
1666
|
) -> SingleUploadData:
|
|
1344
1667
|
"""
|
|
1668
|
+
Upload pre-computed embeddings for advanced similarity search.
|
|
1669
|
+
|
|
1670
|
+
This endpoint accepts vector embeddings that you've generated externally, allowing you to integrate with custom embedding models or existing vector databases. The embeddings represent chunks of your content as numerical vectors.
|
|
1671
|
+
|
|
1672
|
+
The system stores these embeddings and makes them available for semantic search and similarity matching. Use this when you want to leverage specialized embedding models or have existing vector representations.
|
|
1673
|
+
|
|
1345
1674
|
Parameters
|
|
1346
1675
|
----------
|
|
1347
1676
|
tenant_id : str
|
|
1677
|
+
Unique identifier for the tenant/organization
|
|
1348
1678
|
|
|
1349
1679
|
embeddings : typing.Sequence[typing.Sequence[float]]
|
|
1680
|
+
The embeddings of source you want to index
|
|
1350
1681
|
|
|
1351
1682
|
sub_tenant_id : typing.Optional[str]
|
|
1683
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
1352
1684
|
|
|
1353
1685
|
file_id : typing.Optional[str]
|
|
1686
|
+
The Source ID of the target source you want to index
|
|
1354
1687
|
|
|
1355
1688
|
request_options : typing.Optional[RequestOptions]
|
|
1356
1689
|
Request-specific configuration.
|
|
@@ -1368,7 +1701,7 @@ class AsyncUploadClient:
|
|
|
1368
1701
|
|
|
1369
1702
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
1370
1703
|
async def main() -> None:
|
|
1371
|
-
await client.upload.upload_embeddings(tenant_id='
|
|
1704
|
+
await client.upload.upload_embeddings(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', embeddings=[[0.123413, 0.655367, 0.987654, 0.123456, 0.789012], [0.123413, 0.655367, 0.987654, 0.123456, 0.789012]], )
|
|
1372
1705
|
asyncio.run(main())
|
|
1373
1706
|
"""
|
|
1374
1707
|
_response = await self._raw_client.upload_embeddings(
|
|
@@ -1389,13 +1722,22 @@ class AsyncUploadClient:
|
|
|
1389
1722
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1390
1723
|
) -> SingleUploadData:
|
|
1391
1724
|
"""
|
|
1725
|
+
Update existing embeddings with new vector representations.
|
|
1726
|
+
|
|
1727
|
+
This endpoint allows you to modify embeddings that are already stored in your knowledge base. Provide updated vector representations for specific chunks of content, identified by their chunk IDs.
|
|
1728
|
+
|
|
1729
|
+
The system will replace the existing embeddings with your new ones, ensuring that similarity searches reflect the most current vector representations. Use this when you need to update embeddings due to model improvements or content changes.
|
|
1730
|
+
|
|
1392
1731
|
Parameters
|
|
1393
1732
|
----------
|
|
1394
1733
|
tenant_id : str
|
|
1734
|
+
Unique identifier for the tenant/organization
|
|
1395
1735
|
|
|
1396
1736
|
sub_tenant_id : typing.Optional[str]
|
|
1737
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
1397
1738
|
|
|
1398
1739
|
embeddings : typing.Optional[typing.Dict[str, typing.Sequence[float]]]
|
|
1740
|
+
The embeddings of source you want to index
|
|
1399
1741
|
|
|
1400
1742
|
request_options : typing.Optional[RequestOptions]
|
|
1401
1743
|
Request-specific configuration.
|
|
@@ -1413,7 +1755,7 @@ class AsyncUploadClient:
|
|
|
1413
1755
|
|
|
1414
1756
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
1415
1757
|
async def main() -> None:
|
|
1416
|
-
await client.upload.update_embeddings(tenant_id='
|
|
1758
|
+
await client.upload.update_embeddings(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
|
|
1417
1759
|
asyncio.run(main())
|
|
1418
1760
|
"""
|
|
1419
1761
|
_response = await self._raw_client.update_embeddings(
|
|
@@ -1428,21 +1770,28 @@ class AsyncUploadClient:
|
|
|
1428
1770
|
tenant_id: str,
|
|
1429
1771
|
sub_tenant_id: typing.Optional[str] = None,
|
|
1430
1772
|
file_id: typing.Optional[str] = None,
|
|
1431
|
-
relations: typing.Optional[str] = OMIT,
|
|
1432
1773
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1433
1774
|
) -> SingleUploadData:
|
|
1434
1775
|
"""
|
|
1776
|
+
Extract and index content from web pages automatically.
|
|
1777
|
+
|
|
1778
|
+
This endpoint initiates web scraping for the specified URL, extracting the main content, text, and structure from the webpage. It's perfect for capturing articles, documentation, or any web content you want to include in your knowledge base.
|
|
1779
|
+
|
|
1780
|
+
The system processes the webpage content asynchronously, cleaning and structuring the information for optimal search and retrieval. Use this when you need to add web content without manual copying and pasting.
|
|
1781
|
+
|
|
1435
1782
|
Parameters
|
|
1436
1783
|
----------
|
|
1437
1784
|
web_url : str
|
|
1785
|
+
The URL of the webpage to scrape and index
|
|
1438
1786
|
|
|
1439
1787
|
tenant_id : str
|
|
1788
|
+
Unique identifier for the tenant/organization
|
|
1440
1789
|
|
|
1441
1790
|
sub_tenant_id : typing.Optional[str]
|
|
1791
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
1442
1792
|
|
|
1443
1793
|
file_id : typing.Optional[str]
|
|
1444
|
-
|
|
1445
|
-
relations : typing.Optional[str]
|
|
1794
|
+
Optional custom file ID for the scraped content. If not provided, a unique ID will be generated
|
|
1446
1795
|
|
|
1447
1796
|
request_options : typing.Optional[RequestOptions]
|
|
1448
1797
|
Request-specific configuration.
|
|
@@ -1460,7 +1809,7 @@ class AsyncUploadClient:
|
|
|
1460
1809
|
|
|
1461
1810
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
1462
1811
|
async def main() -> None:
|
|
1463
|
-
await client.upload.scrape_webpage(web_url='
|
|
1812
|
+
await client.upload.scrape_webpage(web_url='https://www.usecortex.ai/', tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', file_id='CortexDoc1234', )
|
|
1464
1813
|
asyncio.run(main())
|
|
1465
1814
|
"""
|
|
1466
1815
|
_response = await self._raw_client.scrape_webpage(
|
|
@@ -1468,7 +1817,6 @@ class AsyncUploadClient:
|
|
|
1468
1817
|
tenant_id=tenant_id,
|
|
1469
1818
|
sub_tenant_id=sub_tenant_id,
|
|
1470
1819
|
file_id=file_id,
|
|
1471
|
-
relations=relations,
|
|
1472
1820
|
request_options=request_options,
|
|
1473
1821
|
)
|
|
1474
1822
|
return _response.data
|
|
@@ -1480,21 +1828,28 @@ class AsyncUploadClient:
|
|
|
1480
1828
|
source_id: str,
|
|
1481
1829
|
tenant_id: str,
|
|
1482
1830
|
sub_tenant_id: typing.Optional[str] = None,
|
|
1483
|
-
relations: typing.Optional[str] = OMIT,
|
|
1484
1831
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1485
1832
|
) -> SingleUploadData:
|
|
1486
1833
|
"""
|
|
1834
|
+
Update web scraping content with fresh data from the source URL.
|
|
1835
|
+
|
|
1836
|
+
This endpoint refreshes the content for an existing web scraping job. Provide the source ID of the webpage content you want to update, and the system will re-scrape the URL to capture any changes.
|
|
1837
|
+
|
|
1838
|
+
The updated content gets processed asynchronously and re-indexed in your knowledge base. Use this to keep web content current when the source pages are frequently updated.
|
|
1839
|
+
|
|
1487
1840
|
Parameters
|
|
1488
1841
|
----------
|
|
1489
1842
|
web_url : str
|
|
1843
|
+
The URL of the webpage to re-scrape
|
|
1490
1844
|
|
|
1491
1845
|
source_id : str
|
|
1846
|
+
The file ID of the existing web scraping job to update
|
|
1492
1847
|
|
|
1493
1848
|
tenant_id : str
|
|
1849
|
+
Unique identifier for the tenant/organization
|
|
1494
1850
|
|
|
1495
1851
|
sub_tenant_id : typing.Optional[str]
|
|
1496
|
-
|
|
1497
|
-
relations : typing.Optional[str]
|
|
1852
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
1498
1853
|
|
|
1499
1854
|
request_options : typing.Optional[RequestOptions]
|
|
1500
1855
|
Request-specific configuration.
|
|
@@ -1512,7 +1867,7 @@ class AsyncUploadClient:
|
|
|
1512
1867
|
|
|
1513
1868
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
1514
1869
|
async def main() -> None:
|
|
1515
|
-
await client.upload.update_webpage(web_url='
|
|
1870
|
+
await client.upload.update_webpage(web_url='https://www.usecortex.ai/', source_id='CortexDoc1234', tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
|
|
1516
1871
|
asyncio.run(main())
|
|
1517
1872
|
"""
|
|
1518
1873
|
_response = await self._raw_client.update_webpage(
|
|
@@ -1520,7 +1875,6 @@ class AsyncUploadClient:
|
|
|
1520
1875
|
source_id=source_id,
|
|
1521
1876
|
tenant_id=tenant_id,
|
|
1522
1877
|
sub_tenant_id=sub_tenant_id,
|
|
1523
|
-
relations=relations,
|
|
1524
1878
|
request_options=request_options,
|
|
1525
1879
|
)
|
|
1526
1880
|
return _response.data
|
|
@@ -1534,13 +1888,22 @@ class AsyncUploadClient:
|
|
|
1534
1888
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1535
1889
|
) -> typing.Optional[typing.Any]:
|
|
1536
1890
|
"""
|
|
1891
|
+
Remove documents and content from your knowledge base.
|
|
1892
|
+
|
|
1893
|
+
This endpoint permanently deletes the specified sources from your knowledge base. Once deleted, the content will no longer be available for search or retrieval.
|
|
1894
|
+
|
|
1895
|
+
Use this carefully as the action cannot be undone. The system will confirm successful deletion of each source ID you specify.
|
|
1896
|
+
|
|
1537
1897
|
Parameters
|
|
1538
1898
|
----------
|
|
1539
1899
|
tenant_id : str
|
|
1900
|
+
Unique identifier for the tenant/organization
|
|
1540
1901
|
|
|
1541
1902
|
source_ids : typing.Sequence[str]
|
|
1903
|
+
List of source IDs to delete
|
|
1542
1904
|
|
|
1543
1905
|
sub_tenant_id : typing.Optional[str]
|
|
1906
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
1544
1907
|
|
|
1545
1908
|
request_options : typing.Optional[RequestOptions]
|
|
1546
1909
|
Request-specific configuration.
|
|
@@ -1558,7 +1921,7 @@ class AsyncUploadClient:
|
|
|
1558
1921
|
|
|
1559
1922
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
1560
1923
|
async def main() -> None:
|
|
1561
|
-
await client.upload.delete_source(tenant_id='
|
|
1924
|
+
await client.upload.delete_source(tenant_id='tenant_1234', source_ids=['CortexDoc1234', 'CortexDoc4567'], )
|
|
1562
1925
|
asyncio.run(main())
|
|
1563
1926
|
"""
|
|
1564
1927
|
_response = await self._raw_client.delete_source(
|
|
@@ -1575,13 +1938,22 @@ class AsyncUploadClient:
|
|
|
1575
1938
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1576
1939
|
) -> typing.Optional[typing.Any]:
|
|
1577
1940
|
"""
|
|
1941
|
+
Remove documents and content from your knowledge base.
|
|
1942
|
+
|
|
1943
|
+
This endpoint permanently deletes the specified sources from your knowledge base. Once deleted, the content will no longer be available for search or retrieval.
|
|
1944
|
+
|
|
1945
|
+
Use this carefully as the action cannot be undone. The system will confirm successful deletion of each source ID you specify.
|
|
1946
|
+
|
|
1578
1947
|
Parameters
|
|
1579
1948
|
----------
|
|
1580
1949
|
tenant_id : str
|
|
1950
|
+
Unique identifier for the tenant/organization
|
|
1581
1951
|
|
|
1582
1952
|
source_ids : typing.Sequence[str]
|
|
1953
|
+
List of source IDs to delete
|
|
1583
1954
|
|
|
1584
1955
|
sub_tenant_id : typing.Optional[str]
|
|
1956
|
+
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
1585
1957
|
|
|
1586
1958
|
request_options : typing.Optional[RequestOptions]
|
|
1587
1959
|
Request-specific configuration.
|
|
@@ -1599,7 +1971,7 @@ class AsyncUploadClient:
|
|
|
1599
1971
|
|
|
1600
1972
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
1601
1973
|
async def main() -> None:
|
|
1602
|
-
await client.upload.delete_memory(tenant_id='
|
|
1974
|
+
await client.upload.delete_memory(tenant_id='tenant_1234', source_ids=['CortexDoc1234', 'CortexDoc4567'], )
|
|
1603
1975
|
asyncio.run(main())
|
|
1604
1976
|
"""
|
|
1605
1977
|
_response = await self._raw_client.delete_memory(
|
|
@@ -1615,16 +1987,19 @@ class AsyncUploadClient:
|
|
|
1615
1987
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1616
1988
|
) -> ProcessingStatus:
|
|
1617
1989
|
"""
|
|
1618
|
-
|
|
1990
|
+
Check the current processing status of your uploaded content.
|
|
1991
|
+
|
|
1992
|
+
This endpoint allows you to monitor the progress of documents, text, or other content you've uploaded. Simply provide the file ID to see whether processing is complete, still in progress, or if any errors occurred.
|
|
1619
1993
|
|
|
1620
|
-
|
|
1621
|
-
ProcessingStatusResponse: Processing status information
|
|
1994
|
+
Use this to determine when your content is ready for search and retrieval, or to troubleshoot any processing issues.
|
|
1622
1995
|
|
|
1623
1996
|
Parameters
|
|
1624
1997
|
----------
|
|
1625
1998
|
file_id : str
|
|
1999
|
+
The file ID to check processing status for
|
|
1626
2000
|
|
|
1627
2001
|
tenant_id : typing.Optional[str]
|
|
2002
|
+
Unique identifier for the tenant/organization
|
|
1628
2003
|
|
|
1629
2004
|
request_options : typing.Optional[RequestOptions]
|
|
1630
2005
|
Request-specific configuration.
|
|
@@ -1642,7 +2017,7 @@ class AsyncUploadClient:
|
|
|
1642
2017
|
|
|
1643
2018
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
1644
2019
|
async def main() -> None:
|
|
1645
|
-
await client.upload.verify_processing(file_id='
|
|
2020
|
+
await client.upload.verify_processing(file_id='CortexDoc1234', tenant_id='tenant_1234', )
|
|
1646
2021
|
asyncio.run(main())
|
|
1647
2022
|
"""
|
|
1648
2023
|
_response = await self._raw_client.verify_processing(
|