Add Memory Gateway agent plugin
This commit is contained in:
22
plugins/memory-gateway-agent/tests/test_policy.py
Normal file
22
plugins/memory-gateway-agent/tests/test_policy.py
Normal file
@ -0,0 +1,22 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from memory_gateway_plugin.config import PluginConfig
|
||||
from memory_gateway_plugin.policy import should_append_episode, should_commit_session, should_search_memory
|
||||
|
||||
|
||||
def test_policy_should_append_for_explicit_remember():
|
||||
assert should_append_episode("请记住:我偏好中文技术说明。", "", {}, PluginConfig())
|
||||
|
||||
|
||||
def test_policy_should_not_append_for_small_talk():
|
||||
assert not should_append_episode("你好", "", {}, PluginConfig())
|
||||
|
||||
|
||||
def test_policy_should_search_when_enabled():
|
||||
assert should_search_memory("这个项目之前有什么约束?", {}, PluginConfig(auto_search=True))
|
||||
|
||||
|
||||
def test_policy_should_commit_only_when_enabled_or_forced():
|
||||
assert not should_commit_session({}, PluginConfig(auto_commit_session=False))
|
||||
assert should_commit_session({"force_commit": True}, PluginConfig(auto_commit_session=False))
|
||||
|
||||
Reference in New Issue
Block a user