usecortex-ai 0.3.3__py3-none-any.whl → 0.3.5__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.
@@ -16,6 +16,7 @@ from ..errors.service_unavailable_error import ServiceUnavailableError
16
16
  from ..errors.unauthorized_error import UnauthorizedError
17
17
  from ..errors.unprocessable_entity_error import UnprocessableEntityError
18
18
  from ..types.actual_error_response import ActualErrorResponse
19
+ from ..types.graph_relations_response import GraphRelationsResponse
19
20
  from ..types.list_sources_response import ListSourcesResponse
20
21
 
21
22
  # this is used as the default value for optional parameters
@@ -297,6 +298,142 @@ class RawSourcesClient:
297
298
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
298
299
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
299
300
 
301
+ def get_graph_relations_by_id(
302
+ self,
303
+ *,
304
+ source_id: str,
305
+ tenant_id: typing.Optional[str] = None,
306
+ sub_tenant_id: typing.Optional[str] = None,
307
+ request_options: typing.Optional[RequestOptions] = None,
308
+ ) -> HttpResponse[GraphRelationsResponse]:
309
+ """
310
+ Retrieve relations for a specific source.
311
+
312
+ Use this endpoint to fetch all relations associated with a specific source. This is useful when you need to understand the relationships between entities within a source.
313
+
314
+ Provide the source ID in the request body along with your tenant information to get the relations for that source.
315
+
316
+ Parameters
317
+ ----------
318
+ source_id : str
319
+ The source ID to fetch relations for
320
+
321
+ tenant_id : typing.Optional[str]
322
+ Unique identifier for the tenant/organization
323
+
324
+ sub_tenant_id : typing.Optional[str]
325
+ Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
326
+
327
+ request_options : typing.Optional[RequestOptions]
328
+ Request-specific configuration.
329
+
330
+ Returns
331
+ -------
332
+ HttpResponse[GraphRelationsResponse]
333
+ Successful Response
334
+ """
335
+ _response = self._client_wrapper.httpx_client.request(
336
+ "list/graph_relations_by_id",
337
+ method="GET",
338
+ params={
339
+ "source_id": source_id,
340
+ "tenant_id": tenant_id,
341
+ "sub_tenant_id": sub_tenant_id,
342
+ },
343
+ request_options=request_options,
344
+ )
345
+ try:
346
+ if 200 <= _response.status_code < 300:
347
+ _data = typing.cast(
348
+ GraphRelationsResponse,
349
+ parse_obj_as(
350
+ type_=GraphRelationsResponse, # type: ignore
351
+ object_=_response.json(),
352
+ ),
353
+ )
354
+ return HttpResponse(response=_response, data=_data)
355
+ if _response.status_code == 400:
356
+ raise BadRequestError(
357
+ headers=dict(_response.headers),
358
+ body=typing.cast(
359
+ ActualErrorResponse,
360
+ parse_obj_as(
361
+ type_=ActualErrorResponse, # type: ignore
362
+ object_=_response.json(),
363
+ ),
364
+ ),
365
+ )
366
+ if _response.status_code == 401:
367
+ raise UnauthorizedError(
368
+ headers=dict(_response.headers),
369
+ body=typing.cast(
370
+ ActualErrorResponse,
371
+ parse_obj_as(
372
+ type_=ActualErrorResponse, # type: ignore
373
+ object_=_response.json(),
374
+ ),
375
+ ),
376
+ )
377
+ if _response.status_code == 403:
378
+ raise ForbiddenError(
379
+ headers=dict(_response.headers),
380
+ body=typing.cast(
381
+ ActualErrorResponse,
382
+ parse_obj_as(
383
+ type_=ActualErrorResponse, # type: ignore
384
+ object_=_response.json(),
385
+ ),
386
+ ),
387
+ )
388
+ if _response.status_code == 404:
389
+ raise NotFoundError(
390
+ headers=dict(_response.headers),
391
+ body=typing.cast(
392
+ ActualErrorResponse,
393
+ parse_obj_as(
394
+ type_=ActualErrorResponse, # type: ignore
395
+ object_=_response.json(),
396
+ ),
397
+ ),
398
+ )
399
+ if _response.status_code == 422:
400
+ raise UnprocessableEntityError(
401
+ headers=dict(_response.headers),
402
+ body=typing.cast(
403
+ typing.Optional[typing.Any],
404
+ parse_obj_as(
405
+ type_=typing.Optional[typing.Any], # type: ignore
406
+ object_=_response.json(),
407
+ ),
408
+ ),
409
+ )
410
+ if _response.status_code == 500:
411
+ raise InternalServerError(
412
+ headers=dict(_response.headers),
413
+ body=typing.cast(
414
+ ActualErrorResponse,
415
+ parse_obj_as(
416
+ type_=ActualErrorResponse, # type: ignore
417
+ object_=_response.json(),
418
+ ),
419
+ ),
420
+ )
421
+ if _response.status_code == 503:
422
+ raise ServiceUnavailableError(
423
+ headers=dict(_response.headers),
424
+ body=typing.cast(
425
+ ActualErrorResponse,
426
+ parse_obj_as(
427
+ type_=ActualErrorResponse, # type: ignore
428
+ object_=_response.json(),
429
+ ),
430
+ ),
431
+ )
432
+ _response_json = _response.json()
433
+ except JSONDecodeError:
434
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
435
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
436
+
300
437
 
