zep-cloud 3.4.0__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.
Files changed (95) hide show
  1. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/PKG-INFO +1 -1
  2. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/pyproject.toml +1 -1
  3. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/core/client_wrapper.py +2 -2
  4. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/graph/utils.py +18 -12
  5. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/thread/client.py +8 -8
  6. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/thread/raw_client.py +8 -8
  7. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/add_thread_messages_request.py +1 -1
  8. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/thread_context_response.py +1 -1
  9. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/LICENSE +0 -0
  10. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/README.md +0 -0
  11. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/__init__.py +0 -0
  12. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/base_client.py +0 -0
  13. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/client.py +0 -0
  14. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/core/__init__.py +0 -0
  15. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/core/api_error.py +0 -0
  16. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/core/datetime_utils.py +0 -0
  17. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/core/file.py +0 -0
  18. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/core/force_multipart.py +0 -0
  19. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/core/http_client.py +0 -0
  20. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/core/http_response.py +0 -0
  21. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/core/jsonable_encoder.py +0 -0
  22. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/core/pydantic_utilities.py +0 -0
  23. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/core/query_encoder.py +0 -0
  24. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/core/remove_none_from_dict.py +0 -0
  25. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/core/request_options.py +0 -0
  26. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/core/serialization.py +0 -0
  27. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/environment.py +0 -0
  28. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/errors/__init__.py +0 -0
  29. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/errors/bad_request_error.py +0 -0
  30. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/errors/internal_server_error.py +0 -0
  31. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/errors/not_found_error.py +0 -0
  32. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/external_clients/graph.py +0 -0
  33. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/external_clients/ontology.py +0 -0
  34. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/external_clients/user.py +0 -0
  35. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/graph/__init__.py +0 -0
  36. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/graph/client.py +0 -0
  37. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/graph/edge/__init__.py +0 -0
  38. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/graph/edge/client.py +0 -0
  39. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/graph/edge/raw_client.py +0 -0
  40. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/graph/episode/__init__.py +0 -0
  41. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/graph/episode/client.py +0 -0
  42. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/graph/episode/raw_client.py +0 -0
  43. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/graph/node/__init__.py +0 -0
  44. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/graph/node/client.py +0 -0
  45. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/graph/node/raw_client.py +0 -0
  46. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/graph/raw_client.py +0 -0
  47. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/py.typed +0 -0
  48. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/thread/__init__.py +0 -0
  49. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/thread/types/__init__.py +0 -0
  50. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/thread/types/thread_get_user_context_request_mode.py +0 -0
  51. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/__init__.py +0 -0
  52. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/add_thread_messages_response.py +0 -0
  53. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/add_triple_response.py +0 -0
  54. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/api_error.py +0 -0
  55. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/clone_graph_response.py +0 -0
  56. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/comparison_operator.py +0 -0
  57. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/date_filter.py +0 -0
  58. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/edge_type.py +0 -0
  59. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/entity_edge.py +0 -0
  60. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/entity_edge_source_target.py +0 -0
  61. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/entity_node.py +0 -0
  62. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/entity_property.py +0 -0
  63. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/entity_property_type.py +0 -0
  64. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/entity_type.py +0 -0
  65. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/entity_type_response.py +0 -0
  66. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/episode.py +0 -0
  67. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/episode_data.py +0 -0
  68. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/episode_mentions.py +0 -0
  69. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/episode_response.py +0 -0
  70. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/fact_rating_examples.py +0 -0
  71. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/fact_rating_instruction.py +0 -0
  72. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/graph.py +0 -0
  73. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/graph_data_type.py +0 -0
  74. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/graph_edges_request.py +0 -0
  75. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/graph_list_response.py +0 -0
  76. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/graph_nodes_request.py +0 -0
  77. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/graph_search_results.py +0 -0
  78. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/graph_search_scope.py +0 -0
  79. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/message.py +0 -0
  80. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/message_list_response.py +0 -0
  81. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/models_fact_rating_examples.py +0 -0
  82. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/models_fact_rating_instruction.py +0 -0
  83. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/reranker.py +0 -0
  84. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/role_type.py +0 -0
  85. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/search_filters.py +0 -0
  86. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/success_response.py +0 -0
  87. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/thread.py +0 -0
  88. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/thread_list_response.py +0 -0
  89. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/user.py +0 -0
  90. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/user_list_response.py +0 -0
  91. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/types/user_node_response.py +0 -0
  92. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/user/__init__.py +0 -0
  93. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/user/client.py +0 -0
  94. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/user/raw_client.py +0 -0
  95. {zep_cloud-3.4.0 → zep_cloud-3.4.2}/src/zep_cloud/version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zep-cloud
