zep-cloud 3.4.1__tar.gz → 3.4.2__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-3.4.1 → zep_cloud-3.4.2}/PKG-INFO +1 -1
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/pyproject.toml +1 -1
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/graph/utils.py +18 -12
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/LICENSE +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/README.md +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/__init__.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/base_client.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/client.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/core/__init__.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/core/api_error.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/core/client_wrapper.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/core/datetime_utils.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/core/file.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/core/force_multipart.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/core/http_client.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/core/http_response.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/core/jsonable_encoder.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/core/pydantic_utilities.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/core/query_encoder.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/core/remove_none_from_dict.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/core/request_options.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/core/serialization.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/environment.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/errors/__init__.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/errors/bad_request_error.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/errors/internal_server_error.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/errors/not_found_error.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/external_clients/graph.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/external_clients/ontology.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/external_clients/user.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/graph/__init__.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/graph/client.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/graph/edge/__init__.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/graph/edge/client.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/graph/edge/raw_client.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/graph/episode/__init__.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/graph/episode/client.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/graph/episode/raw_client.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/graph/node/__init__.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/graph/node/client.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/graph/node/raw_client.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/graph/raw_client.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/py.typed +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/thread/__init__.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/thread/client.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/thread/raw_client.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/thread/types/__init__.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/thread/types/thread_get_user_context_request_mode.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/__init__.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/add_thread_messages_request.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/add_thread_messages_response.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/add_triple_response.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/api_error.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/clone_graph_response.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/comparison_operator.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/date_filter.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/edge_type.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/entity_edge.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/entity_edge_source_target.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/entity_node.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/entity_property.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/entity_property_type.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/entity_type.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/entity_type_response.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/episode.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/episode_data.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/episode_mentions.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/episode_response.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/fact_rating_examples.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/fact_rating_instruction.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/graph.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/graph_data_type.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/graph_edges_request.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/graph_list_response.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/graph_nodes_request.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/graph_search_results.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/graph_search_scope.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/message.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/message_list_response.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/models_fact_rating_examples.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/models_fact_rating_instruction.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/reranker.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/role_type.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/search_filters.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/success_response.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/thread.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/thread_context_response.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/thread_list_response.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/user.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/user_list_response.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/types/user_node_response.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/user/__init__.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/user/client.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/user/raw_client.py +0 -0
- {zep_cloud-3.4.1 → zep_cloud-3.4.2}/src/zep_cloud/version.py +0 -0
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
|
-
from typing import List
|
|
2
|
+
from typing import List, Optional
|
|
3
3
|
|
|
4
|
+
from dateutil import parser as dateutil_parser
|
|
4
5
|
from zep_cloud import EntityEdge, EntityNode, Episode
|
|
5
6
|
|
|
6
7
|
DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
def parse_iso_datetime(iso_string: str) -> datetime:
|
|
10
|
-
"""Parse ISO datetime string
|
|
10
|
+
def parse_iso_datetime(iso_string: str) -> Optional[datetime]:
|
|
11
|
+
"""Parse ISO datetime string using dateutil parser."""
|
|
12
|
+
if not iso_string:
|
|
13
|
+
return None
|
|
14
|
+
|
|
11
15
|
try:
|
|
12
|
-
return
|
|
13
|
-
except ValueError:
|
|
14
|
-
|
|
15
|
-
if iso_string.endswith('Z'):
|
|
16
|
-
return datetime.fromisoformat(iso_string[:-1] + '+00:00')
|
|
17
|
-
raise
|
|
16
|
+
return dateutil_parser.isoparse(iso_string)
|
|
17
|
+
except (ValueError, TypeError):
|
|
18
|
+
return None
|
|
18
19
|
|
|
19
20
|
TEMPLATE_STRING = """
|
|
20
21
|
FACTS and ENTITIES{episodes_header} represent relevant context to the current conversation.
|
|
@@ -52,9 +53,13 @@ def format_edge_date_range(edge: EntityEdge) -> str:
|
|
|
52
53
|
invalid_at = "present"
|
|
53
54
|
|
|
54
55
|
if edge.valid_at is not None:
|
|
55
|
-
|
|
56
|
+
parsed_valid_at = parse_iso_datetime(edge.valid_at)
|
|
57
|
+
if parsed_valid_at is not None:
|
|
58
|
+
valid_at = parsed_valid_at.strftime(DATE_FORMAT)
|
|
56
59
|
if edge.invalid_at is not None:
|
|
57
|
-
|
|
60
|
+
parsed_invalid_at = parse_iso_datetime(edge.invalid_at)
|
|
61
|
+
if parsed_invalid_at is not None:
|
|
62
|
+
invalid_at = parsed_invalid_at.strftime(DATE_FORMAT)
|
|
58
63
|
|
|
59
64
|
return f"{valid_at} - {invalid_at}"
|
|
60
65
|
|
|
@@ -114,7 +119,8 @@ def compose_context_string(edges: List[EntityEdge], nodes: List[EntityNode], epi
|
|
|
114
119
|
elif hasattr(episode, 'role_type') and episode.role_type:
|
|
115
120
|
role_prefix = f"({episode.role_type}): "
|
|
116
121
|
|
|
117
|
-
|
|
122
|
+
parsed_timestamp = parse_iso_datetime(episode.created_at)
|
|
123
|
+
timestamp = parsed_timestamp.strftime(DATE_FORMAT) if parsed_timestamp is not None else "date unknown"
|
|
118
124
|
|
|
119
125
|
episode_str = f" - {role_prefix}{episode.content} ({timestamp})"
|
|
120
126
|
episodes_list.append(episode_str)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|