Add memory system session context API
This commit is contained in:
@ -255,6 +255,49 @@ def test_openviking_search_uses_session_target_uri():
|
||||
]
|
||||
|
||||
|
||||
def test_openviking_get_session_context_uses_user_key_auth():
|
||||
client = OpenVikingMemorySystemClient(store=FakeStore())
|
||||
calls = []
|
||||
responses = [
|
||||
FakeResponse(
|
||||
200,
|
||||
{
|
||||
"status": "ok",
|
||||
"result": {
|
||||
"latest_archive_overview": "# Working Memory",
|
||||
"messages": [],
|
||||
},
|
||||
},
|
||||
)
|
||||
]
|
||||
client._client = lambda api_key, extra_headers=None: FakeAsyncClient( # type: ignore[method-assign]
|
||||
calls,
|
||||
responses,
|
||||
api_key,
|
||||
extra_headers or {},
|
||||
)
|
||||
credential = client.user_credential("tom-key", "tom", agent_id="sess-1")
|
||||
|
||||
result = asyncio.run(client.get_session_context(credential, "sess-1"))
|
||||
|
||||
assert result == {
|
||||
"status": "ok",
|
||||
"result": {
|
||||
"latest_archive_overview": "# Working Memory",
|
||||
"messages": [],
|
||||
},
|
||||
}
|
||||
assert calls == [
|
||||
(
|
||||
"get",
|
||||
"tom-key",
|
||||
{},
|
||||
"/api/v1/sessions/sess-1/context",
|
||||
None,
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
def test_openviking_commit_keeps_no_recent_live_messages():
|
||||
client = OpenVikingMemorySystemClient(store=FakeStore())
|
||||
calls = []
|
||||
|
||||
Reference in New Issue
Block a user