3
- Version: 3.4.0
3
+ Version: 3.4.2
4
4
  Summary:
5
5
  Requires-Python: >=3.9.0,<4.0
6
6
  Classifier: Intended Audience :: Developers
@@ -3,7 +3,7 @@ name = "zep-cloud"
3
3
 
4
4
  [tool.poetry]
5
5
  name = "zep-cloud"
6
- version = "3.4.0"
6
+ version = "3.4.2"
7
7
  description = ""
8
8
  readme = "README.md"
9
9
  authors = []
@@ -22,10 +22,10 @@ class BaseClientWrapper:
22
22
 
23
23
  def get_headers(self) -> typing.Dict[str, str]:
24
24
  headers: typing.Dict[str, str] = {
25
- "User-Agent": "zep-cloud/3.4.0",
25
+ "User-Agent": "zep-cloud/3.4.1",
26
26
  "X-Fern-Language": "Python",
27
27
  "X-Fern-SDK-Name": "zep-cloud",
28
- "X-Fern-SDK-Version": "3.4.0",
28
+ "X-Fern-SDK-Version": "3.4.1",
29
29
  **(self.get_custom_headers() or {}),
30
30
  }
31
31
  headers["Authorization"] = f"Api-Key {self.api_key}"
@@ -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, handling Z suffix for UTC."""
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 datetime.fromisoformat(iso_string)
13
- except ValueError:
14
- # Handle Z suffix for Python 3.9 compatibility
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
- valid_at = parse_iso_datetime(edge.valid_at).strftime(DATE_FORMAT)
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
- invalid_at = parse_iso_datetime(edge.invalid_at).strftime(DATE_FORMAT)
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
- timestamp = parse_iso_datetime(episode.created_at).strftime(DATE_FORMAT)
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)
@@ -159,12 +159,12 @@ class ThreadClient:
159
159
  request_options: typing.Optional[RequestOptions] = None,
160
160
  ) -> ThreadContextResponse:
161
161
  """
162
- Returns most relevant context for a given thread.
162
+ Returns most relevant context from the user graph (including memory from any/all past threads) based on the content of the past few messages of the given thread.
163
163
 
164
164
  Parameters
165
165
  ----------
166
166
  thread_id : str
167
- The ID of the thread for which to retrieve context.
167
+ The ID of the current thread (for which context is being retrieved).
168
168
 
169
169
  min_rating : typing.Optional[float]
170
170
  The minimum rating by which to filter relevant facts.
@@ -272,7 +272,7 @@ class ThreadClient:
272
272
  that are added to a user's graph.
273
273
 
274
274
  return_context : typing.Optional[bool]
275
- Optionally return memory context relevant to the most recent messages.
275
+ Optionally return context block relevant to the most recent messages.
276
276
 
277
277
  request_options : typing.Optional[RequestOptions]
278
278
  Request-specific configuration.
@@ -334,7 +334,7 @@ class ThreadClient:
334
334
  that are added to a user's graph.
335
335
 
336
336
  return_context : typing.Optional[bool]
337
- Optionally return memory context relevant to the most recent messages.
337
+ Optionally return context block relevant to the most recent messages.
338
338
 
339
339
  request_options : typing.Optional[RequestOptions]
340
340
  Request-specific configuration.
@@ -537,12 +537,12 @@ class AsyncThreadClient:
537
537
  request_options: typing.Optional[RequestOptions] = None,
538
538
  ) -> ThreadContextResponse:
539
539
  """
540
- Returns most relevant context for a given thread.
540
+ Returns most relevant context from the user graph (including memory from any/all past threads) based on the content of the past few messages of the given thread.
541
541
 
542
542
  Parameters
543
543
  ----------
544
544
  thread_id : str
545
- The ID of the thread for which to retrieve context.
545
+ The ID of the current thread (for which context is being retrieved).
546
546
 
547
547
  min_rating : typing.Optional[float]
548
548
  The minimum rating by which to filter relevant facts.
@@ -666,7 +666,7 @@ class AsyncThreadClient:
666
666
  that are added to a user's graph.
667
667
 
668
668
  return_context : typing.Optional[bool]
669
- Optionally return memory context relevant to the most recent messages.
669
+ Optionally return context block relevant to the most recent messages.
670
670
 
671
671
  request_options : typing.Optional[RequestOptions]
672
672
  Request-specific configuration.
@@ -736,7 +736,7 @@ class AsyncThreadClient:
736
736
  that are added to a user's graph.
737
737
 
738
738
  return_context : typing.Optional[bool]
739
- Optionally return memory context relevant to the most recent messages.
739
+ Optionally return context block relevant to the most recent messages.
740
740
 
741
741
  request_options : typing.Optional[RequestOptions]
742
742
  Request-specific configuration.
@@ -268,12 +268,12 @@ class RawThreadClient:
268
268
  request_options: typing.Optional[RequestOptions] = None,
269
269
  ) -> HttpResponse[ThreadContextResponse]:
270
270
  """