301
438
  class AsyncRawSourcesClient:
302
439
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -572,3 +709,139 @@ class AsyncRawSourcesClient:
572
709
  except JSONDecodeError:
573
710
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
574
711
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
712
+
713
+ async def get_graph_relations_by_id(
714
+ self,
715
+ *,
716
+ source_id: str,
717
+ tenant_id: typing.Optional[str] = None,
718
+ sub_tenant_id: typing.Optional[str] = None,
719
+ request_options: typing.Optional[RequestOptions] = None,
720
+ ) -> AsyncHttpResponse[GraphRelationsResponse]:
721
+ """
722
+ Retrieve relations for a specific source.
723
+
724
+ Use this endpoint to fetch all relations associated with a specific source. This is useful when you need to understand the relationships between entities within a source.
725
+
726
+ Provide the source ID in the request body along with your tenant information to get the relations for that source.
727
+
728
+ Parameters
729
+ ----------
730
+ source_id : str
731
+ The source ID to fetch relations for
732
+
733
+ tenant_id : typing.Optional[str]
734
+ Unique identifier for the tenant/organization
735
+
736
+ sub_tenant_id : typing.Optional[str]
737
+ Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
738
+
739
+ request_options : typing.Optional[RequestOptions]
740
+ Request-specific configuration.
741
+
742
+ Returns
743
+ -------
744
+ AsyncHttpResponse[GraphRelationsResponse]
745
+ Successful Response
746
+ """
747
+ _response = await self._client_wrapper.httpx_client.request(
748
+ "list/graph_relations_by_id",
749
+ method="GET",
750
+ params={
751
+ "source_id": source_id,
752
+ "tenant_id": tenant_id,
753
+ "sub_tenant_id": sub_tenant_id,
754
+ },
755
+ request_options=request_options,
756
+ )
757
+ try:
758
+ if 200 <= _response.status_code < 300:
759
+ _data = typing.cast(
760
+ GraphRelationsResponse,
761
+ parse_obj_as(
762
+ type_=GraphRelationsResponse, # type: ignore
763
+ object_=_response.json(),
764
+ ),
765
+ )
766
+ return AsyncHttpResponse(response=_response, data=_data)
767
+ if _response.status_code == 400:
768
+ raise BadRequestError(
769
+ headers=dict(_response.headers),
770
+ body=typing.cast(
771
+ ActualErrorResponse,
772
+ parse_obj_as(
773
+ type_=ActualErrorResponse, # type: ignore
774
+ object_=_response.json(),
775
+ ),
776
+ ),
777
+ )
778
+ if _response.status_code == 401:
779
+ raise UnauthorizedError(
780
+ headers=dict(_response.headers),
781
+ body=typing.cast(
782
+ ActualErrorResponse,
783
+ parse_obj_as(
784
+ type_=ActualErrorResponse, # type: ignore
785
+ object_=_response.json(),
786
+ ),
787
+ ),
788
+ )
789
+ if _response.status_code == 403:
790
+ raise ForbiddenError(
791
+ headers=dict(_response.headers),
792
+ body=typing.cast(
793
+ ActualErrorResponse,
794
+ parse_obj_as(
795
+ type_=ActualErrorResponse, # type: ignore
796
+ object_=_response.json(),
797
+ ),
798
+ ),
799
+ )
800
+ if _response.status_code == 404:
801
+ raise NotFoundError(
802
+ headers=dict(_response.headers),
803
+ body=typing.cast(
804
+ ActualErrorResponse,
805
+ parse_obj_as(
806
+ type_=ActualErrorResponse, # type: ignore
807
+ object_=_response.json(),
808
+ ),
809
+ ),
810
+ )
811
+ if _response.status_code == 422:
812
+ raise UnprocessableEntityError(
813
+ headers=dict(_response.headers),
814
+ body=typing.cast(
815
+ typing.Optional[typing.Any],
816
+ parse_obj_as(
817
+ type_=typing.Optional[typing.Any], # type: ignore
818
+ object_=_response.json(),
819
+ ),
820
+ ),
821
+ )
822
+ if _response.status_code == 500:
823
+ raise InternalServerError(
824
+ headers=dict(_response.headers),
825
+ body=typing.cast(
826
+ ActualErrorResponse,
827
+ parse_obj_as(
828
+ type_=ActualErrorResponse, # type: ignore
829
+ object_=_response.json(),
830
+ ),
831
+ ),
832
+ )
833
+ if _response.status_code == 503:
834
+ raise ServiceUnavailableError(
835
+ headers=dict(_response.headers),
836
+ body=typing.cast(
837
+ ActualErrorResponse,
838
+ parse_obj_as(
839
+ type_=ActualErrorResponse, # type: ignore
840
+ object_=_response.json(),
841
+ ),
842
+ ),
843
+ )
844
+ _response_json = _response.json()
845
+ except JSONDecodeError:
846
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
847
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
@@ -19,18 +19,22 @@ from .embeddings_create_collection_data import EmbeddingsCreateCollectionData
19
19
  from .embeddings_delete_data import EmbeddingsDeleteData
