usecortex-ai 0.4.0__py3-none-any.whl → 0.5.1__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 +10 -4
- usecortex_ai/client.py +0 -4
- usecortex_ai/dashboard/client.py +2 -30
- usecortex_ai/dashboard/raw_client.py +0 -28
- usecortex_ai/embeddings/client.py +8 -58
- usecortex_ai/embeddings/raw_client.py +8 -58
- usecortex_ai/fetch/__init__.py +3 -0
- usecortex_ai/fetch/client.py +42 -165
- usecortex_ai/fetch/raw_client.py +38 -341
- usecortex_ai/fetch/types/__init__.py +7 -0
- usecortex_ai/fetch/types/fetch_list_knowledge_response.py +8 -0
- usecortex_ai/raw_client.py +0 -4
- usecortex_ai/search/client.py +40 -108
- usecortex_ai/search/raw_client.py +40 -108
- usecortex_ai/sources/client.py +2 -16
- usecortex_ai/sources/raw_client.py +2 -16
- usecortex_ai/tenant/client.py +4 -108
- usecortex_ai/tenant/raw_client.py +2 -106
- usecortex_ai/types/__init__.py +8 -2
- usecortex_ai/types/forceful_relations_payload.py +27 -0
- usecortex_ai/types/list_content_kind.py +5 -0
- usecortex_ai/types/list_user_memories_response.py +32 -0
- usecortex_ai/types/memory_item.py +7 -1
- usecortex_ai/types/retrieval_result.py +4 -0
- usecortex_ai/types/retrieve_mode.py +1 -1
- usecortex_ai/types/user_memory.py +31 -0
- usecortex_ai/types/vector_store_chunk.py +5 -0
- usecortex_ai/upload/__init__.py +0 -3
- usecortex_ai/upload/client.py +34 -204
- usecortex_ai/upload/raw_client.py +30 -382
- {usecortex_ai-0.4.0.dist-info → usecortex_ai-0.5.1.dist-info}/METADATA +1 -1
- {usecortex_ai-0.4.0.dist-info → usecortex_ai-0.5.1.dist-info}/RECORD +35 -32
- {usecortex_ai-0.4.0.dist-info → usecortex_ai-0.5.1.dist-info}/WHEEL +1 -1
- usecortex_ai/types/app_sources_upload_data.py +0 -39
- usecortex_ai/upload/types/__init__.py +0 -7
- usecortex_ai/upload/types/body_upload_app_ingestion_upload_app_post_app_sources.py +0 -7
- {usecortex_ai-0.4.0.dist-info → usecortex_ai-0.5.1.dist-info}/licenses/LICENSE +0 -0
- {usecortex_ai-0.4.0.dist-info → usecortex_ai-0.5.1.dist-info}/top_level.txt +0 -0
|
@@ -18,12 +18,10 @@ from ..errors.service_unavailable_error import ServiceUnavailableError
|
|
|
18
18
|
from ..errors.unauthorized_error import UnauthorizedError
|
|
19
19
|
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
|
20
20
|
from ..types.add_memory_response import AddMemoryResponse
|
|
21
|
-
from ..types.app_sources_upload_data import AppSourcesUploadData
|
|
22
21
|
from ..types.delete_user_memory_response import DeleteUserMemoryResponse
|
|
23
22
|
from ..types.memory_item import MemoryItem
|
|
24
23
|
from ..types.processing_status import ProcessingStatus
|
|
25
24
|
from ..types.source_upload_response import SourceUploadResponse
|
|
26
|
-
from .types.body_upload_app_ingestion_upload_app_post_app_sources import BodyUploadAppIngestionUploadAppPostAppSources
|
|
27
25
|
|
|
28
26
|
# this is used as the default value for optional parameters
|
|
29
27
|
OMIT = typing.cast(typing.Any, ...)
|
|
@@ -33,27 +31,20 @@ class RawUploadClient:
|
|
|
33
31
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
34
32
|
self._client_wrapper = client_wrapper
|
|
35
33
|
|
|
36
|
-
def
|
|
34
|
+
def upload_knowledge(
|
|
37
35
|
self,
|
|
38
36
|
*,
|
|
39
|
-
files: typing.List[core.File],
|
|
40
37
|
tenant_id: str,
|
|
41
38
|
sub_tenant_id: typing.Optional[str] = OMIT,
|
|
42
39
|
upsert: typing.Optional[bool] = OMIT,
|
|
40
|
+
files: typing.Optional[typing.List[core.File]] = OMIT,
|
|
43
41
|
file_metadata: typing.Optional[str] = OMIT,
|
|
42
|
+
app_sources: typing.Optional[str] = OMIT,
|
|
44
43
|
request_options: typing.Optional[RequestOptions] = None,
|
|
45
44
|
) -> HttpResponse[SourceUploadResponse]:
|
|
46
45
|
"""
|
|
47
|
-
Upload one or more documents for ingestion.
|
|
48
|
-
Supports both single and batch uploads.
|
|
49
|
-
For single file: send one file with the 'files' field.
|
|
50
|
-
For batch: send multiple files with the 'files' field (FastAPI will parse as list).
|
|
51
|
-
|
|
52
46
|
Parameters
|
|
53
47
|
----------
|
|
54
|
-
files : typing.List[core.File]
|
|
55
|
-
See core.File for more documentation
|
|
56
|
-
|
|
57
48
|
tenant_id : str
|
|
58
49
|
Unique identifier for the tenant/organization
|
|
59
50
|
|
|
@@ -61,9 +52,16 @@ class RawUploadClient:
|
|
|
61
52
|
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
53
|
|
|
63
54
|
upsert : typing.Optional[bool]
|
|
55
|
+
If true, update existing sources with the same id.
|
|
56
|
+
|
|
57
|
+
files : typing.Optional[typing.List[core.File]]
|
|
58
|
+
See core.File for more documentation
|
|
64
59
|
|
|
65
60
|
file_metadata : typing.Optional[str]
|
|
66
|
-
JSON
|
|
61
|
+
JSON array of file metadata objects; length must match files when provided.
|
|
62
|
+
|
|
63
|
+
app_sources : typing.Optional[str]
|
|
64
|
+
JSON: single source object or array of app-generated sources to index. Omit when only uploading files.
|
|
67
65
|
|
|
68
66
|
request_options : typing.Optional[RequestOptions]
|
|
69
67
|
Request-specific configuration.
|
|
@@ -74,16 +72,17 @@ class RawUploadClient:
|
|
|
74
72
|
Successful Response
|
|
75
73
|
"""
|
|
76
74
|
_response = self._client_wrapper.httpx_client.request(
|
|
77
|
-
"ingestion/
|
|
75
|
+
"ingestion/upload_knowledge",
|
|
78
76
|
method="POST",
|
|
79
77
|
data={
|
|
80
78
|
"tenant_id": tenant_id,
|
|
81
79
|
"sub_tenant_id": sub_tenant_id,
|
|
82
80
|
"upsert": upsert,
|
|
83
81
|
"file_metadata": file_metadata,
|
|
82
|
+
"app_sources": app_sources,
|
|
84
83
|
},
|
|
85
84
|
files={
|
|
86
|
-
"files": files,
|
|
85
|
+
**({"files": files} if files is not None else {}),
|
|
87
86
|
},
|
|
88
87
|
request_options=request_options,
|
|
89
88
|
omit=OMIT,
|
|
@@ -181,150 +180,6 @@ class RawUploadClient:
|
|
|
181
180
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
182
181
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
183
182
|
|
|
184
|
-
def upload_app_sources(
|
|
185
|
-
self,
|
|
186
|
-
*,
|
|
187
|
-
app_sources: BodyUploadAppIngestionUploadAppPostAppSources,
|
|
188
|
-
tenant_id: str,
|
|
189
|
-
sub_tenant_id: typing.Optional[str] = OMIT,
|
|
190
|
-
upsert: typing.Optional[bool] = OMIT,
|
|
191
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
192
|
-
) -> HttpResponse[AppSourcesUploadData]:
|
|
193
|
-
"""
|
|
194
|
-
Upload structured sources generated by first-party or third-party apps.
|
|
195
|
-
Supports both single and batch uploads.
|
|
196
|
-
|
|
197
|
-
Parameters
|
|
198
|
-
----------
|
|
199
|
-
app_sources : BodyUploadAppIngestionUploadAppPostAppSources
|
|
200
|
-
Single source object or list of structured source objects containing app-generated data to be indexed
|
|
201
|
-
|
|
202
|
-
tenant_id : str
|
|
203
|
-
Unique identifier for the tenant/organization
|
|
204
|
-
|
|
205
|
-
sub_tenant_id : typing.Optional[str]
|
|
206
|
-
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
207
|
-
|
|
208
|
-
upsert : typing.Optional[bool]
|
|
209
|
-
If true, update existing sources with the same source_id. Defaults to True.
|
|
210
|
-
|
|
211
|
-
request_options : typing.Optional[RequestOptions]
|
|
212
|
-
Request-specific configuration.
|
|
213
|
-
|
|
214
|
-
Returns
|
|
215
|
-
-------
|
|
216
|
-
HttpResponse[AppSourcesUploadData]
|
|
217
|
-
Successful Response
|
|
218
|
-
"""
|
|
219
|
-
_response = self._client_wrapper.httpx_client.request(
|
|
220
|
-
"ingestion/upload-app",
|
|
221
|
-
method="POST",
|
|
222
|
-
json={
|
|
223
|
-
"app_sources": convert_and_respect_annotation_metadata(
|
|
224
|
-
object_=app_sources, annotation=BodyUploadAppIngestionUploadAppPostAppSources, direction="write"
|
|
225
|
-
),
|
|
226
|
-
"tenant_id": tenant_id,
|
|
227
|
-
"sub_tenant_id": sub_tenant_id,
|
|
228
|
-
"upsert": upsert,
|
|
229
|
-
},
|
|
230
|
-
headers={
|
|
231
|
-
"content-type": "application/json",
|
|
232
|
-
},
|
|
233
|
-
request_options=request_options,
|
|
234
|
-
omit=OMIT,
|
|
235
|
-
)
|
|
236
|
-
try:
|
|
237
|
-
if 200 <= _response.status_code < 300:
|
|
238
|
-
_data = typing.cast(
|
|
239
|
-
AppSourcesUploadData,
|
|
240
|
-
parse_obj_as(
|
|
241
|
-
type_=AppSourcesUploadData, # type: ignore
|
|
242
|
-
object_=_response.json(),
|
|
243
|
-
),
|
|
244
|
-
)
|
|
245
|
-
return HttpResponse(response=_response, data=_data)
|
|
246
|
-
if _response.status_code == 400:
|
|
247
|
-
raise BadRequestError(
|
|
248
|
-
headers=dict(_response.headers),
|
|
249
|
-
body=typing.cast(
|
|
250
|
-
typing.Optional[typing.Any],
|
|
251
|
-
parse_obj_as(
|
|
252
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
|
253
|
-
object_=_response.json(),
|
|
254
|
-
),
|
|
255
|
-
),
|
|
256
|
-
)
|
|
257
|
-
if _response.status_code == 401:
|
|
258
|
-
raise UnauthorizedError(
|
|
259
|
-
headers=dict(_response.headers),
|
|
260
|
-
body=typing.cast(
|
|
261
|
-
typing.Optional[typing.Any],
|
|
262
|
-
parse_obj_as(
|
|
263
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
|
264
|
-
object_=_response.json(),
|
|
265
|
-
),
|
|
266
|
-
),
|
|
267
|
-
)
|
|
268
|
-
if _response.status_code == 403:
|
|
269
|
-
raise ForbiddenError(
|
|
270
|
-
headers=dict(_response.headers),
|
|
271
|
-
body=typing.cast(
|
|
272
|
-
typing.Optional[typing.Any],
|
|
273
|
-
parse_obj_as(
|
|
274
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
|
275
|
-
object_=_response.json(),
|
|
276
|
-
),
|
|
277
|
-
),
|
|
278
|
-
)
|
|
279
|
-
if _response.status_code == 404:
|
|
280
|
-
raise NotFoundError(
|
|
281
|
-
headers=dict(_response.headers),
|
|
282
|
-
body=typing.cast(
|
|
283
|
-
typing.Optional[typing.Any],
|
|
284
|
-
parse_obj_as(
|
|
285
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
|
286
|
-
object_=_response.json(),
|
|
287
|
-
),
|
|
288
|
-
),
|
|
289
|
-
)
|
|
290
|
-
if _response.status_code == 422:
|
|
291
|
-
raise UnprocessableEntityError(
|
|
292
|
-
headers=dict(_response.headers),
|
|
293
|
-
body=typing.cast(
|
|
294
|
-
typing.Optional[typing.Any],
|
|
295
|
-
parse_obj_as(
|
|
296
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
|
297
|
-
object_=_response.json(),
|
|
298
|
-
),
|
|
299
|
-
),
|
|
300
|
-
)
|
|
301
|
-
if _response.status_code == 500:
|
|
302
|
-
raise InternalServerError(
|
|
303
|
-
headers=dict(_response.headers),
|
|
304
|
-
body=typing.cast(
|
|
305
|
-
typing.Optional[typing.Any],
|
|
306
|
-
parse_obj_as(
|
|
307
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
|
308
|
-
object_=_response.json(),
|
|
309
|
-
),
|
|
310
|
-
),
|
|
311
|
-
)
|
|
312
|
-
if _response.status_code == 503:
|
|
313
|
-
raise ServiceUnavailableError(
|
|
314
|
-
headers=dict(_response.headers),
|
|
315
|
-
body=typing.cast(
|
|
316
|
-
typing.Optional[typing.Any],
|
|
317
|
-
parse_obj_as(
|
|
318
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
|
319
|
-
object_=_response.json(),
|
|
320
|
-
),
|
|
321
|
-
),
|
|
322
|
-
)
|
|
323
|
-
_response_json = _response.json()
|
|
324
|
-
except JSONDecodeError:
|
|
325
|
-
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
326
|
-
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
327
|
-
|
|
328
183
|
def verify_processing(
|
|
329
184
|
self,
|
|
330
185
|
*,
|
|
@@ -334,12 +189,6 @@ class RawUploadClient:
|
|
|
334
189
|
request_options: typing.Optional[RequestOptions] = None,
|
|
335
190
|
) -> HttpResponse[ProcessingStatus]:
|
|
336
191
|
"""
|
|
337
|
-
Check the current processing status of your uploaded content.
|
|
338
|
-
|
|
339
|
-
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.
|
|
340
|
-
|
|
341
|
-
Use this to determine when your content is ready for search and retrieval, or to troubleshoot any processing issues.
|
|
342
|
-
|
|
343
192
|
Parameters
|
|
344
193
|
----------
|
|
345
194
|
file_id : str
|
|
@@ -360,7 +209,7 @@ class RawUploadClient:
|
|
|
360
209
|
Successful Response
|
|
361
210
|
"""
|
|
362
211
|
_response = self._client_wrapper.httpx_client.request(
|
|
363
|
-
"ingestion/
|
|
212
|
+
"ingestion/verify_processing",
|
|
364
213
|
method="POST",
|
|
365
214
|
params={
|
|
366
215
|
"file_id": file_id,
|
|
@@ -471,24 +320,6 @@ class RawUploadClient:
|
|
|
471
320
|
request_options: typing.Optional[RequestOptions] = None,
|
|
472
321
|
) -> HttpResponse[AddMemoryResponse]:
|
|
473
322
|
"""
|
|
474
|
-
Add memories for indexing and retrieval.
|
|
475
|
-
|
|
476
|
-
This API provides a unified entry point for ingesting various types of content:
|
|
477
|
-
|
|
478
|
-
**Content Types Supported:**
|
|
479
|
-
- Raw text content (`text` field)
|
|
480
|
-
- Markdown formatted content (`text` + `is_markdown=true`)
|
|
481
|
-
- User/assistant conversation pairs (`user_assistant_pairs` field)
|
|
482
|
-
|
|
483
|
-
**Key Features:**
|
|
484
|
-
- **Inference Mode (`infer=true`)**: When enabled, the system extracts additional
|
|
485
|
-
insights and implicit information from your content. Useful for conversation
|
|
486
|
-
analysis and knowledge extraction.
|
|
487
|
-
- **Direct Mode (`infer=false`)**: Content is chunked and indexed as-is without
|
|
488
|
-
additional processing.
|
|
489
|
-
|
|
490
|
-
Use `/ingestion/verify-processing` endpoint to check the processing status.
|
|
491
|
-
|
|
492
323
|
Parameters
|
|
493
324
|
----------
|
|
494
325
|
memories : typing.Sequence[MemoryItem]
|
|
@@ -629,14 +460,6 @@ class RawUploadClient:
|
|
|
629
460
|
request_options: typing.Optional[RequestOptions] = None,
|
|
630
461
|
) -> HttpResponse[DeleteUserMemoryResponse]:
|
|
631
462
|
"""
|
|
632
|
-
Permanently remove a specific memory from storage.
|
|
633
|
-
|
|
634
|
-
This API allows you to delete a memory by its unique identifier.
|
|
635
|
-
Once deleted, the memory cannot be recovered, so use this operation carefully.
|
|
636
|
-
|
|
637
|
-
The memory will be removed from your tenant's storage and will no longer
|
|
638
|
-
appear in search results or memory listings.
|
|
639
|
-
|
|
640
463
|
Parameters
|
|
641
464
|
----------
|
|
642
465
|
tenant_id : str
|
|
@@ -763,27 +586,20 @@ class AsyncRawUploadClient:
|
|
|
763
586
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
764
587
|
self._client_wrapper = client_wrapper
|
|
765
588
|
|
|
766
|
-
async def
|
|
589
|
+
async def upload_knowledge(
|
|
767
590
|
self,
|
|
768
591
|
*,
|
|
769
|
-
files: typing.List[core.File],
|
|
770
592
|
tenant_id: str,
|
|
771
593
|
sub_tenant_id: typing.Optional[str] = OMIT,
|
|
772
594
|
upsert: typing.Optional[bool] = OMIT,
|
|
595
|
+
files: typing.Optional[typing.List[core.File]] = OMIT,
|
|
773
596
|
file_metadata: typing.Optional[str] = OMIT,
|
|
597
|
+
app_sources: typing.Optional[str] = OMIT,
|
|
774
598
|
request_options: typing.Optional[RequestOptions] = None,
|
|
775
599
|
) -> AsyncHttpResponse[SourceUploadResponse]:
|
|
776
600
|
"""
|
|
777
|
-
Upload one or more documents for ingestion.
|
|
778
|
-
Supports both single and batch uploads.
|
|
779
|
-
For single file: send one file with the 'files' field.
|
|
780
|
-
For batch: send multiple files with the 'files' field (FastAPI will parse as list).
|
|
781
|
-
|
|
782
601
|
Parameters
|
|
783
602
|
----------
|
|
784
|
-
files : typing.List[core.File]
|
|
785
|
-
See core.File for more documentation
|
|
786
|
-
|
|
787
603
|
tenant_id : str
|
|
788
604
|
Unique identifier for the tenant/organization
|
|
789
605
|
|
|
@@ -791,9 +607,16 @@ class AsyncRawUploadClient:
|
|
|
791
607
|
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
792
608
|
|
|
793
609
|
upsert : typing.Optional[bool]
|
|
610
|
+
If true, update existing sources with the same id.
|
|
611
|
+
|
|
612
|
+
files : typing.Optional[typing.List[core.File]]
|
|
613
|
+
See core.File for more documentation
|
|
794
614
|
|
|
795
615
|
file_metadata : typing.Optional[str]
|
|
796
|
-
JSON
|
|
616
|
+
JSON array of file metadata objects; length must match files when provided.
|
|
617
|
+
|
|
618
|
+
app_sources : typing.Optional[str]
|
|
619
|
+
JSON: single source object or array of app-generated sources to index. Omit when only uploading files.
|
|
797
620
|
|
|
798
621
|
request_options : typing.Optional[RequestOptions]
|
|
799
622
|
Request-specific configuration.
|
|
@@ -804,16 +627,17 @@ class AsyncRawUploadClient:
|
|
|
804
627
|
Successful Response
|
|
805
628
|
"""
|
|
806
629
|
_response = await self._client_wrapper.httpx_client.request(
|
|
807
|
-
"ingestion/
|
|
630
|
+
"ingestion/upload_knowledge",
|
|
808
631
|
method="POST",
|
|
809
632
|
data={
|
|
810
633
|
"tenant_id": tenant_id,
|
|
811
634
|
"sub_tenant_id": sub_tenant_id,
|
|
812
635
|
"upsert": upsert,
|
|
813
636
|
"file_metadata": file_metadata,
|
|
637
|
+
"app_sources": app_sources,
|
|
814
638
|
},
|
|
815
639
|
files={
|
|
816
|
-
"files": files,
|
|
640
|
+
**({"files": files} if files is not None else {}),
|
|
817
641
|
},
|
|
818
642
|
request_options=request_options,
|
|
819
643
|
omit=OMIT,
|
|
@@ -911,150 +735,6 @@ class AsyncRawUploadClient:
|
|
|
911
735
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
912
736
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
913
737
|
|
|
914
|
-
async def upload_app_sources(
|
|
915
|
-
self,
|
|
916
|
-
*,
|
|
917
|
-
app_sources: BodyUploadAppIngestionUploadAppPostAppSources,
|
|
918
|
-
tenant_id: str,
|
|
919
|
-
sub_tenant_id: typing.Optional[str] = OMIT,
|
|
920
|
-
upsert: typing.Optional[bool] = OMIT,
|
|
921
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
922
|
-
) -> AsyncHttpResponse[AppSourcesUploadData]:
|
|
923
|
-
"""
|
|
924
|
-
Upload structured sources generated by first-party or third-party apps.
|
|
925
|
-
Supports both single and batch uploads.
|
|
926
|
-
|
|
927
|
-
Parameters
|
|
928
|
-
----------
|
|
929
|
-
app_sources : BodyUploadAppIngestionUploadAppPostAppSources
|
|
930
|
-
Single source object or list of structured source objects containing app-generated data to be indexed
|
|
931
|
-
|
|
932
|
-
tenant_id : str
|
|
933
|
-
Unique identifier for the tenant/organization
|
|
934
|
-
|
|
935
|
-
sub_tenant_id : typing.Optional[str]
|
|
936
|
-
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
937
|
-
|
|
938
|
-
upsert : typing.Optional[bool]
|
|
939
|
-
If true, update existing sources with the same source_id. Defaults to True.
|
|
940
|
-
|
|
941
|
-
request_options : typing.Optional[RequestOptions]
|
|
942
|
-
Request-specific configuration.
|
|
943
|
-
|
|
944
|
-
Returns
|
|
945
|
-
-------
|
|
946
|
-
AsyncHttpResponse[AppSourcesUploadData]
|
|
947
|
-
Successful Response
|
|
948
|
-
"""
|
|
949
|
-
_response = await self._client_wrapper.httpx_client.request(
|
|
950
|
-
"ingestion/upload-app",
|
|
951
|
-
method="POST",
|
|
952
|
-
json={
|
|
953
|
-
"app_sources": convert_and_respect_annotation_metadata(
|
|
954
|
-
object_=app_sources, annotation=BodyUploadAppIngestionUploadAppPostAppSources, direction="write"
|
|
955
|
-
),
|
|
956
|
-
"tenant_id": tenant_id,
|
|
957
|
-
"sub_tenant_id": sub_tenant_id,
|
|
958
|
-
"upsert": upsert,
|
|
959
|
-
},
|
|
960
|
-
headers={
|
|
961
|
-
"content-type": "application/json",
|
|
962
|
-
},
|
|
963
|
-
request_options=request_options,
|
|
964
|
-
omit=OMIT,
|
|
965
|
-
)
|
|
966
|
-
try:
|
|
967
|
-
if 200 <= _response.status_code < 300:
|
|
968
|
-
_data = typing.cast(
|
|
969
|
-
AppSourcesUploadData,
|
|
970
|
-
parse_obj_as(
|
|
971
|
-
type_=AppSourcesUploadData, # type: ignore
|
|
972
|
-
object_=_response.json(),
|
|
973
|
-
),
|
|
974
|
-
)
|
|
975
|
-
return AsyncHttpResponse(response=_response, data=_data)
|
|
976
|
-
if _response.status_code == 400:
|
|
977
|
-
raise BadRequestError(
|
|
978
|
-
headers=dict(_response.headers),
|
|
979
|
-
body=typing.cast(
|
|
980
|
-
typing.Optional[typing.Any],
|
|
981
|
-
parse_obj_as(
|
|
982
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
|
983
|
-
object_=_response.json(),
|
|
984
|
-
),
|
|
985
|
-
),
|
|
986
|
-
)
|
|
987
|
-
if _response.status_code == 401:
|
|
988
|
-
raise UnauthorizedError(
|
|
989
|
-
headers=dict(_response.headers),
|
|
990
|
-
body=typing.cast(
|
|
991
|
-
typing.Optional[typing.Any],
|
|
992
|
-
parse_obj_as(
|
|
993
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
|
994
|
-
object_=_response.json(),
|
|
995
|
-
),
|
|
996
|
-
),
|
|
997
|
-
)
|
|
998
|
-
if _response.status_code == 403:
|
|
999
|
-
raise ForbiddenError(
|
|
1000
|
-
headers=dict(_response.headers),
|
|
1001
|
-
body=typing.cast(
|
|
1002
|
-
typing.Optional[typing.Any],
|
|
1003
|
-
parse_obj_as(
|
|
1004
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
|
1005
|
-
object_=_response.json(),
|
|
1006
|
-
),
|
|
1007
|
-
),
|
|
1008
|
-
)
|
|
1009
|
-
if _response.status_code == 404:
|
|
1010
|
-
raise NotFoundError(
|
|
1011
|
-
headers=dict(_response.headers),
|
|
1012
|
-
body=typing.cast(
|
|
1013
|
-
typing.Optional[typing.Any],
|
|
1014
|
-
parse_obj_as(
|
|
1015
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
|
1016
|
-
object_=_response.json(),
|
|
1017
|
-
),
|
|
1018
|
-
),
|
|
1019
|
-
)
|
|
1020
|
-
if _response.status_code == 422:
|
|
1021
|
-
raise UnprocessableEntityError(
|
|
1022
|
-
headers=dict(_response.headers),
|
|
1023
|
-
body=typing.cast(
|
|
1024
|
-
typing.Optional[typing.Any],
|
|
1025
|
-
parse_obj_as(
|
|
1026
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
|
1027
|
-
object_=_response.json(),
|
|
1028
|
-
),
|
|
1029
|
-
),
|
|
1030
|
-
)
|
|
1031
|
-
if _response.status_code == 500:
|
|
1032
|
-
raise InternalServerError(
|
|
1033
|
-
headers=dict(_response.headers),
|
|
1034
|
-
body=typing.cast(
|
|
1035
|
-
typing.Optional[typing.Any],
|
|
1036
|
-
parse_obj_as(
|
|
1037
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
|
1038
|
-
object_=_response.json(),
|
|
1039
|
-
),
|
|
1040
|
-
),
|
|
1041
|
-
)
|
|
1042
|
-
if _response.status_code == 503:
|
|
1043
|
-
raise ServiceUnavailableError(
|
|
1044
|
-
headers=dict(_response.headers),
|
|
1045
|
-
body=typing.cast(
|
|
1046
|
-
typing.Optional[typing.Any],
|
|
1047
|
-
parse_obj_as(
|
|
1048
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
|
1049
|
-
object_=_response.json(),
|
|
1050
|
-
),
|
|
1051
|
-
),
|
|
1052
|
-
)
|
|
1053
|
-
_response_json = _response.json()
|
|
1054
|
-
except JSONDecodeError:
|
|
1055
|
-
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1056
|
-
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1057
|
-
|
|
1058
738
|
async def verify_processing(
|
|
1059
739
|
self,
|
|
1060
740
|
*,
|
|
@@ -1064,12 +744,6 @@ class AsyncRawUploadClient:
|
|
|
1064
744
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1065
745
|
) -> AsyncHttpResponse[ProcessingStatus]:
|
|
1066
746
|
"""
|
|
1067
|
-
Check the current processing status of your uploaded content.
|
|
1068
|
-
|
|
1069
|
-
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.
|
|
1070
|
-
|
|
1071
|
-
Use this to determine when your content is ready for search and retrieval, or to troubleshoot any processing issues.
|
|
1072
|
-
|
|
1073
747
|
Parameters
|
|
1074
748
|
----------
|
|
1075
749
|
file_id : str
|
|
@@ -1090,7 +764,7 @@ class AsyncRawUploadClient:
|
|
|
1090
764
|
Successful Response
|
|
1091
765
|
"""
|
|
1092
766
|
_response = await self._client_wrapper.httpx_client.request(
|
|
1093
|
-
"ingestion/
|
|
767
|
+
"ingestion/verify_processing",
|
|
1094
768
|
method="POST",
|
|
1095
769
|
params={
|
|
1096
770
|
"file_id": file_id,
|
|
@@ -1201,24 +875,6 @@ class AsyncRawUploadClient:
|
|
|
1201
875
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1202
876
|
) -> AsyncHttpResponse[AddMemoryResponse]:
|
|
1203
877
|
"""
|
|
1204
|
-
Add memories for indexing and retrieval.
|
|
1205
|
-
|
|
1206
|
-
This API provides a unified entry point for ingesting various types of content:
|
|
1207
|
-
|
|
1208
|
-
**Content Types Supported:**
|
|
1209
|
-
- Raw text content (`text` field)
|
|
1210
|
-
- Markdown formatted content (`text` + `is_markdown=true`)
|
|
1211
|
-
- User/assistant conversation pairs (`user_assistant_pairs` field)
|
|
1212
|
-
|
|
1213
|
-
**Key Features:**
|
|
1214
|
-
- **Inference Mode (`infer=true`)**: When enabled, the system extracts additional
|
|
1215
|
-
insights and implicit information from your content. Useful for conversation
|
|
1216
|
-
analysis and knowledge extraction.
|
|
1217
|
-
- **Direct Mode (`infer=false`)**: Content is chunked and indexed as-is without
|
|
1218
|
-
additional processing.
|
|
1219
|
-
|
|
1220
|
-
Use `/ingestion/verify-processing` endpoint to check the processing status.
|
|
1221
|
-
|
|
1222
878
|
Parameters
|
|
1223
879
|
----------
|
|
1224
880
|
memories : typing.Sequence[MemoryItem]
|
|
@@ -1359,14 +1015,6 @@ class AsyncRawUploadClient:
|
|
|
1359
1015
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1360
1016
|
) -> AsyncHttpResponse[DeleteUserMemoryResponse]:
|
|
1361
1017
|
"""
|
|
1362
|
-
Permanently remove a specific memory from storage.
|
|
1363
|
-
|
|
1364
|
-
This API allows you to delete a memory by its unique identifier.
|
|
1365
|
-
Once deleted, the memory cannot be recovered, so use this operation carefully.
|
|
1366
|
-
|
|
1367
|
-
The memory will be removed from your tenant's storage and will no longer
|
|
1368
|
-
appear in search results or memory listings.
|
|
1369
|
-
|
|
1370
1018
|
Parameters
|
|
1371
1019
|
----------
|
|
1372
1020
|
tenant_id : str
|