271
- Returns most relevant context for a given thread.
271
+ Returns most relevant context from the user graph (including memory from any/all past threads) based on the content of the past few messages of the given thread.
272
272
 
273
273
  Parameters
274
274
  ----------
275
275
  thread_id : str
276
- The ID of the thread for which to retrieve context.
276
+ The ID of the current thread (for which context is being retrieved).
277
277
 
278
278
  min_rating : typing.Optional[float]
279
279
  The minimum rating by which to filter relevant facts.
@@ -450,7 +450,7 @@ class RawThreadClient:
450
450
  that are added to a user's graph.
451
451
 
452
452
  return_context : typing.Optional[bool]
453
- Optionally return memory context relevant to the most recent messages.
453
+ Optionally return context block relevant to the most recent messages.
454
454
 
455
455
  request_options : typing.Optional[RequestOptions]
456
456
  Request-specific configuration.
@@ -532,7 +532,7 @@ class RawThreadClient:
532
532
  that are added to a user's graph.
533
533
 
534
534
  return_context : typing.Optional[bool]
535
- Optionally return memory context relevant to the most recent messages.
535
+ Optionally return context block relevant to the most recent messages.
536
536
 
537
537
  request_options : typing.Optional[RequestOptions]
538
538
  Request-specific configuration.
@@ -829,12 +829,12 @@ class AsyncRawThreadClient:
829
829
  request_options: typing.Optional[RequestOptions] = None,
830
830
  ) -> AsyncHttpResponse[ThreadContextResponse]:
831
831
  """
832
- Returns most relevant context for a given thread.
832
+ Returns most relevant context from the user graph (including memory from any/all past threads) based on the content of the past few messages of the given thread.
833
833
 
834
834
  Parameters
835
835
  ----------
836
836
  thread_id : str
837
- The ID of the thread for which to retrieve context.
837
+ The ID of the current thread (for which context is being retrieved).
838
838
 
839
839
  min_rating : typing.Optional[float]
840
840
  The minimum rating by which to filter relevant facts.
@@ -1011,7 +1011,7 @@ class AsyncRawThreadClient:
1011
1011
  that are added to a user's graph.
1012
1012
 
1013
1013
  return_context : typing.Optional[bool]
1014
- Optionally return memory context relevant to the most recent messages.
1014
+ Optionally return context block relevant to the most recent messages.
1015
1015
 
1016
1016
  request_options : typing.Optional[RequestOptions]
1017
1017
  Request-specific configuration.
@@ -1093,7 +1093,7 @@ class AsyncRawThreadClient:
1093
1093
  that are added to a user's graph.
1094
1094
 
1095
1095
  return_context : typing.Optional[bool]
1096
- Optionally return memory context relevant to the most recent messages.
1096
+ Optionally return context block relevant to the most recent messages.
1097
1097
 
1098
1098
  request_options : typing.Optional[RequestOptions]
1099
1099
  Request-specific configuration.
@@ -23,7 +23,7 @@ class AddThreadMessagesRequest(UniversalBaseModel):
23
23
 
24
24
  return_context: typing.Optional[bool] = pydantic.Field(default=None)
25
25
  """
26
- Optionally return memory context relevant to the most recent messages.
26
+ Optionally return context block relevant to the most recent messages.
27
27
  """
28
28
 
29
29
  if IS_PYDANTIC_V2:
@@ -9,7 +9,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
9
9
  class ThreadContextResponse(UniversalBaseModel):
10
10
  context: typing.Optional[str] = pydantic.Field(default=None)
11
11
  """
12
- Memory context containing relevant facts and entities for the session. Can be put into the prompt directly.
12
+ Context block containing relevant facts, entities, and messages/episodes from the user graph. Meant to be replaced in the system prompt on every chat turn.
13
13
  """
14
14
 
15
15
  if IS_PYDANTIC_V2:
File without changes
File without changes