20
20
  from .embeddings_get_data import EmbeddingsGetData
21
21
  from .embeddings_search_data import EmbeddingsSearchData
22
+ from .entity import Entity
22
23
  from .error_response import ErrorResponse
23
24
  from .extended_context import ExtendedContext
24
25
  from .fetch_content_data import FetchContentData
25
26
  from .file_upload_result import FileUploadResult
26
- from .generate_user_memory_response import GenerateUserMemoryResponse
27
+ from .graph_relations_response import GraphRelationsResponse
27
28
  from .http_validation_error import HttpValidationError
28
29
  from .list_sources_response import ListSourcesResponse
29
30
  from .list_user_memories_response import ListUserMemoriesResponse
30
31
  from .markdown_upload_request import MarkdownUploadRequest
31
32
  from .processing_status import ProcessingStatus
32
33
  from .related_chunk import RelatedChunk
34
+ from .relation_evidence import RelationEvidence
33
35
  from .relations import Relations
36
+ from .retrieve_mode import RetrieveMode
37
+ from .retrieve_response import RetrieveResponse
34
38
  from .retrieve_user_memory_response import RetrieveUserMemoryResponse
35
39
  from .search_chunk import SearchChunk
36
40
  from .single_upload_data import SingleUploadData
@@ -39,9 +43,12 @@ from .source_model import SourceModel
39
43
  from .sub_tenant_ids_data import SubTenantIdsData
40
44
  from .tenant_create_data import TenantCreateData
41
45
  from .tenant_stats import TenantStats
46
+ from .triple_with_evidence import TripleWithEvidence
47
+ from .user_assistant_pair import UserAssistantPair
42
48
  from .user_memory import UserMemory
43
49
  from .validation_error import ValidationError
44
50
  from .validation_error_loc_item import ValidationErrorLocItem
51
+ from .webpage_scrape_request import WebpageScrapeRequest
45
52
 
