skip getting relevant memory if no message history

pull/1138/head
celthi 2023-04-13 23:41:09 +08:00
parent cc8fc99c50
commit c5188d5611
1 changed files with 1 additions and 1 deletions

View File

@ -69,7 +69,7 @@ def chat_with_ai(
logger.debug(f"Token limit: {token_limit}")
send_token_limit = token_limit - 1000
relevant_memory = permanent_memory.get_relevant(str(full_message_history[-9:]), 10)
relevant_memory = '' if len(full_message_history) ==0 else permanent_memory.get_relevant(str(full_message_history[-9:]), 10)
logger.debug(f'Memory Stats: {permanent_memory.get_stats()}')