zep-crewai 1.0.0__tar.gz → 1.1.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_crewai-1.0.0 → zep_crewai-1.1.0}/PKG-INFO +1 -1
- {zep_crewai-1.0.0 → zep_crewai-1.1.0}/examples/crewai_user.py +1 -1
- {zep_crewai-1.0.0 → zep_crewai-1.1.0}/examples/test_context_mock.py +4 -4
- {zep_crewai-1.0.0 → zep_crewai-1.1.0}/pyproject.toml +1 -1
- {zep_crewai-1.0.0 → zep_crewai-1.1.0}/src/zep_crewai/user_storage.py +2 -2
- {zep_crewai-1.0.0 → zep_crewai-1.1.0}/tests/test_user_storage.py +6 -6
- {zep_crewai-1.0.0 → zep_crewai-1.1.0}/.gitignore +0 -0
- {zep_crewai-1.0.0 → zep_crewai-1.1.0}/Makefile +0 -0
- {zep_crewai-1.0.0 → zep_crewai-1.1.0}/README.md +0 -0
- {zep_crewai-1.0.0 → zep_crewai-1.1.0}/examples/crewai_graph.py +0 -0
- {zep_crewai-1.0.0 → zep_crewai-1.1.0}/examples/crewai_tools.py +0 -0
- {zep_crewai-1.0.0 → zep_crewai-1.1.0}/examples/simple_example.py +0 -0
- {zep_crewai-1.0.0 → zep_crewai-1.1.0}/src/zep_crewai/__init__.py +0 -0
- {zep_crewai-1.0.0 → zep_crewai-1.1.0}/src/zep_crewai/exceptions.py +0 -0
- {zep_crewai-1.0.0 → zep_crewai-1.1.0}/src/zep_crewai/graph_storage.py +0 -0
- {zep_crewai-1.0.0 → zep_crewai-1.1.0}/src/zep_crewai/memory.py +0 -0
- {zep_crewai-1.0.0 → zep_crewai-1.1.0}/src/zep_crewai/tools.py +0 -0
- {zep_crewai-1.0.0 → zep_crewai-1.1.0}/src/zep_crewai/utils.py +0 -0
- {zep_crewai-1.0.0 → zep_crewai-1.1.0}/tests/test_basic.py +0 -0
- {zep_crewai-1.0.0 → zep_crewai-1.1.0}/tests/test_graph_storage.py +0 -0
- {zep_crewai-1.0.0 → zep_crewai-1.1.0}/tests/test_tools.py +0 -0
@@ -72,7 +72,7 @@ def main():
|
|
72
72
|
client=zep_client,
|
73
73
|
user_id=user_id,
|
74
74
|
thread_id=thread_id,
|
75
|
-
mode="summary", # Use summary mode for concise context (or "
|
75
|
+
mode="summary", # Use summary mode for concise context (or "basic" for raw context)
|
76
76
|
)
|
77
77
|
external_memory = ExternalMemory(storage=user_storage)
|
78
78
|
|
@@ -62,8 +62,8 @@ Key Facts:
|
|
62
62
|
logger.info("Context that CrewAI agent receives:")
|
63
63
|
logger.info(context)
|
64
64
|
|
65
|
-
# Example 2:
|
66
|
-
logger.info("\n2.
|
65
|
+
# Example 2: basic mode
|
66
|
+
logger.info("\n2. basic MODE - thread.get_user_context(mode='basic')")
|
67
67
|
logger.info("-" * 60)
|
68
68
|
|
69
69
|
mock_context_raw = MagicMock()
|
@@ -82,7 +82,7 @@ Key Facts:
|
|
82
82
|
mock_zep.thread.get_user_context = MagicMock(return_value=mock_context_raw)
|
83
83
|
|
84
84
|
storage_raw = ZepUserStorage(
|
85
|
-
client=mock_zep, user_id="user_123", thread_id="thread_456", mode="
|
85
|
+
client=mock_zep, user_id="user_123", thread_id="thread_456", mode="basic"
|
86
86
|
)
|
87
87
|
|
88
88
|
context = storage_raw.get_context()
|
@@ -227,7 +227,7 @@ CrewAI agents receive context from Zep in these ways:
|
|
227
227
|
|
228
228
|
1. User Storage (ZepUserStorage):
|
229
229
|
- Retrieves user-specific context from conversation threads
|
230
|
-
- Two modes: 'summary' (default) or '
|
230
|
+
- Two modes: 'summary' (default) or 'basic'
|
231
231
|
- Context includes user profile, preferences, conversation history
|
232
232
|
- Directly uses thread.get_user_context() from Zep SDK
|
233
233
|
|
@@ -31,7 +31,7 @@ class ZepUserStorage(Storage):
|
|
31
31
|
search_filters: SearchFilters | None = None,
|
32
32
|
facts_limit: int = 20,
|
33
33
|
entity_limit: int = 5,
|
34
|
-
mode: Literal["summary", "
|
34
|
+
mode: Literal["summary", "basic"] = "summary",
|
35
35
|
**kwargs: Any,
|
36
36
|
) -> None:
|
37
37
|
"""
|
@@ -44,7 +44,7 @@ class ZepUserStorage(Storage):
|
|
44
44
|
search_filters: Optional filters for search operations
|
45
45
|
facts_limit: Maximum number of facts (edges) to retrieve for context
|
46
46
|
entity_limit: Maximum number of entities (nodes) to retrieve for context
|
47
|
-
mode: Mode for thread context retrieval ("summary" or "
|
47
|
+
mode: Mode for thread context retrieval ("summary" or "basic")
|
48
48
|
**kwargs: Additional configuration options
|
49
49
|
"""
|
50
50
|
if not isinstance(client, Zep):
|
@@ -285,28 +285,28 @@ class TestZepUserStorage:
|
|
285
285
|
|
286
286
|
assert context == "User's conversation context with summary"
|
287
287
|
|
288
|
-
def
|
289
|
-
"""Test get_context with
|
288
|
+
def test_get_context_with_basic_mode(self):
|
289
|
+
"""Test get_context with basic mode."""
|
290
290
|
from zep_cloud.client import Zep
|
291
291
|
|
292
292
|
mock_client = MagicMock(spec=Zep)
|
293
293
|
mock_client.thread = MagicMock()
|
294
294
|
|
295
|
-
# Mock thread context response with
|
295
|
+
# Mock thread context response with basic
|
296
296
|
mock_context = MagicMock()
|
297
297
|
mock_context.context = "User: Hello\nAssistant: Hi there!\nUser: How are you?"
|
298
298
|
mock_client.thread.get_user_context.return_value = mock_context
|
299
299
|
|
300
300
|
storage = ZepUserStorage(
|
301
|
-
client=mock_client, user_id="test-user", thread_id="test-thread", mode="
|
301
|
+
client=mock_client, user_id="test-user", thread_id="test-thread", mode="basic"
|
302
302
|
)
|
303
303
|
|
304
304
|
# Get context
|
305
305
|
context = storage.get_context()
|
306
306
|
|
307
|
-
# Verify thread.get_user_context was called with
|
307
|
+
# Verify thread.get_user_context was called with basic mode
|
308
308
|
mock_client.thread.get_user_context.assert_called_once_with(
|
309
|
-
thread_id="test-thread", mode="
|
309
|
+
thread_id="test-thread", mode="basic"
|
310
310
|
)
|
311
311
|
|
312
312
|
assert context == "User: Hello\nAssistant: Hi there!\nUser: How are you?"
|
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
|