46
53
  __all__ = [
47
54
  "ActualErrorResponse",
@@ -61,18 +68,22 @@ __all__ = [
61
68
  "EmbeddingsDeleteData",
62
69
  "EmbeddingsGetData",
63
70
  "EmbeddingsSearchData",
71
+ "Entity",
64
72
  "ErrorResponse",
65
73
  "ExtendedContext",
66
74
  "FetchContentData",
67
75
  "FileUploadResult",
68
- "GenerateUserMemoryResponse",
76
+ "GraphRelationsResponse",
69
77
  "HttpValidationError",
70
78
  "ListSourcesResponse",
71
79
  "ListUserMemoriesResponse",
72
80
  "MarkdownUploadRequest",
73
81
  "ProcessingStatus",
74
82
  "RelatedChunk",
83
+ "RelationEvidence",
75
84
  "Relations",
85
+ "RetrieveMode",
86
+ "RetrieveResponse",
76
87
  "RetrieveUserMemoryResponse",
77
88
  "SearchChunk",
78
89
  "SingleUploadData",
@@ -81,7 +92,10 @@ __all__ = [
81
92
  "SubTenantIdsData",
82
93
  "TenantCreateData",
83
94
  "TenantStats",
95
+ "TripleWithEvidence",
96
+ "UserAssistantPair",
84
97
  "UserMemory",
85
98
  "ValidationError",
86
99
  "ValidationErrorLocItem",
100
+ "WebpageScrapeRequest",
87
101
  ]
@@ -21,11 +21,16 @@ class AddUserMemoryResponse(UniversalBaseModel):
21
21
  Confirms whether the memory was successfully stored in the system
22
22
  """
23
23
 
24
- memory_id: typing.Optional[str] = pydantic.Field(default=None)
24
+ memory_id: str = pydantic.Field()
25
25
  """
26
26
  Unique identifier assigned to the newly created memory
27
27
  """
28
28
 
29
+ chunks_created: typing.Optional[int] = pydantic.Field(default=None)
30
+ """
31
+ Total number of chunks created from the memory
32
+ """
33
+
29
34
  if IS_PYDANTIC_V2:
30
35
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
31
36
  else:
@@ -0,0 +1,42 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class Entity(UniversalBaseModel):
10
+ name: str = pydantic.Field()
11
+ """
12
+ Normalized entity name
13
+ """
14
+
15
+ type: str = pydantic.Field()
16
+ """
17
+ PERSON, ORGANIZATION, PROJECT, PRODUCT, ERROR_CODE, etc.
18
+ """
19
+
20
+ namespace: typing.Optional[str] = pydantic.Field(default=None)
21
+ """
22
+ Context category like 'employees', 'projects'
23
+ """
24
+
25
+ identifier: typing.Optional[str] = pydantic.Field(default=None)
26
+ """
27
+ Unique ID like email, employee_id, URL
28
+ """
29
+
30
+ entity_id: typing.Optional[str] = pydantic.Field(default=None)
31
+ """
32
+ Internal unique entity ID from graph database
33
+ """
34
+
35
+ if IS_PYDANTIC_V2:
36
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
37
+ else:
38
+
39
+ class Config:
40
+ frozen = True
41
+ smart_union = True
42
+ extra = pydantic.Extra.allow
@@ -4,11 +4,14 @@ import typing
4
4
 
5
5
  import pydantic
6
6
  from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
- from .related_chunk import RelatedChunk
7
+ from .triple_with_evidence import TripleWithEvidence
8
8
 
9
9
 
10
10
  class ExtendedContext(UniversalBaseModel):
11
- relations: typing.Optional[typing.List[RelatedChunk]] = None
11
+ chunk_relations: typing.Optional[typing.List[TripleWithEvidence]] = pydantic.Field(default=None)
12
+ """
13
+ Relations linked with this chunk
14
+ """
12
15
 
13
16
  if IS_PYDANTIC_V2:
14
17
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -0,0 +1,33 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .triple_with_evidence import TripleWithEvidence
8
+
9
+
10
+ class GraphRelationsResponse(UniversalBaseModel):
11
+ relations: typing.List[typing.Optional[TripleWithEvidence]] = pydantic.Field()
12
+ """
13
+ List of relations retrieved
14
+ """
15
+
16
+ success: typing.Optional[bool] = pydantic.Field(default=None)
17
+ """
18
+ Indicates whether the request was successful
19
+ """
20
+
21
+ message: typing.Optional[str] = pydantic.Field(default=None)
22
+ """
23
+ Response message describing the operation result
24
+ """
25
+
26
+ if IS_PYDANTIC_V2:
27
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
28
+ else:
29
+
30
+ class Config:
31
+ frozen = True
32
+ smart_union = True
33
+ extra = pydantic.Extra.allow
@@ -14,7 +14,12 @@ class ProcessingStatus(UniversalBaseModel):
14
14
 
15
15
  indexing_status: str = pydantic.Field()
16
16
  """
17
- Current status of the file. Possible values are 'queued', 'processing', 'completed', 'failed'
17
+ Current status of the file. Possible values are 'queued', 'processing', 'completed', 'errored'
18
+ """
19
+
20
+ error_code: typing.Optional[str] = pydantic.Field(default=None)
21
+ """
22
+ Error code for the file. You may share this code with us to help us diagnose and resolve the issue.
18
23
  """
19
24
 
20
25
  success: typing.Optional[bool] = None
@@ -0,0 +1,52 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ import pydantic
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+
9
+
10
+ class RelationEvidence(UniversalBaseModel):
11
+ """
12
+ Single piece of evidence for a relationship between two entities
13
+ """
14
+
15
+ canonical_predicate: str = pydantic.Field()
16
+ """
17
+ Relationship phrase like 'works for', 'reports to'
18
+ """
19
+
20
+ raw_predicate: str = pydantic.Field()
21
+ """
22
+ Original predicate from text
23
+ """
24
+
25
+ context: str = pydantic.Field()
26
+ """
27
+ Rich contextual description of the relationship with surrounding information, details about how/why/when, and any relevant background. Should be comprehensive enough to understand the relationship without referring back to source.
28
+ """
29
+
30
+ confidence: typing.Optional[float] = pydantic.Field(default=None)
31
+ """
32
+ Confidence score
33
+ """
34
+
35
+ temporal_details: typing.Optional[str] = pydantic.Field(default=None)
36
+ """
37
+ Temporal timing information extracted from text (e.g., 'last week', 'in 2023', 'yesterday')
38
+ """
39
+
40
+ timestamp: typing.Optional[dt.datetime] = pydantic.Field(default=None)
41
+ """
42
+ Timestamp when this relation was introduced
43
+ """
44
+
45
+ if IS_PYDANTIC_V2:
46
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
47
+ else:
48
+
49
+ class Config:
50
+ frozen = True
51
+ smart_union = True
52
+ extra = pydantic.Extra.allow
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ RetrieveMode = typing.Union[typing.Literal["fast", "accurate"], typing.Any]
@@ -0,0 +1,34 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .search_chunk import SearchChunk
8
+ from .triple_with_evidence import TripleWithEvidence
9
+
10
+
11
+ class RetrieveResponse(UniversalBaseModel):
12
+ chunks: typing.Optional[typing.List[SearchChunk]] = pydantic.Field(default=None)
13
+ """
14
+ Retrieved content chunks
15
+ """
16
+
17
+ extra_graph_context: typing.Optional[typing.List[TripleWithEvidence]] = pydantic.Field(default=None)
18
+ """
19
+ Extra graph context which will help you agent get better understanding of the entities involved in query.
20
+ """
21
+
22
+ metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
23
+ """
24
+ Additional metadata about the retrieval run
25
+ """
26
+
27
+ if IS_PYDANTIC_V2:
28
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
29
+ else:
30
+
31
+ class Config:
32
+ frozen = True
33
+ smart_union = True
34
+ extra = pydantic.Extra.allow
@@ -4,6 +4,7 @@ import typing
4
4
 
5
5
  import pydantic
6
6
  from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .triple_with_evidence import TripleWithEvidence
7
8
  from .user_memory import UserMemory
8
9
 
9
10
 
@@ -22,6 +23,11 @@ class RetrieveUserMemoryResponse(UniversalBaseModel):
22
23
  Array of user memories ranked by relevance to your search query
23
24
  """
24
25
 
26
+ relations: typing.Optional[typing.List[TripleWithEvidence]] = pydantic.Field(default=None)
27
+ """
28
+ Array of relations extracted from the user query
29
+ """
30
+
25
31
  if IS_PYDANTIC_V2:
26
32
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
27
33
  else:
@@ -4,6 +4,7 @@ import typing
4
4
 
5
5
  import pydantic
6
6
  from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .extended_context import ExtendedContext
7
8
 
8
9
 
9
10
  class SearchChunk(UniversalBaseModel):
@@ -62,6 +63,11 @@ class SearchChunk(UniversalBaseModel):
62
63
  Custom metadata associated with your tenant
63
64
  """
64
65
 
66
+ extra_context: typing.Optional[ExtendedContext] = pydantic.Field(default=None)
67
+ """
68
+ Additional context for this chunk
69
+ """
70
+
65
71
  if IS_PYDANTIC_V2:
66
72
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
67
73
  else:
@@ -4,22 +4,25 @@ import typing
4
4
 
5
5
  import pydantic
6
6
  from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
- from .user_memory import UserMemory
7
+ from .entity import Entity
8
+ from .relation_evidence import RelationEvidence
8
9
 
9
10
 
10
- class GenerateUserMemoryResponse(UniversalBaseModel):
11
+ class TripleWithEvidence(UniversalBaseModel):
11
12
  """
12
- Response model for AI-generated user memories.
13
+ Triple with multiple evidence items from different chunks
13
14
  """
14
15
 
15
- success: bool = pydantic.Field()
16
+ source: Entity
17
+ target: Entity
18
+ relations: typing.List[RelationEvidence] = pydantic.Field()
16
19
  """
17
- Indicates whether the memory generation operation was successful
20
+ Array of relation evidences
18
21
  """
19
22
 
20
- generated_user_memories: typing.Optional[typing.List[UserMemory]] = pydantic.Field(default=None)
23
+ chunk_id: str = pydantic.Field()
21
24
  """
22
- Array of AI-generated memories based on your query and user context
25
+ The chunk_id these relations are associated with
23
26
  """
24
27
 
25
28
  if IS_PYDANTIC_V2: