Make conversation timeout configuration (so that you're able to resume a discussion manually with another model with a gap of several hours in case you stepped away)

This commit is contained in:
Fahad
2025-06-14 13:27:19 +04:00
parent a569e316af
commit bc3f98a291
5 changed files with 31 additions and 7 deletions

View File

@@ -12,6 +12,7 @@ import pytest
from server import get_follow_up_instructions
from utils.conversation_memory import (
CONVERSATION_TIMEOUT_SECONDS,
MAX_CONVERSATION_TURNS,
ConversationTurn,
ThreadContext,
@@ -40,7 +41,7 @@ class TestConversationMemory:
mock_client.setex.assert_called_once()
call_args = mock_client.setex.call_args
assert call_args[0][0] == f"thread:{thread_id}" # key
assert call_args[0][1] == 3600 # TTL
assert call_args[0][1] == CONVERSATION_TIMEOUT_SECONDS # TTL from configuration
@patch("utils.conversation_memory.get_redis_client")
def test_get_thread_valid(self, mock_redis):