usecortex-ai 0.3.4__py3-none-any.whl → 0.3.6__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 +24 -2
- usecortex_ai/search/client.py +36 -4
- usecortex_ai/search/raw_client.py +40 -8
- usecortex_ai/sources/client.py +97 -0
- usecortex_ai/sources/raw_client.py +273 -0
- usecortex_ai/types/__init__.py +24 -2
- usecortex_ai/types/add_user_memory_response.py +6 -1
- usecortex_ai/types/chunk_graph_relations_response.py +33 -0
- usecortex_ai/types/entity.py +42 -0
- usecortex_ai/types/extended_context.py +0 -3
- usecortex_ai/types/graph_relations_response.py +33 -0
- usecortex_ai/types/{generate_user_memory_response.py → path_triplet.py} +13 -7
- usecortex_ai/types/relation_evidence.py +53 -0
- usecortex_ai/types/retrieve_mode.py +5 -0
- usecortex_ai/types/retrieve_response.py +34 -0
- usecortex_ai/types/retrieve_user_memory_response.py +6 -0
- usecortex_ai/types/scored_path_response.py +40 -0
- usecortex_ai/types/scored_triplet_response.py +43 -0
- usecortex_ai/types/search_chunk.py +11 -0
- usecortex_ai/types/triple_with_evidence.py +31 -0
- usecortex_ai/types/user_assistant_pair.py +27 -0
- usecortex_ai/types/webpage_scrape_request.py +27 -0
- usecortex_ai/upload/client.py +276 -0
- usecortex_ai/upload/raw_client.py +1179 -339
- usecortex_ai/user_memory/client.py +77 -149
- usecortex_ai/user_memory/raw_client.py +74 -329
- {usecortex_ai-0.3.4.dist-info → usecortex_ai-0.3.6.dist-info}/METADATA +1 -1
- {usecortex_ai-0.3.4.dist-info → usecortex_ai-0.3.6.dist-info}/RECORD +31 -20
- {usecortex_ai-0.3.4.dist-info → usecortex_ai-0.3.6.dist-info}/WHEEL +0 -0
- {usecortex_ai-0.3.4.dist-info → usecortex_ai-0.3.6.dist-info}/licenses/LICENSE +0 -0
- {usecortex_ai-0.3.4.dist-info → usecortex_ai-0.3.6.dist-info}/top_level.txt +0 -0
|
@@ -8,6 +8,7 @@ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
|
8
8
|
from ..core.http_response import AsyncHttpResponse, HttpResponse
|
|
9
9
|
from ..core.pydantic_utilities import parse_obj_as
|
|
10
10
|
from ..core.request_options import RequestOptions
|
|
11
|
+
from ..core.serialization import convert_and_respect_annotation_metadata
|
|
11
12
|
from ..errors.bad_request_error import BadRequestError
|
|
12
13
|
from ..errors.forbidden_error import ForbiddenError
|
|
13
14
|
from ..errors.internal_server_error import InternalServerError
|
|
@@ -18,9 +19,9 @@ from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
|
|
18
19
|
from ..types.actual_error_response import ActualErrorResponse
|
|
19
20
|
from ..types.add_user_memory_response import AddUserMemoryResponse
|
|
20
21
|
from ..types.delete_user_memory_response import DeleteUserMemoryResponse
|
|
21
|
-
from ..types.generate_user_memory_response import GenerateUserMemoryResponse
|
|
22
22
|
from ..types.list_user_memories_response import ListUserMemoriesResponse
|
|
23
23
|
from ..types.retrieve_user_memory_response import RetrieveUserMemoryResponse
|
|
24
|
+
from ..types.user_assistant_pair import UserAssistantPair
|
|
24
25
|
|
|
25
26
|
# this is used as the default value for optional parameters
|
|
26
27
|
OMIT = typing.cast(typing.Any, ...)
|
|
@@ -312,14 +313,14 @@ class RawUserMemoryClient:
|
|
|
312
313
|
request_options: typing.Optional[RequestOptions] = None,
|
|
313
314
|
) -> HttpResponse[RetrieveUserMemoryResponse]:
|
|
314
315
|
"""
|
|
315
|
-
Find relevant user memories using semantic search.
|
|
316
|
+
Find relevant user memories using semantic search and knowledge graph.
|
|
316
317
|
|
|
317
|
-
This endpoint performs
|
|
318
|
-
|
|
319
|
-
|
|
318
|
+
This endpoint performs parallel searches:
|
|
319
|
+
1. Semantic search in Weaviate across all stored user memories
|
|
320
|
+
2. Entity-based search in the knowledge graph for memory entities
|
|
320
321
|
|
|
321
|
-
|
|
322
|
-
|
|
322
|
+
Results from both sources are combined and ranked by relevance to provide
|
|
323
|
+
comprehensive memory retrieval.
|
|
323
324
|
|
|
324
325
|
Parameters
|
|
325
326
|
----------
|
|
@@ -456,184 +457,50 @@ class RawUserMemoryClient:
|
|
|
456
457
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
457
458
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
458
459
|
|
|
459
|
-
def
|
|
460
|
+
def add_user_memory(
|
|
460
461
|
self,
|
|
461
462
|
*,
|
|
462
463
|
tenant_id: str,
|
|
463
|
-
user_message: str,
|
|
464
|
-
user_name: str,
|
|
465
464
|
sub_tenant_id: typing.Optional[str] = None,
|
|
465
|
+
raw_text: typing.Optional[str] = OMIT,
|
|
466
|
+
user_assistant_pairs: typing.Optional[typing.Sequence[UserAssistantPair]] = OMIT,
|
|
467
|
+
expiry_time: typing.Optional[int] = OMIT,
|
|
468
|
+
infer: typing.Optional[bool] = OMIT,
|
|
469
|
+
custom_instructions: typing.Optional[str] = OMIT,
|
|
466
470
|
request_options: typing.Optional[RequestOptions] = None,
|
|
467
|
-
) -> HttpResponse[
|
|
471
|
+
) -> HttpResponse[AddUserMemoryResponse]:
|
|
468
472
|
"""
|
|
469
|
-
|
|
473
|
+
Store new user memories for future reference.
|
|
470
474
|
|
|
471
|
-
This endpoint
|
|
472
|
-
|
|
473
|
-
|
|
475
|
+
This endpoint allows you to add memories in two formats:
|
|
476
|
+
1. Raw text string - A single text-based memory
|
|
477
|
+
2. User/Assistant pairs array - Conversation pairs that will be chunked as a single memory
|
|
474
478
|
|
|
475
|
-
|
|
476
|
-
|
|
479
|
+
The stored memories will be chunked, indexed in both Weaviate and the knowledge graph,
|
|
480
|
+
and made available for semantic search and graph-based retrieval.
|
|
477
481
|
|
|
478
482
|
Parameters
|
|
479
483
|
----------
|
|
480
484
|
tenant_id : str
|
|
481
485
|
Unique identifier for the tenant/organization
|
|
482
486
|
|
|
483
|
-
user_message : str
|
|
484
|
-
Your query or context for AI memory generation
|
|
485
|
-
|
|
486
|
-
user_name : str
|
|
487
|
-
Your name to personalize the generated memories
|
|
488
|
-
|
|
489
487
|
sub_tenant_id : typing.Optional[str]
|
|
490
488
|
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
491
489
|
|
|
492
|
-
|
|
493
|
-
|
|
490
|
+
raw_text : typing.Optional[str]
|
|
491
|
+
Single raw text memory to store. If both raw_text and user_assistant_pairs are provided, raw_text will be used.
|
|
494
492
|
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
HttpResponse[GenerateUserMemoryResponse]
|
|
498
|
-
Successful Response
|
|
499
|
-
"""
|
|
500
|
-
_response = self._client_wrapper.httpx_client.request(
|
|
501
|
-
"user_memory/generate_user_memory",
|
|
502
|
-
method="POST",
|
|
503
|
-
params={
|
|
504
|
-
"tenant_id": tenant_id,
|
|
505
|
-
"sub_tenant_id": sub_tenant_id,
|
|
506
|
-
},
|
|
507
|
-
json={
|
|
508
|
-
"user_message": user_message,
|
|
509
|
-
"user_name": user_name,
|
|
510
|
-
},
|
|
511
|
-
headers={
|
|
512
|
-
"content-type": "application/json",
|
|
513
|
-
},
|
|
514
|
-
request_options=request_options,
|
|
515
|
-
omit=OMIT,
|
|
516
|
-
)
|
|
517
|
-
try:
|
|
518
|
-
if 200 <= _response.status_code < 300:
|
|
519
|
-
_data = typing.cast(
|
|
520
|
-
GenerateUserMemoryResponse,
|
|
521
|
-
parse_obj_as(
|
|
522
|
-
type_=GenerateUserMemoryResponse, # type: ignore
|
|
523
|
-
object_=_response.json(),
|
|
524
|
-
),
|
|
525
|
-
)
|
|
526
|
-
return HttpResponse(response=_response, data=_data)
|
|
527
|
-
if _response.status_code == 400:
|
|
528
|
-
raise BadRequestError(
|
|
529
|
-
headers=dict(_response.headers),
|
|
530
|
-
body=typing.cast(
|
|
531
|
-
ActualErrorResponse,
|
|
532
|
-
parse_obj_as(
|
|
533
|
-
type_=ActualErrorResponse, # type: ignore
|
|
534
|
-
object_=_response.json(),
|
|
535
|
-
),
|
|
536
|
-
),
|
|
537
|
-
)
|
|
538
|
-
if _response.status_code == 401:
|
|
539
|
-
raise UnauthorizedError(
|
|
540
|
-
headers=dict(_response.headers),
|
|
541
|
-
body=typing.cast(
|
|
542
|
-
ActualErrorResponse,
|
|
543
|
-
parse_obj_as(
|
|
544
|
-
type_=ActualErrorResponse, # type: ignore
|
|
545
|
-
object_=_response.json(),
|
|
546
|
-
),
|
|
547
|
-
),
|
|
548
|
-
)
|
|
549
|
-
if _response.status_code == 403:
|
|
550
|
-
raise ForbiddenError(
|
|
551
|
-
headers=dict(_response.headers),
|
|
552
|
-
body=typing.cast(
|
|
553
|
-
ActualErrorResponse,
|
|
554
|
-
parse_obj_as(
|
|
555
|
-
type_=ActualErrorResponse, # type: ignore
|
|
556
|
-
object_=_response.json(),
|
|
557
|
-
),
|
|
558
|
-
),
|
|
559
|
-
)
|
|
560
|
-
if _response.status_code == 404:
|
|
561
|
-
raise NotFoundError(
|
|
562
|
-
headers=dict(_response.headers),
|
|
563
|
-
body=typing.cast(
|
|
564
|
-
ActualErrorResponse,
|
|
565
|
-
parse_obj_as(
|
|
566
|
-
type_=ActualErrorResponse, # type: ignore
|
|
567
|
-
object_=_response.json(),
|
|
568
|
-
),
|
|
569
|
-
),
|
|
570
|
-
)
|
|
571
|
-
if _response.status_code == 422:
|
|
572
|
-
raise UnprocessableEntityError(
|
|
573
|
-
headers=dict(_response.headers),
|
|
574
|
-
body=typing.cast(
|
|
575
|
-
typing.Optional[typing.Any],
|
|
576
|
-
parse_obj_as(
|
|
577
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
|
578
|
-
object_=_response.json(),
|
|
579
|
-
),
|
|
580
|
-
),
|
|
581
|
-
)
|
|
582
|
-
if _response.status_code == 500:
|
|
583
|
-
raise InternalServerError(
|
|
584
|
-
headers=dict(_response.headers),
|
|
585
|
-
body=typing.cast(
|
|
586
|
-
ActualErrorResponse,
|
|
587
|
-
parse_obj_as(
|
|
588
|
-
type_=ActualErrorResponse, # type: ignore
|
|
589
|
-
object_=_response.json(),
|
|
590
|
-
),
|
|
591
|
-
),
|
|
592
|
-
)
|
|
593
|
-
if _response.status_code == 503:
|
|
594
|
-
raise ServiceUnavailableError(
|
|
595
|
-
headers=dict(_response.headers),
|
|
596
|
-
body=typing.cast(
|
|
597
|
-
ActualErrorResponse,
|
|
598
|
-
parse_obj_as(
|
|
599
|
-
type_=ActualErrorResponse, # type: ignore
|
|
600
|
-
object_=_response.json(),
|
|
601
|
-
),
|
|
602
|
-
),
|
|
603
|
-
)
|
|
604
|
-
_response_json = _response.json()
|
|
605
|
-
except JSONDecodeError:
|
|
606
|
-
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
607
|
-
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
608
|
-
|
|
609
|
-
def add_user_memory(
|
|
610
|
-
self,
|
|
611
|
-
*,
|
|
612
|
-
tenant_id: str,
|
|
613
|
-
user_memory: str,
|
|
614
|
-
sub_tenant_id: typing.Optional[str] = None,
|
|
615
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
616
|
-
) -> HttpResponse[AddUserMemoryResponse]:
|
|
617
|
-
"""
|
|
618
|
-
Store a new user memory for future reference.
|
|
493
|
+
user_assistant_pairs : typing.Optional[typing.Sequence[UserAssistantPair]]
|
|
494
|
+
Array of user/assistant conversation pairs to store as a single memory
|
|
619
495
|
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
preferences, context, or information that you want the system to remember.
|
|
496
|
+
expiry_time : typing.Optional[int]
|
|
497
|
+
Expiry time in seconds for the memory (optional)
|
|
623
498
|
|
|
624
|
-
|
|
625
|
-
|
|
499
|
+
infer : typing.Optional[bool]
|
|
500
|
+
If true, process and compress chunks into inferred representations before indexing (default: False)
|
|
626
501
|
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
tenant_id : str
|
|
630
|
-
Unique identifier for the tenant/organization
|
|
631
|
-
|
|
632
|
-
user_memory : str
|
|
633
|
-
The memory content to store for future reference
|
|
634
|
-
|
|
635
|
-
sub_tenant_id : typing.Optional[str]
|
|
636
|
-
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
502
|
+
custom_instructions : typing.Optional[str]
|
|
503
|
+
Custom instructions to guide cortex
|
|
637
504
|
|
|
638
505
|
request_options : typing.Optional[RequestOptions]
|
|
639
506
|
Request-specific configuration.
|
|
@@ -651,7 +518,13 @@ class RawUserMemoryClient:
|
|
|
651
518
|
"sub_tenant_id": sub_tenant_id,
|
|
652
519
|
},
|
|
653
520
|
json={
|
|
654
|
-
"
|
|
521
|
+
"raw_text": raw_text,
|
|
522
|
+
"user_assistant_pairs": convert_and_respect_annotation_metadata(
|
|
523
|
+
object_=user_assistant_pairs, annotation=typing.Sequence[UserAssistantPair], direction="write"
|
|
524
|
+
),
|
|
525
|
+
"expiry_time": expiry_time,
|
|
526
|
+
"infer": infer,
|
|
527
|
+
"custom_instructions": custom_instructions,
|
|
655
528
|
},
|
|
656
529
|
headers={
|
|
657
530
|
"content-type": "application/json",
|
|
@@ -1038,14 +911,14 @@ class AsyncRawUserMemoryClient:
|
|
|
1038
911
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1039
912
|
) -> AsyncHttpResponse[RetrieveUserMemoryResponse]:
|
|
1040
913
|
"""
|
|
1041
|
-
Find relevant user memories using semantic search.
|
|
914
|
+
Find relevant user memories using semantic search and knowledge graph.
|
|
1042
915
|
|
|
1043
|
-
This endpoint performs
|
|
1044
|
-
|
|
1045
|
-
|
|
916
|
+
This endpoint performs parallel searches:
|
|
917
|
+
1. Semantic search in Weaviate across all stored user memories
|
|
918
|
+
2. Entity-based search in the knowledge graph for memory entities
|
|
1046
919
|
|
|
1047
|
-
|
|
1048
|
-
|
|
920
|
+
Results from both sources are combined and ranked by relevance to provide
|
|
921
|
+
comprehensive memory retrieval.
|
|
1049
922
|
|
|
1050
923
|
Parameters
|
|
1051
924
|
----------
|
|
@@ -1182,184 +1055,50 @@ class AsyncRawUserMemoryClient:
|
|
|
1182
1055
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1183
1056
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1184
1057
|
|
|
1185
|
-
async def
|
|
1058
|
+
async def add_user_memory(
|
|
1186
1059
|
self,
|
|
1187
1060
|
*,
|
|
1188
1061
|
tenant_id: str,
|
|
1189
|
-
user_message: str,
|
|
1190
|
-
user_name: str,
|
|
1191
1062
|
sub_tenant_id: typing.Optional[str] = None,
|
|
1063
|
+
raw_text: typing.Optional[str] = OMIT,
|
|
1064
|
+
user_assistant_pairs: typing.Optional[typing.Sequence[UserAssistantPair]] = OMIT,
|
|
1065
|
+
expiry_time: typing.Optional[int] = OMIT,
|
|
1066
|
+
infer: typing.Optional[bool] = OMIT,
|
|
1067
|
+
custom_instructions: typing.Optional[str] = OMIT,
|
|
1192
1068
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1193
|
-
) -> AsyncHttpResponse[
|
|
1069
|
+
) -> AsyncHttpResponse[AddUserMemoryResponse]:
|
|
1194
1070
|
"""
|
|
1195
|
-
|
|
1071
|
+
Store new user memories for future reference.
|
|
1196
1072
|
|
|
1197
|
-
This endpoint
|
|
1198
|
-
|
|
1199
|
-
|
|
1073
|
+
This endpoint allows you to add memories in two formats:
|
|
1074
|
+
1. Raw text string - A single text-based memory
|
|
1075
|
+
2. User/Assistant pairs array - Conversation pairs that will be chunked as a single memory
|
|
1200
1076
|
|
|
1201
|
-
|
|
1202
|
-
|
|
1077
|
+
The stored memories will be chunked, indexed in both Weaviate and the knowledge graph,
|
|
1078
|
+
and made available for semantic search and graph-based retrieval.
|
|
1203
1079
|
|
|
1204
1080
|
Parameters
|
|
1205
1081
|
----------
|
|
1206
1082
|
tenant_id : str
|
|
1207
1083
|
Unique identifier for the tenant/organization
|
|
1208
1084
|
|
|
1209
|
-
user_message : str
|
|
1210
|
-
Your query or context for AI memory generation
|
|
1211
|
-
|
|
1212
|
-
user_name : str
|
|
1213
|
-
Your name to personalize the generated memories
|
|
1214
|
-
|
|
1215
1085
|
sub_tenant_id : typing.Optional[str]
|
|
1216
1086
|
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
1217
1087
|
|
|
1218
|
-
|
|
1219
|
-
|
|
1088
|
+
raw_text : typing.Optional[str]
|
|
1089
|
+
Single raw text memory to store. If both raw_text and user_assistant_pairs are provided, raw_text will be used.
|
|
1220
1090
|
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
AsyncHttpResponse[GenerateUserMemoryResponse]
|
|
1224
|
-
Successful Response
|
|
1225
|
-
"""
|
|
1226
|
-
_response = await self._client_wrapper.httpx_client.request(
|
|
1227
|
-
"user_memory/generate_user_memory",
|
|
1228
|
-
method="POST",
|
|
1229
|
-
params={
|
|
1230
|
-
"tenant_id": tenant_id,
|
|
1231
|
-
"sub_tenant_id": sub_tenant_id,
|
|
1232
|
-
},
|
|
1233
|
-
json={
|
|
1234
|
-
"user_message": user_message,
|
|
1235
|
-
"user_name": user_name,
|
|
1236
|
-
},
|
|
1237
|
-
headers={
|
|
1238
|
-
"content-type": "application/json",
|
|
1239
|
-
},
|
|
1240
|
-
request_options=request_options,
|
|
1241
|
-
omit=OMIT,
|
|
1242
|
-
)
|
|
1243
|
-
try:
|
|
1244
|
-
if 200 <= _response.status_code < 300:
|
|
1245
|
-
_data = typing.cast(
|
|
1246
|
-
GenerateUserMemoryResponse,
|
|
1247
|
-
parse_obj_as(
|
|
1248
|
-
type_=GenerateUserMemoryResponse, # type: ignore
|
|
1249
|
-
object_=_response.json(),
|
|
1250
|
-
),
|
|
1251
|
-
)
|
|
1252
|
-
return AsyncHttpResponse(response=_response, data=_data)
|
|
1253
|
-
if _response.status_code == 400:
|
|
1254
|
-
raise BadRequestError(
|
|
1255
|
-
headers=dict(_response.headers),
|
|
1256
|
-
body=typing.cast(
|
|
1257
|
-
ActualErrorResponse,
|
|
1258
|
-
parse_obj_as(
|
|
1259
|
-
type_=ActualErrorResponse, # type: ignore
|
|
1260
|
-
object_=_response.json(),
|
|
1261
|
-
),
|
|
1262
|
-
),
|
|
1263
|
-
)
|
|
1264
|
-
if _response.status_code == 401:
|
|
1265
|
-
raise UnauthorizedError(
|
|
1266
|
-
headers=dict(_response.headers),
|
|
1267
|
-
body=typing.cast(
|
|
1268
|
-
ActualErrorResponse,
|
|
1269
|
-
parse_obj_as(
|
|
1270
|
-
type_=ActualErrorResponse, # type: ignore
|
|
1271
|
-
object_=_response.json(),
|
|
1272
|
-
),
|
|
1273
|
-
),
|
|
1274
|
-
)
|
|
1275
|
-
if _response.status_code == 403:
|
|
1276
|
-
raise ForbiddenError(
|
|
1277
|
-
headers=dict(_response.headers),
|
|
1278
|
-
body=typing.cast(
|
|
1279
|
-
ActualErrorResponse,
|
|
1280
|
-
parse_obj_as(
|
|
1281
|
-
type_=ActualErrorResponse, # type: ignore
|
|
1282
|
-
object_=_response.json(),
|
|
1283
|
-
),
|
|
1284
|
-
),
|
|
1285
|
-
)
|
|
1286
|
-
if _response.status_code == 404:
|
|
1287
|
-
raise NotFoundError(
|
|
1288
|
-
headers=dict(_response.headers),
|
|
1289
|
-
body=typing.cast(
|
|
1290
|
-
ActualErrorResponse,
|
|
1291
|
-
parse_obj_as(
|
|
1292
|
-
type_=ActualErrorResponse, # type: ignore
|
|
1293
|
-
object_=_response.json(),
|
|
1294
|
-
),
|
|
1295
|
-
),
|
|
1296
|
-
)
|
|
1297
|
-
if _response.status_code == 422:
|
|
1298
|
-
raise UnprocessableEntityError(
|
|
1299
|
-
headers=dict(_response.headers),
|
|
1300
|
-
body=typing.cast(
|
|
1301
|
-
typing.Optional[typing.Any],
|
|
1302
|
-
parse_obj_as(
|
|
1303
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
|
1304
|
-
object_=_response.json(),
|
|
1305
|
-
),
|
|
1306
|
-
),
|
|
1307
|
-
)
|
|
1308
|
-
if _response.status_code == 500:
|
|
1309
|
-
raise InternalServerError(
|
|
1310
|
-
headers=dict(_response.headers),
|
|
1311
|
-
body=typing.cast(
|
|
1312
|
-
ActualErrorResponse,
|
|
1313
|
-
parse_obj_as(
|
|
1314
|
-
type_=ActualErrorResponse, # type: ignore
|
|
1315
|
-
object_=_response.json(),
|
|
1316
|
-
),
|
|
1317
|
-
),
|
|
1318
|
-
)
|
|
1319
|
-
if _response.status_code == 503:
|
|
1320
|
-
raise ServiceUnavailableError(
|
|
1321
|
-
headers=dict(_response.headers),
|
|
1322
|
-
body=typing.cast(
|
|
1323
|
-
ActualErrorResponse,
|
|
1324
|
-
parse_obj_as(
|
|
1325
|
-
type_=ActualErrorResponse, # type: ignore
|
|
1326
|
-
object_=_response.json(),
|
|
1327
|
-
),
|
|
1328
|
-
),
|
|
1329
|
-
)
|
|
1330
|
-
_response_json = _response.json()
|
|
1331
|
-
except JSONDecodeError:
|
|
1332
|
-
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1333
|
-
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1334
|
-
|
|
1335
|
-
async def add_user_memory(
|
|
1336
|
-
self,
|
|
1337
|
-
*,
|
|
1338
|
-
tenant_id: str,
|
|
1339
|
-
user_memory: str,
|
|
1340
|
-
sub_tenant_id: typing.Optional[str] = None,
|
|
1341
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
1342
|
-
) -> AsyncHttpResponse[AddUserMemoryResponse]:
|
|
1343
|
-
"""
|
|
1344
|
-
Store a new user memory for future reference.
|
|
1091
|
+
user_assistant_pairs : typing.Optional[typing.Sequence[UserAssistantPair]]
|
|
1092
|
+
Array of user/assistant conversation pairs to store as a single memory
|
|
1345
1093
|
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
preferences, context, or information that you want the system to remember.
|
|
1094
|
+
expiry_time : typing.Optional[int]
|
|
1095
|
+
Expiry time in seconds for the memory (optional)
|
|
1349
1096
|
|
|
1350
|
-
|
|
1351
|
-
|
|
1097
|
+
infer : typing.Optional[bool]
|
|
1098
|
+
If true, process and compress chunks into inferred representations before indexing (default: False)
|
|
1352
1099
|
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
tenant_id : str
|
|
1356
|
-
Unique identifier for the tenant/organization
|
|
1357
|
-
|
|
1358
|
-
user_memory : str
|
|
1359
|
-
The memory content to store for future reference
|
|
1360
|
-
|
|
1361
|
-
sub_tenant_id : typing.Optional[str]
|
|
1362
|
-
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
1100
|
+
custom_instructions : typing.Optional[str]
|
|
1101
|
+
Custom instructions to guide cortex
|
|
1363
1102
|
|
|
1364
1103
|
request_options : typing.Optional[RequestOptions]
|
|
1365
1104
|
Request-specific configuration.
|
|
@@ -1377,7 +1116,13 @@ class AsyncRawUserMemoryClient:
|
|
|
1377
1116
|
"sub_tenant_id": sub_tenant_id,
|
|
1378
1117
|
},
|
|
1379
1118
|
json={
|
|
1380
|
-
"
|
|
1119
|
+
"raw_text": raw_text,
|
|
1120
|
+
"user_assistant_pairs": convert_and_respect_annotation_metadata(
|
|
1121
|
+
object_=user_assistant_pairs, annotation=typing.Sequence[UserAssistantPair], direction="write"
|
|
1122
|
+
),
|
|
1123
|
+
"expiry_time": expiry_time,
|
|
1124
|
+
"infer": infer,
|
|
1125
|
+
"custom_instructions": custom_instructions,
|
|
1381
1126
|
},
|
|
1382
1127
|
headers={
|
|
1383
1128
|
"content-type": "application/json",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
usecortex_ai/__init__.py,sha256=
|
|
1
|
+
usecortex_ai/__init__.py,sha256=ZSziRo_n9xvUND64kUQuA9zS_WurzAG_gkGgdR0CVJs,3444
|
|
2
2
|
usecortex_ai/client.py,sha256=i-1RW54MMmplowh9sDAm3W-Nw_mlQyBWHSFmc4XsOKA,9865
|
|
3
3
|
usecortex_ai/environment.py,sha256=IZ0X7CTz4V0TzNaMrw6E5GJklcTLxGJmrWEyH-LtYsc,162
|
|
4
4
|
usecortex_ai/raw_client.py,sha256=Z2zedJhFwHoO_Zmm2enC_s-gd8SM_itaWZOfL0rSobE,3532
|
|
@@ -34,25 +34,26 @@ usecortex_ai/fetch/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa
|
|
|
34
34
|
usecortex_ai/fetch/client.py,sha256=fWj3cWX5hoiBC1iXXLb3LG5-6YROxwOrZGYJI0-b8co,3970
|
|
35
35
|
usecortex_ai/fetch/raw_client.py,sha256=FCBFr34T4yIzudw3FBDWPZ2FdV1yWMsORrrjkLVyLTg,11734
|
|
36
36
|
usecortex_ai/search/__init__.py,sha256=iA8ksy3OzGPGNq_g8cVXsEiZuWyAEAnKI6fHUFWEE-A,131
|
|
37
|
-
usecortex_ai/search/client.py,sha256=
|
|
38
|
-
usecortex_ai/search/raw_client.py,sha256=
|
|
37
|
+
usecortex_ai/search/client.py,sha256=O9XbLKH5WDTvueBjlZT_Js6uZHes9MQpDUm5URu3yt4,21957
|
|
38
|
+
usecortex_ai/search/raw_client.py,sha256=FJ0qGnyhQSGMSdsbQVabLwl2WtbgxYMIXXnlJe1kCPM,46069
|
|
39
39
|
usecortex_ai/search/types/__init__.py,sha256=T0zQrrDzfvgmw2Deo_iYanUoxcVhZ9jDO_fS3CpSU9M,131
|
|
40
40
|
usecortex_ai/search/types/alpha.py,sha256=afIpOT9uMdYdUZB_biXoggzRnZlnr00miVPDgxDRFIA,113
|
|
41
41
|
usecortex_ai/sources/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
|
|
42
|
-
usecortex_ai/sources/client.py,sha256=
|
|
43
|
-
usecortex_ai/sources/raw_client.py,sha256=
|
|
42
|
+
usecortex_ai/sources/client.py,sha256=W_G8kefb_6Bi7SeYvi9dy_41xKaPP3nVTCjE4vPQjA8,11606
|
|
43
|
+
usecortex_ai/sources/raw_client.py,sha256=oWggwYuje1xcaonWxz8Bm24LcmyYkFPfviEUNhYmj7o,34572
|
|
44
44
|
usecortex_ai/tenant/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
|
|
45
45
|
usecortex_ai/tenant/client.py,sha256=IhVoy4lN2UTO8nvkT5NJXhExb6DrqP7CG51mm647akA,8764
|
|
46
46
|
usecortex_ai/tenant/raw_client.py,sha256=aUBX_Fk09hHga_ezEr6iMD5G1xTnBO0RR4RYksGHZdw,31494
|
|
47
|
-
usecortex_ai/types/__init__.py,sha256=
|
|
47
|
+
usecortex_ai/types/__init__.py,sha256=uLDJhwg-XQUA0om_1EhLJaXJIwLbBWiGCHKsNYm5b0A,4094
|
|
48
48
|
usecortex_ai/types/actual_error_response.py,sha256=EBit_JO3u0FQrVAXDg0UXQktlULLPLtX8FF8J9mZSvY,580
|
|
49
|
-
usecortex_ai/types/add_user_memory_response.py,sha256=
|
|
49
|
+
usecortex_ai/types/add_user_memory_response.py,sha256=7JjjeNn7wmWGBWp-LmLZOQifouNKfQGPCzGU3K1mlis,1088
|
|
50
50
|
usecortex_ai/types/app_sources_upload_data.py,sha256=XIXK7hRxNsqddHrtiF8RzEt4aqQPaLISiVn69AMAB6w,854
|
|
51
51
|
usecortex_ai/types/attachment_model.py,sha256=gyIlSbj2fz8VJ6fo03-2FntXd0zZ5w53Ij-LN3PhjYg,1600
|
|
52
52
|
usecortex_ai/types/batch_upload_data.py,sha256=C7e4MHoYleXTDOHfJz2gBWa7Lcl837An1XEZFfRZ380,850
|
|
53
53
|
usecortex_ai/types/bm_25_operator_type.py,sha256=wiromvB4YjgxKQcS1-1BNBZ7MqKP1JzBEbY1R8K-wq4,153
|
|
54
54
|
usecortex_ai/types/body_scrape_webpage_upload_scrape_webpage_post.py,sha256=7mnML_5krrZ8obOW_2HavWAjP2rxYQ-pETP0GnKsfDI,532
|
|
55
55
|
usecortex_ai/types/body_update_scrape_job_upload_update_webpage_patch.py,sha256=7WtD74CYa-RkkuqluiBzoQjWqvbzUcK2p1cZZr0YgWo,535
|
|
56
|
+
usecortex_ai/types/chunk_graph_relations_response.py,sha256=UKFAUWqITIW955H8q9lD8mbuXRQKvpyQYOFLk2uWv70,1175
|
|
56
57
|
usecortex_ai/types/content_model.py,sha256=7KsEMncTZK90gWsjjVfrmOxOndM2HODIOUHclQU6ysE,1738
|
|
57
58
|
usecortex_ai/types/delete_memory_request.py,sha256=4IoGwsZcGLg4_cJ_HqMsBseSk13exDnXMxpVFb5_PWo,957
|
|
58
59
|
usecortex_ai/types/delete_sources.py,sha256=3Kl4YxQmiCNLiR1O7ZHP0xZgaQ54JTuyofbYS-MWjeM,589
|
|
@@ -62,40 +63,50 @@ usecortex_ai/types/embeddings_create_collection_data.py,sha256=z6PQYZOcFEac03aWD
|
|
|
62
63
|
usecortex_ai/types/embeddings_delete_data.py,sha256=3DzQa0Gukog56XPlQe9zaUtvdIhIYWOLPGjlB6suTlU,1116
|
|
63
64
|
usecortex_ai/types/embeddings_get_data.py,sha256=R9ukkUXidR4Q6_k0uT4GsEHjGXxgO-yArLGSVdKfw_U,1125
|
|
64
65
|
usecortex_ai/types/embeddings_search_data.py,sha256=61UYdgEpsi-pYkGuMwSLc04-hrDjHXJPGBjoOKERRPM,1056
|
|
66
|
+
usecortex_ai/types/entity.py,sha256=Q7gxZIFiT5jX78TfRO8id1KFh2vmTo_1-wWZZCoZOd4,1082
|
|
65
67
|
usecortex_ai/types/error_response.py,sha256=7_MuOTWE3zj6kg6UptuYBFMAhV3KZGEkpsyirFvHJzA,633
|
|
66
|
-
usecortex_ai/types/extended_context.py,sha256=
|
|
68
|
+
usecortex_ai/types/extended_context.py,sha256=iJKkYJtUWwbKH-CCvm1UVomaqFqG-YXS6U0pmXs7fp0,507
|
|
67
69
|
usecortex_ai/types/fetch_content_data.py,sha256=kIBb282-npL1O1vhAMIX0m3KvV3H2Bk-mifBUcbO3e8,1004
|
|
68
70
|
usecortex_ai/types/file_upload_result.py,sha256=UIqPc63K0MKf-nYsy8fxsui4IKTJ-BxVAetesnKiuzA,738
|
|
69
|
-
usecortex_ai/types/
|
|
71
|
+
usecortex_ai/types/graph_relations_response.py,sha256=psSKouHYvmMp5nkbRRcIDe87c3vP81Tl4gvqAkeNWbg,966
|
|
70
72
|
usecortex_ai/types/http_validation_error.py,sha256=NNTK9AbbHXm0n9m1YcsG5zEaSn1n6RghohUX5R8LGzw,623
|
|
71
73
|
usecortex_ai/types/list_sources_response.py,sha256=ybvnupTDVoZfDRsS3YdzbLemmqQqf4F31ODP-Fcj0n4,930
|
|
72
74
|
usecortex_ai/types/list_user_memories_response.py,sha256=gsx9pxp2Rsaz0tX2pbGqFFThYF_20XpzwF7BWwOXAGA,906
|
|
73
75
|
usecortex_ai/types/markdown_upload_request.py,sha256=I1Mot_08BgSQyNzgplPHypb_dBKeGKoMuA9MXBqfL7M,1477
|
|
76
|
+
usecortex_ai/types/path_triplet.py,sha256=kQqvCcnVcksob4QyLcRLmnYiTCWjAEyYGmTdEOHJGOE,921
|
|
74
77
|
usecortex_ai/types/processing_status.py,sha256=rwrLBAMexNxRPMCd8PUSs4PHv4lba_0mkUot8iPJWEc,1153
|
|
75
78
|
usecortex_ai/types/related_chunk.py,sha256=Ed7pzlEbycX5kmjvzF5-c9QvwOzyGozTsX9uAQMsDCI,613
|
|
79
|
+
usecortex_ai/types/relation_evidence.py,sha256=Kq61imTYFeAAc3q6MoMhAH3dlUk_MtMFwBxJVOOMJ-8,1806
|
|
76
80
|
usecortex_ai/types/relations.py,sha256=wcnG2_3dfypUkBLSMRxM4ACaQvVA1KhmOY4YwBbJu24,863
|
|
77
|
-
usecortex_ai/types/
|
|
78
|
-
usecortex_ai/types/
|
|
81
|
+
usecortex_ai/types/retrieve_mode.py,sha256=s2nGRBzRRCu5OPIdXi5hhPZ18qBTVz6_T4qU8PoGJr4,156
|
|
82
|
+
usecortex_ai/types/retrieve_response.py,sha256=F07DBfXW-XPjMXlvbxlZqOgnbUq5DigVapA5LGrX4VM,1133
|
|
83
|
+
usecortex_ai/types/retrieve_user_memory_response.py,sha256=Ejc0znd4eYZBt-R-EhXXkdZ1GmNHee2O9VAMaTnHZcc,1204
|
|
84
|
+
usecortex_ai/types/scored_path_response.py,sha256=FKyYOE6YPSRYxM0Du6P-MbFHso9QtLyzHWz3LIhpqW8,1142
|
|
85
|
+
usecortex_ai/types/scored_triplet_response.py,sha256=h5fvRh0UdMo8rHlv3lTXkDaA6DYGl74uPrTzln8zd0o,1037
|
|
86
|
+
usecortex_ai/types/search_chunk.py,sha256=UApf6poJrXILfLKfXtuL7yKEsSYOJgV8qG1Zt9EL4-8,2650
|
|
79
87
|
usecortex_ai/types/single_upload_data.py,sha256=VmuWSY_9zeKrtbj5_WPOZXIJDmqvWqL0Iz7bdq5n6w8,785
|
|
80
88
|
usecortex_ai/types/source.py,sha256=z8RQ4q-ZweoMJ6DR1dGa4YBlXHjMX7-tfk6l_R3EFMw,1411
|
|
81
89
|
usecortex_ai/types/source_model.py,sha256=HM5jA8UmLDQk8UfPt3J3ZNAA3eT6k19WwZ20m-TzWOk,2874
|
|
82
90
|
usecortex_ai/types/sub_tenant_ids_data.py,sha256=D8uiE1JwPx8KJd-Y_tm6FVooSM_QO9JQBBDpz_Lnz8o,1271
|
|
83
91
|
usecortex_ai/types/tenant_create_data.py,sha256=wpg53JzFfquwtNAsz0B4eG3NP39jmGvVZ0SiBwk2_n4,988
|
|
84
92
|
usecortex_ai/types/tenant_stats.py,sha256=NMjla1aHriQIB7qiOa5amL9WYFz4vwDFWHHHpyA1ndg,1156
|
|
93
|
+
usecortex_ai/types/triple_with_evidence.py,sha256=VLGI3SYZZydotds4bNvmiaEy1v4EtcUpOShfBcXE-gg,843
|
|
94
|
+
usecortex_ai/types/user_assistant_pair.py,sha256=gg2F3JPsR0WgeeqYa8y8G3_IpyOf9lNSQVGUon9sEhk,698
|
|
85
95
|
usecortex_ai/types/user_memory.py,sha256=_lAM0qXL5cAwfLeeWs4_m8VZ2BtkFrGBYk5dip7k7KI,778
|
|
86
96
|
usecortex_ai/types/validation_error.py,sha256=Ou-GSQTdmDFWIFlP_y9ka_EUAavqFEFLonU9srAkJdc,642
|
|
87
97
|
usecortex_ai/types/validation_error_loc_item.py,sha256=LAtjCHIllWRBFXvAZ5QZpp7CPXjdtN9EB7HrLVo6EP0,128
|
|
98
|
+
usecortex_ai/types/webpage_scrape_request.py,sha256=7tAPVdqnjQ549kJB9ztKF7RtGWUOHo2Tmbp02PMWwWw,794
|
|
88
99
|
usecortex_ai/upload/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
|
|
89
|
-
usecortex_ai/upload/client.py,sha256=
|
|
90
|
-
usecortex_ai/upload/raw_client.py,sha256=
|
|
100
|
+
usecortex_ai/upload/client.py,sha256=MeJ9M03ZZsuMjYjXhd3lag48FJ8wAYouKY6wIjy17WU,91473
|
|
101
|
+
usecortex_ai/upload/raw_client.py,sha256=wroi3PVe5J37TWpJmbw9Uo6U1XXEGBUgVjOKYqo44Z0,229362
|
|
91
102
|
usecortex_ai/user/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
|
|
92
103
|
usecortex_ai/user/client.py,sha256=w11KTvMzLB862OY46FgoRhVde5SvcaXLbEmnxxryk80,4802
|
|
93
104
|
usecortex_ai/user/raw_client.py,sha256=RnloKJVojvAknaylQknMUY9kS0HwP6_QjcmMuFvviAs,12740
|
|
94
105
|
usecortex_ai/user_memory/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
|
|
95
|
-
usecortex_ai/user_memory/client.py,sha256=
|
|
96
|
-
usecortex_ai/user_memory/raw_client.py,sha256=
|
|
97
|
-
usecortex_ai-0.3.
|
|
98
|
-
usecortex_ai-0.3.
|
|
99
|
-
usecortex_ai-0.3.
|
|
100
|
-
usecortex_ai-0.3.
|
|
101
|
-
usecortex_ai-0.3.
|
|
106
|
+
usecortex_ai/user_memory/client.py,sha256=nMMtfUjCygTg02GhGHGMYOq9wzzpzl3B0TiG6BD40CU,18812
|
|
107
|
+
usecortex_ai/user_memory/raw_client.py,sha256=Tw5Q4QTqAGV-9y3AN-j4rcezUG5dZUpTDi9lp0bUAoQ,49956
|
|
108
|
+
usecortex_ai-0.3.6.dist-info/licenses/LICENSE,sha256=Y4M0dr3NLw8mFQQ2MBdnC0YsrmcJ93WZ7-DgCliupK8,1245
|
|
109
|
+
usecortex_ai-0.3.6.dist-info/METADATA,sha256=qWHXXEtauBE49wG0oqUqLMn-TvOPRCqSYEpn_bk33BU,7950
|
|
110
|
+
usecortex_ai-0.3.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
111
|
+
usecortex_ai-0.3.6.dist-info/top_level.txt,sha256=TQ77el6hL0CvN7BTXJVFTqZ5ot1_kHKo2ZnEcOvZsjo,13
|
|
112
|
+
usecortex_ai-0.3.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|