zep-cloud 2.4.0__tar.gz → 2.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/PKG-INFO +1 -1
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/pyproject.toml +7 -5
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/__init__.py +4 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/core/client_wrapper.py +1 -1
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/document/client.py +8 -8
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/graph/client.py +280 -4
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/graph/edge/client.py +8 -8
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/graph/episode/client.py +8 -8
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/graph/node/client.py +6 -6
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/group/client.py +170 -26
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/memory/client.py +95 -84
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/__init__.py +4 -0
- zep_cloud-2.6.0/src/zep_cloud/types/add_triple_response.py +33 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/classify_session_request.py +2 -2
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/entity_node.py +5 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/fact.py +1 -1
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/group.py +5 -5
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/memory.py +3 -5
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/message.py +3 -3
- zep_cloud-2.6.0/src/zep_cloud/types/search_filters.py +32 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/session.py +16 -8
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/user.py +15 -3
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/user/client.py +16 -16
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/LICENSE +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/README.md +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/base_client.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/client.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/core/__init__.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/core/api_error.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/core/datetime_utils.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/core/file.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/core/http_client.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/core/jsonable_encoder.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/core/pydantic_utilities.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/core/query_encoder.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/core/remove_none_from_dict.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/core/request_options.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/document/__init__.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/environment.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/errors/__init__.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/errors/bad_request_error.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/errors/conflict_error.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/errors/internal_server_error.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/errors/not_found_error.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/errors/unauthorized_error.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/external_clients/document.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/external_clients/memory.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/external_clients/user.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/extractor/__init__.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/extractor/models.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/graph/__init__.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/graph/edge/__init__.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/graph/episode/__init__.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/graph/node/__init__.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/group/__init__.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/memory/__init__.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/py.typed +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/add_memory_response.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/api_error.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/apidata_document.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/apidata_document_collection.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/apidata_document_search_response.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/apidata_document_with_score.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/create_document_request.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/end_session_response.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/end_sessions_response.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/entity_edge.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/episode.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/episode_response.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/fact_rating_examples.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/fact_rating_instruction.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/fact_response.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/facts_response.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/graph_data_type.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/graph_search_results.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/graph_search_scope.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/group_list_response.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/memory_search_result.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/message_list_response.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/new_fact.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/question.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/reranker.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/role_type.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/search_scope.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/search_type.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/session_classification.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/session_list_response.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/session_search_response.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/session_search_result.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/success_response.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/summary.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/summary_list_response.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/update_document_list_request.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/user_list_response.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/types/user_node_response.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/user/__init__.py +0 -0
- {zep_cloud-2.4.0 → zep_cloud-2.6.0}/src/zep_cloud/version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "zep-cloud"
|
|
3
|
-
version = "2.
|
|
3
|
+
version = "2.6.0"
|
|
4
4
|
description = ""
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = []
|
|
@@ -17,10 +17,12 @@ mypy = "1.9.0"
|
|
|
17
17
|
pytest = "^7.4.0"
|
|
18
18
|
pytest-asyncio = "^0.23.5"
|
|
19
19
|
python-dateutil = "^2.9.0"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
langchain-openai = "^0.3
|
|
23
|
-
|
|
20
|
+
langchain = "^0.1.3"
|
|
21
|
+
openai = "^1.9.0"
|
|
22
|
+
langchain-openai = "^0.0.3"
|
|
23
|
+
black = "^24.4.2"
|
|
24
|
+
ruff = "^0.4.8"
|
|
25
|
+
ipykernel = "^6.29.4"
|
|
24
26
|
|
|
25
27
|
[tool.pytest.ini_options]
|
|
26
28
|
testpaths = ["tests"]
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from .types import (
|
|
4
4
|
AddMemoryResponse,
|
|
5
|
+
AddTripleResponse,
|
|
5
6
|
ApiError,
|
|
6
7
|
ApidataDocument,
|
|
7
8
|
ApidataDocumentCollection,
|
|
@@ -33,6 +34,7 @@ from .types import (
|
|
|
33
34
|
Question,
|
|
34
35
|
Reranker,
|
|
35
36
|
RoleType,
|
|
37
|
+
SearchFilters,
|
|
36
38
|
SearchScope,
|
|
37
39
|
SearchType,
|
|
38
40
|
Session,
|
|
@@ -55,6 +57,7 @@ from .version import __version__
|
|
|
55
57
|
|
|
56
58
|
__all__ = [
|
|
57
59
|
"AddMemoryResponse",
|
|
60
|
+
"AddTripleResponse",
|
|
58
61
|
"ApiError",
|
|
59
62
|
"ApidataDocument",
|
|
60
63
|
"ApidataDocumentCollection",
|
|
@@ -90,6 +93,7 @@ __all__ = [
|
|
|
90
93
|
"Question",
|
|
91
94
|
"Reranker",
|
|
92
95
|
"RoleType",
|
|
96
|
+
"SearchFilters",
|
|
93
97
|
"SearchScope",
|
|
94
98
|
"SearchType",
|
|
95
99
|
"Session",
|
|
@@ -17,7 +17,7 @@ class BaseClientWrapper:
|
|
|
17
17
|
headers: typing.Dict[str, str] = {
|
|
18
18
|
"X-Fern-Language": "Python",
|
|
19
19
|
"X-Fern-SDK-Name": "zep-cloud",
|
|
20
|
-
"X-Fern-SDK-Version": "2.
|
|
20
|
+
"X-Fern-SDK-Version": "2.6.0",
|
|
21
21
|
}
|
|
22
22
|
headers["Authorization"] = f"Api-Key {self.api_key}"
|
|
23
23
|
return headers
|
|
@@ -595,7 +595,7 @@ class DocumentClient:
|
|
|
595
595
|
raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text)
|
|
596
596
|
raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json)
|
|
597
597
|
|
|
598
|
-
def
|
|
598
|
+
def gets_a_document_from_a_document_collection_by_uuid(
|
|
599
599
|
self, collection_name: str, document_uuid: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
600
600
|
) -> ApidataDocument:
|
|
601
601
|
"""
|
|
@@ -624,7 +624,7 @@ class DocumentClient:
|
|
|
624
624
|
client = Zep(
|
|
625
625
|
api_key="YOUR_API_KEY",
|
|
626
626
|
)
|
|
627
|
-
client.document.
|
|
627
|
+
client.document.gets_a_document_from_a_document_collection_by_uuid(
|
|
628
628
|
collection_name="collectionName",
|
|
629
629
|
document_uuid="documentUUID",
|
|
630
630
|
)
|
|
@@ -717,7 +717,7 @@ class DocumentClient:
|
|
|
717
717
|
raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text)
|
|
718
718
|
raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json)
|
|
719
719
|
|
|
720
|
-
def
|
|
720
|
+
def updates_a_document(
|
|
721
721
|
self,
|
|
722
722
|
collection_name: str,
|
|
723
723
|
document_uuid: str,
|
|
@@ -756,7 +756,7 @@ class DocumentClient:
|
|
|
756
756
|
client = Zep(
|
|
757
757
|
api_key="YOUR_API_KEY",
|
|
758
758
|
)
|
|
759
|
-
client.document.
|
|
759
|
+
client.document.updates_a_document(
|
|
760
760
|
collection_name="collectionName",
|
|
761
761
|
document_uuid="documentUUID",
|
|
762
762
|
)
|
|
@@ -1525,7 +1525,7 @@ class AsyncDocumentClient:
|
|
|
1525
1525
|
raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text)
|
|
1526
1526
|
raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json)
|
|
1527
1527
|
|
|
1528
|
-
async def
|
|
1528
|
+
async def gets_a_document_from_a_document_collection_by_uuid(
|
|
1529
1529
|
self, collection_name: str, document_uuid: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
1530
1530
|
) -> ApidataDocument:
|
|
1531
1531
|
"""
|
|
@@ -1559,7 +1559,7 @@ class AsyncDocumentClient:
|
|
|
1559
1559
|
|
|
1560
1560
|
|
|
1561
1561
|
async def main() -> None:
|
|
1562
|
-
await client.document.
|
|
1562
|
+
await client.document.gets_a_document_from_a_document_collection_by_uuid(
|
|
1563
1563
|
collection_name="collectionName",
|
|
1564
1564
|
document_uuid="documentUUID",
|
|
1565
1565
|
)
|
|
@@ -1663,7 +1663,7 @@ class AsyncDocumentClient:
|
|
|
1663
1663
|
raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text)
|
|
1664
1664
|
raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json)
|
|
1665
1665
|
|
|
1666
|
-
async def
|
|
1666
|
+
async def updates_a_document(
|
|
1667
1667
|
self,
|
|
1668
1668
|
collection_name: str,
|
|
1669
1669
|
document_uuid: str,
|
|
@@ -1707,7 +1707,7 @@ class AsyncDocumentClient:
|
|
|
1707
1707
|
|
|
1708
1708
|
|
|
1709
1709
|
async def main() -> None:
|
|
1710
|
-
await client.document.
|
|
1710
|
+
await client.document.updates_a_document(
|
|
1711
1711
|
collection_name="collectionName",
|
|
1712
1712
|
document_uuid="documentUUID",
|
|
1713
1713
|
)
|
|
@@ -9,11 +9,13 @@ from ..core.pydantic_utilities import pydantic_v1
|
|
|
9
9
|
from ..core.request_options import RequestOptions
|
|
10
10
|
from ..errors.bad_request_error import BadRequestError
|
|
11
11
|
from ..errors.internal_server_error import InternalServerError
|
|
12
|
+
from ..types.add_triple_response import AddTripleResponse
|
|
12
13
|
from ..types.api_error import ApiError as types_api_error_ApiError
|
|
13
14
|
from ..types.graph_data_type import GraphDataType
|
|
14
15
|
from ..types.graph_search_results import GraphSearchResults
|
|
15
16
|
from ..types.graph_search_scope import GraphSearchScope
|
|
16
17
|
from ..types.reranker import Reranker
|
|
18
|
+
from ..types.search_filters import SearchFilters
|
|
17
19
|
from ..types.success_response import SuccessResponse
|
|
18
20
|
from .edge.client import AsyncEdgeClient, EdgeClient
|
|
19
21
|
from .episode.client import AsyncEpisodeClient, EpisodeClient
|
|
@@ -40,7 +42,7 @@ class GraphClient:
|
|
|
40
42
|
request_options: typing.Optional[RequestOptions] = None
|
|
41
43
|
) -> SuccessResponse:
|
|
42
44
|
"""
|
|
43
|
-
Add data to the graph
|
|
45
|
+
Add data to the graph. Note: each subscription tier has different limits on the amount of data that can be added to the graph please refer to the pricing page for more information.
|
|
44
46
|
|
|
45
47
|
Parameters
|
|
46
48
|
----------
|
|
@@ -92,6 +94,134 @@ class GraphClient:
|
|
|
92
94
|
raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text)
|
|
93
95
|
raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json)
|
|
94
96
|
|
|
97
|
+
def add_fact_triple(
|
|
98
|
+
self,
|
|
99
|
+
*,
|
|
100
|
+
fact: str,
|
|
101
|
+
fact_name: str,
|
|
102
|
+
target_node_name: str,
|
|
103
|
+
created_at: typing.Optional[str] = OMIT,
|
|
104
|
+
expired_at: typing.Optional[str] = OMIT,
|
|
105
|
+
fact_uuid: typing.Optional[str] = OMIT,
|
|
106
|
+
group_id: typing.Optional[str] = OMIT,
|
|
107
|
+
invalid_at: typing.Optional[str] = OMIT,
|
|
108
|
+
source_node_name: typing.Optional[str] = OMIT,
|
|
109
|
+
source_node_summary: typing.Optional[str] = OMIT,
|
|
110
|
+
source_node_uuid: typing.Optional[str] = OMIT,
|
|
111
|
+
target_node_summary: typing.Optional[str] = OMIT,
|
|
112
|
+
target_node_uuid: typing.Optional[str] = OMIT,
|
|
113
|
+
user_id: typing.Optional[str] = OMIT,
|
|
114
|
+
valid_at: typing.Optional[str] = OMIT,
|
|
115
|
+
request_options: typing.Optional[RequestOptions] = None
|
|
116
|
+
) -> AddTripleResponse:
|
|
117
|
+
"""
|
|
118
|
+
Add a fact triple for a user or group
|
|
119
|
+
|
|
120
|
+
Parameters
|
|
121
|
+
----------
|
|
122
|
+
fact : str
|
|
123
|
+
The fact relating the two nodes that this edge represents
|
|
124
|
+
|
|
125
|
+
fact_name : str
|
|
126
|
+
The name of the edge to add. Should be all caps using snake case (eg RELATES_TO)
|
|
127
|
+
|
|
128
|
+
target_node_name : str
|
|
129
|
+
The name of the target node to add
|
|
130
|
+
|
|
131
|
+
created_at : typing.Optional[str]
|
|
132
|
+
The timestamp of the message
|
|
133
|
+
|
|
134
|
+
expired_at : typing.Optional[str]
|
|
135
|
+
The time (if any) at which the edge expires
|
|
136
|
+
|
|
137
|
+
fact_uuid : typing.Optional[str]
|
|
138
|
+
The uuid of the edge to add
|
|
139
|
+
|
|
140
|
+
group_id : typing.Optional[str]
|
|
141
|
+
|
|
142
|
+
invalid_at : typing.Optional[str]
|
|
143
|
+
The time (if any) at which the fact stops being true
|
|
144
|
+
|
|
145
|
+
source_node_name : typing.Optional[str]
|
|
146
|
+
The name of the source node to add
|
|
147
|
+
|
|
148
|
+
source_node_summary : typing.Optional[str]
|
|
149
|
+
The summary of the source node to add
|
|
150
|
+
|
|
151
|
+
source_node_uuid : typing.Optional[str]
|
|
152
|
+
The source node uuid
|
|
153
|
+
|
|
154
|
+
target_node_summary : typing.Optional[str]
|
|
155
|
+
The summary of the target node to add
|
|
156
|
+
|
|
157
|
+
target_node_uuid : typing.Optional[str]
|
|
158
|
+
The target node uuid
|
|
159
|
+
|
|
160
|
+
user_id : typing.Optional[str]
|
|
161
|
+
|
|
162
|
+
valid_at : typing.Optional[str]
|
|
163
|
+
The time at which the fact becomes true
|
|
164
|
+
|
|
165
|
+
request_options : typing.Optional[RequestOptions]
|
|
166
|
+
Request-specific configuration.
|
|
167
|
+
|
|
168
|
+
Returns
|
|
169
|
+
-------
|
|
170
|
+
AddTripleResponse
|
|
171
|
+
Resulting triple
|
|
172
|
+
|
|
173
|
+
Examples
|
|
174
|
+
--------
|
|
175
|
+
from zep_cloud.client import Zep
|
|
176
|
+
|
|
177
|
+
client = Zep(
|
|
178
|
+
api_key="YOUR_API_KEY",
|
|
179
|
+
)
|
|
180
|
+
client.graph.add_fact_triple(
|
|
181
|
+
fact="fact",
|
|
182
|
+
fact_name="fact_name",
|
|
183
|
+
target_node_name="target_node_name",
|
|
184
|
+
)
|
|
185
|
+
"""
|
|
186
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
187
|
+
"graph/add-fact-triple",
|
|
188
|
+
method="POST",
|
|
189
|
+
json={
|
|
190
|
+
"created_at": created_at,
|
|
191
|
+
"expired_at": expired_at,
|
|
192
|
+
"fact": fact,
|
|
193
|
+
"fact_name": fact_name,
|
|
194
|
+
"fact_uuid": fact_uuid,
|
|
195
|
+
"group_id": group_id,
|
|
196
|
+
"invalid_at": invalid_at,
|
|
197
|
+
"source_node_name": source_node_name,
|
|
198
|
+
"source_node_summary": source_node_summary,
|
|
199
|
+
"source_node_uuid": source_node_uuid,
|
|
200
|
+
"target_node_name": target_node_name,
|
|
201
|
+
"target_node_summary": target_node_summary,
|
|
202
|
+
"target_node_uuid": target_node_uuid,
|
|
203
|
+
"user_id": user_id,
|
|
204
|
+
"valid_at": valid_at,
|
|
205
|
+
},
|
|
206
|
+
request_options=request_options,
|
|
207
|
+
omit=OMIT,
|
|
208
|
+
)
|
|
209
|
+
try:
|
|
210
|
+
if 200 <= _response.status_code < 300:
|
|
211
|
+
return pydantic_v1.parse_obj_as(AddTripleResponse, _response.json()) # type: ignore
|
|
212
|
+
if _response.status_code == 400:
|
|
213
|
+
raise BadRequestError(
|
|
214
|
+
pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore
|
|
215
|
+
)
|
|
216
|
+
if _response.status_code == 500:
|
|
217
|
+
raise InternalServerError(
|
|
218
|
+
pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore
|
|
219
|
+
)
|
|
220
|
+
_response_json = _response.json()
|
|
221
|
+
except JSONDecodeError:
|
|
222
|
+
raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text)
|
|
223
|
+
raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json)
|
|
224
|
+
|
|
95
225
|
def search(
|
|
96
226
|
self,
|
|
97
227
|
*,
|
|
@@ -103,6 +233,7 @@ class GraphClient:
|
|
|
103
233
|
mmr_lambda: typing.Optional[float] = OMIT,
|
|
104
234
|
reranker: typing.Optional[Reranker] = OMIT,
|
|
105
235
|
scope: typing.Optional[GraphSearchScope] = OMIT,
|
|
236
|
+
search_filters: typing.Optional[SearchFilters] = OMIT,
|
|
106
237
|
user_id: typing.Optional[str] = OMIT,
|
|
107
238
|
request_options: typing.Optional[RequestOptions] = None
|
|
108
239
|
) -> GraphSearchResults:
|
|
@@ -124,7 +255,7 @@ class GraphClient:
|
|
|
124
255
|
The maximum number of facts to retrieve. Defaults to 10. Limited to 50.
|
|
125
256
|
|
|
126
257
|
min_score : typing.Optional[float]
|
|
127
|
-
|
|
258
|
+
Deprecated
|
|
128
259
|
|
|
129
260
|
mmr_lambda : typing.Optional[float]
|
|
130
261
|
weighting for maximal marginal relevance
|
|
@@ -135,6 +266,9 @@ class GraphClient:
|
|
|
135
266
|
scope : typing.Optional[GraphSearchScope]
|
|
136
267
|
Defaults to Edges. Communities will be added in the future.
|
|
137
268
|
|
|
269
|
+
search_filters : typing.Optional[SearchFilters]
|
|
270
|
+
Search filters to apply to the search
|
|
271
|
+
|
|
138
272
|
user_id : typing.Optional[str]
|
|
139
273
|
one of user_id or group_id must be provided
|
|
140
274
|
|
|
@@ -169,6 +303,7 @@ class GraphClient:
|
|
|
169
303
|
"query": query,
|
|
170
304
|
"reranker": reranker,
|
|
171
305
|
"scope": scope,
|
|
306
|
+
"search_filters": search_filters,
|
|
172
307
|
"user_id": user_id,
|
|
173
308
|
},
|
|
174
309
|
request_options=request_options,
|
|
@@ -208,7 +343,7 @@ class AsyncGraphClient:
|
|
|
208
343
|
request_options: typing.Optional[RequestOptions] = None
|
|
209
344
|
) -> SuccessResponse:
|
|
210
345
|
"""
|
|
211
|
-
Add data to the graph
|
|
346
|
+
Add data to the graph. Note: each subscription tier has different limits on the amount of data that can be added to the graph please refer to the pricing page for more information.
|
|
212
347
|
|
|
213
348
|
Parameters
|
|
214
349
|
----------
|
|
@@ -268,6 +403,142 @@ class AsyncGraphClient:
|
|
|
268
403
|
raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text)
|
|
269
404
|
raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json)
|
|
270
405
|
|
|
406
|
+
async def add_fact_triple(
|
|
407
|
+
self,
|
|
408
|
+
*,
|
|
409
|
+
fact: str,
|
|
410
|
+
fact_name: str,
|
|
411
|
+
target_node_name: str,
|
|
412
|
+
created_at: typing.Optional[str] = OMIT,
|
|
413
|
+
expired_at: typing.Optional[str] = OMIT,
|
|
414
|
+
fact_uuid: typing.Optional[str] = OMIT,
|
|
415
|
+
group_id: typing.Optional[str] = OMIT,
|
|
416
|
+
invalid_at: typing.Optional[str] = OMIT,
|
|
417
|
+
source_node_name: typing.Optional[str] = OMIT,
|
|
418
|
+
source_node_summary: typing.Optional[str] = OMIT,
|
|
419
|
+
source_node_uuid: typing.Optional[str] = OMIT,
|
|
420
|
+
target_node_summary: typing.Optional[str] = OMIT,
|
|
421
|
+
target_node_uuid: typing.Optional[str] = OMIT,
|
|
422
|
+
user_id: typing.Optional[str] = OMIT,
|
|
423
|
+
valid_at: typing.Optional[str] = OMIT,
|
|
424
|
+
request_options: typing.Optional[RequestOptions] = None
|
|
425
|
+
) -> AddTripleResponse:
|
|
426
|
+
"""
|
|
427
|
+
Add a fact triple for a user or group
|
|
428
|
+
|
|
429
|
+
Parameters
|
|
430
|
+
----------
|
|
431
|
+
fact : str
|
|
432
|
+
The fact relating the two nodes that this edge represents
|
|
433
|
+
|
|
434
|
+
fact_name : str
|
|
435
|
+
The name of the edge to add. Should be all caps using snake case (eg RELATES_TO)
|
|
436
|
+
|
|
437
|
+
target_node_name : str
|
|
438
|
+
The name of the target node to add
|
|
439
|
+
|
|
440
|
+
created_at : typing.Optional[str]
|
|
441
|
+
The timestamp of the message
|
|
442
|
+
|
|
443
|
+
expired_at : typing.Optional[str]
|
|
444
|
+
The time (if any) at which the edge expires
|
|
445
|
+
|
|
446
|
+
fact_uuid : typing.Optional[str]
|
|
447
|
+
The uuid of the edge to add
|
|
448
|
+
|
|
449
|
+
group_id : typing.Optional[str]
|
|
450
|
+
|
|
451
|
+
invalid_at : typing.Optional[str]
|
|
452
|
+
The time (if any) at which the fact stops being true
|
|
453
|
+
|
|
454
|
+
source_node_name : typing.Optional[str]
|
|
455
|
+
The name of the source node to add
|
|
456
|
+
|
|
457
|
+
source_node_summary : typing.Optional[str]
|
|
458
|
+
The summary of the source node to add
|
|
459
|
+
|
|
460
|
+
source_node_uuid : typing.Optional[str]
|
|
461
|
+
The source node uuid
|
|
462
|
+
|
|
463
|
+
target_node_summary : typing.Optional[str]
|
|
464
|
+
The summary of the target node to add
|
|
465
|
+
|
|
466
|
+
target_node_uuid : typing.Optional[str]
|
|
467
|
+
The target node uuid
|
|
468
|
+
|
|
469
|
+
user_id : typing.Optional[str]
|
|
470
|
+
|
|
471
|
+
valid_at : typing.Optional[str]
|
|
472
|
+
The time at which the fact becomes true
|
|
473
|
+
|
|
474
|
+
request_options : typing.Optional[RequestOptions]
|
|
475
|
+
Request-specific configuration.
|
|
476
|
+
|
|
477
|
+
Returns
|
|
478
|
+
-------
|
|
479
|
+
AddTripleResponse
|
|
480
|
+
Resulting triple
|
|
481
|
+
|
|
482
|
+
Examples
|
|
483
|
+
--------
|
|
484
|
+
import asyncio
|
|
485
|
+
|
|
486
|
+
from zep_cloud.client import AsyncZep
|
|
487
|
+
|
|
488
|
+
client = AsyncZep(
|
|
489
|
+
api_key="YOUR_API_KEY",
|
|
490
|
+
)
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
async def main() -> None:
|
|
494
|
+
await client.graph.add_fact_triple(
|
|
495
|
+
fact="fact",
|
|
496
|
+
fact_name="fact_name",
|
|
497
|
+
target_node_name="target_node_name",
|
|
498
|
+
)
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
asyncio.run(main())
|
|
502
|
+
"""
|
|
503
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
504
|
+
"graph/add-fact-triple",
|
|
505
|
+
method="POST",
|
|
506
|
+
json={
|
|
507
|
+
"created_at": created_at,
|
|
508
|
+
"expired_at": expired_at,
|
|
509
|
+
"fact": fact,
|
|
510
|
+
"fact_name": fact_name,
|
|
511
|
+
"fact_uuid": fact_uuid,
|
|
512
|
+
"group_id": group_id,
|
|
513
|
+
"invalid_at": invalid_at,
|
|
514
|
+
"source_node_name": source_node_name,
|
|
515
|
+
"source_node_summary": source_node_summary,
|
|
516
|
+
"source_node_uuid": source_node_uuid,
|
|
517
|
+
"target_node_name": target_node_name,
|
|
518
|
+
"target_node_summary": target_node_summary,
|
|
519
|
+
"target_node_uuid": target_node_uuid,
|
|
520
|
+
"user_id": user_id,
|
|
521
|
+
"valid_at": valid_at,
|
|
522
|
+
},
|
|
523
|
+
request_options=request_options,
|
|
524
|
+
omit=OMIT,
|
|
525
|
+
)
|
|
526
|
+
try:
|
|
527
|
+
if 200 <= _response.status_code < 300:
|
|
528
|
+
return pydantic_v1.parse_obj_as(AddTripleResponse, _response.json()) # type: ignore
|
|
529
|
+
if _response.status_code == 400:
|
|
530
|
+
raise BadRequestError(
|
|
531
|
+
pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore
|
|
532
|
+
)
|
|
533
|
+
if _response.status_code == 500:
|
|
534
|
+
raise InternalServerError(
|
|
535
|
+
pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore
|
|
536
|
+
)
|
|
537
|
+
_response_json = _response.json()
|
|
538
|
+
except JSONDecodeError:
|
|
539
|
+
raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text)
|
|
540
|
+
raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json)
|
|
541
|
+
|
|
271
542
|
async def search(
|
|
272
543
|
self,
|
|
273
544
|
*,
|
|
@@ -279,6 +550,7 @@ class AsyncGraphClient:
|
|
|
279
550
|
mmr_lambda: typing.Optional[float] = OMIT,
|
|
280
551
|
reranker: typing.Optional[Reranker] = OMIT,
|
|
281
552
|
scope: typing.Optional[GraphSearchScope] = OMIT,
|
|
553
|
+
search_filters: typing.Optional[SearchFilters] = OMIT,
|
|
282
554
|
user_id: typing.Optional[str] = OMIT,
|
|
283
555
|
request_options: typing.Optional[RequestOptions] = None
|
|
284
556
|
) -> GraphSearchResults:
|
|
@@ -300,7 +572,7 @@ class AsyncGraphClient:
|
|
|
300
572
|
The maximum number of facts to retrieve. Defaults to 10. Limited to 50.
|
|
301
573
|
|
|
302
574
|
min_score : typing.Optional[float]
|
|
303
|
-
|
|
575
|
+
Deprecated
|
|
304
576
|
|
|
305
577
|
mmr_lambda : typing.Optional[float]
|
|
306
578
|
weighting for maximal marginal relevance
|
|
@@ -311,6 +583,9 @@ class AsyncGraphClient:
|
|
|
311
583
|
scope : typing.Optional[GraphSearchScope]
|
|
312
584
|
Defaults to Edges. Communities will be added in the future.
|
|
313
585
|
|
|
586
|
+
search_filters : typing.Optional[SearchFilters]
|
|
587
|
+
Search filters to apply to the search
|
|
588
|
+
|
|
314
589
|
user_id : typing.Optional[str]
|
|
315
590
|
one of user_id or group_id must be provided
|
|
316
591
|
|
|
@@ -353,6 +628,7 @@ class AsyncGraphClient:
|
|
|
353
628
|
"query": query,
|
|
354
629
|
"reranker": reranker,
|
|
355
630
|
"scope": scope,
|
|
631
|
+
"search_filters": search_filters,
|
|
356
632
|
"user_id": user_id,
|
|
357
633
|
},
|
|
358
634
|
request_options=request_options,
|
|
@@ -24,7 +24,7 @@ class EdgeClient:
|
|
|
24
24
|
self, group_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
25
25
|
) -> typing.List[EntityEdge]:
|
|
26
26
|
"""
|
|
27
|
-
|
|
27
|
+
Returns all edges for a group.
|
|
28
28
|
|
|
29
29
|
Parameters
|
|
30
30
|
----------
|
|
@@ -73,7 +73,7 @@ class EdgeClient:
|
|
|
73
73
|
self, user_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
74
74
|
) -> typing.List[EntityEdge]:
|
|
75
75
|
"""
|
|
76
|
-
|
|
76
|
+
Returns all edges for a user.
|
|
77
77
|
|
|
78
78
|
Parameters
|
|
79
79
|
----------
|
|
@@ -120,7 +120,7 @@ class EdgeClient:
|
|
|
120
120
|
|
|
121
121
|
def get(self, uuid_: str, *, request_options: typing.Optional[RequestOptions] = None) -> EntityEdge:
|
|
122
122
|
"""
|
|
123
|
-
|
|
123
|
+
Returns a specific edge by its UUID.
|
|
124
124
|
|
|
125
125
|
Parameters
|
|
126
126
|
----------
|
|
@@ -171,7 +171,7 @@ class EdgeClient:
|
|
|
171
171
|
|
|
172
172
|
def delete(self, uuid_: str, *, request_options: typing.Optional[RequestOptions] = None) -> SuccessResponse:
|
|
173
173
|
"""
|
|
174
|
-
|
|
174
|
+
Deletes an edge by UUID.
|
|
175
175
|
|
|
176
176
|
Parameters
|
|
177
177
|
----------
|
|
@@ -225,7 +225,7 @@ class AsyncEdgeClient:
|
|
|
225
225
|
self, group_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
226
226
|
) -> typing.List[EntityEdge]:
|
|
227
227
|
"""
|
|
228
|
-
|
|
228
|
+
Returns all edges for a group.
|
|
229
229
|
|
|
230
230
|
Parameters
|
|
231
231
|
----------
|
|
@@ -282,7 +282,7 @@ class AsyncEdgeClient:
|
|
|
282
282
|
self, user_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
283
283
|
) -> typing.List[EntityEdge]:
|
|
284
284
|
"""
|
|
285
|
-
|
|
285
|
+
Returns all edges for a user.
|
|
286
286
|
|
|
287
287
|
Parameters
|
|
288
288
|
----------
|
|
@@ -337,7 +337,7 @@ class AsyncEdgeClient:
|
|
|
337
337
|
|
|
338
338
|
async def get(self, uuid_: str, *, request_options: typing.Optional[RequestOptions] = None) -> EntityEdge:
|
|
339
339
|
"""
|
|
340
|
-
|
|
340
|
+
Returns a specific edge by its UUID.
|
|
341
341
|
|
|
342
342
|
Parameters
|
|
343
343
|
----------
|
|
@@ -396,7 +396,7 @@ class AsyncEdgeClient:
|
|
|
396
396
|
|
|
397
397
|
async def delete(self, uuid_: str, *, request_options: typing.Optional[RequestOptions] = None) -> SuccessResponse:
|
|
398
398
|
"""
|
|
399
|
-
|
|
399
|
+
Deletes an edge by UUID.
|
|
400
400
|
|
|
401
401
|
Parameters
|
|
402
402
|
----------
|
|
@@ -29,7 +29,7 @@ class EpisodeClient:
|
|
|
29
29
|
request_options: typing.Optional[RequestOptions] = None,
|
|
30
30
|
) -> EpisodeResponse:
|
|
31
31
|
"""
|
|
32
|
-
|
|
32
|
+
Returns episodes by group id.
|
|
33
33
|
|
|
34
34
|
Parameters
|
|
35
35
|
----------
|
|
@@ -88,7 +88,7 @@ class EpisodeClient:
|
|
|
88
88
|
request_options: typing.Optional[RequestOptions] = None,
|
|
89
89
|
) -> EpisodeResponse:
|
|
90
90
|
"""
|
|
91
|
-
|
|
91
|
+
Returns episodes by user id.
|
|
92
92
|
|
|
93
93
|
Parameters
|
|
94
94
|
----------
|
|
@@ -141,7 +141,7 @@ class EpisodeClient:
|
|
|
141
141
|
|
|
142
142
|
def get(self, uuid_: str, *, request_options: typing.Optional[RequestOptions] = None) -> Episode:
|
|
143
143
|
"""
|
|
144
|
-
|
|
144
|
+
Returns episodes by UUID
|
|
145
145
|
|
|
146
146
|
Parameters
|
|
147
147
|
----------
|
|
@@ -188,7 +188,7 @@ class EpisodeClient:
|
|
|
188
188
|
|
|
189
189
|
def delete(self, uuid_: str, *, request_options: typing.Optional[RequestOptions] = None) -> SuccessResponse:
|
|
190
190
|
"""
|
|
191
|
-
|
|
191
|
+
Deletes an episode by its UUID.
|
|
192
192
|
|
|
193
193
|
Parameters
|
|
194
194
|
----------
|
|
@@ -250,7 +250,7 @@ class AsyncEpisodeClient:
|
|
|
250
250
|
request_options: typing.Optional[RequestOptions] = None,
|
|
251
251
|
) -> EpisodeResponse:
|
|
252
252
|
"""
|
|
253
|
-
|
|
253
|
+
Returns episodes by group id.
|
|
254
254
|
|
|
255
255
|
Parameters
|
|
256
256
|
----------
|
|
@@ -317,7 +317,7 @@ class AsyncEpisodeClient:
|
|
|
317
317
|
request_options: typing.Optional[RequestOptions] = None,
|
|
318
318
|
) -> EpisodeResponse:
|
|
319
319
|
"""
|
|
320
|
-
|
|
320
|
+
Returns episodes by user id.
|
|
321
321
|
|
|
322
322
|
Parameters
|
|
323
323
|
----------
|
|
@@ -378,7 +378,7 @@ class AsyncEpisodeClient:
|
|
|
378
378
|
|
|
379
379
|
async def get(self, uuid_: str, *, request_options: typing.Optional[RequestOptions] = None) -> Episode:
|
|
380
380
|
"""
|
|
381
|
-
|
|
381
|
+
Returns episodes by UUID
|
|
382
382
|
|
|
383
383
|
Parameters
|
|
384
384
|
----------
|
|
@@ -433,7 +433,7 @@ class AsyncEpisodeClient:
|
|
|
433
433
|
|
|
434
434
|
async def delete(self, uuid_: str, *, request_options: typing.Optional[RequestOptions] = None) -> SuccessResponse:
|
|
435
435
|
"""
|
|
436
|
-
|
|
436
|
+
Deletes an episode by its UUID.
|
|
437
437
|
|
|
438
438
|
Parameters
|
|
439
439
|
----------
|