Add loggers for debugging (#1796)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import logging
|
||||
import subprocess
|
||||
import sys
|
||||
import httpx
|
||||
@@ -23,6 +24,8 @@ from mem0.memory.telemetry import capture_client_event
|
||||
from mem0 import Memory, MemoryClient
|
||||
from mem0.configs.prompts import MEMORY_ANSWER_PROMPT
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Mem0:
|
||||
def __init__(
|
||||
@@ -107,6 +110,7 @@ class Completions:
|
||||
relevant_memories = self._fetch_relevant_memories(
|
||||
messages, user_id, agent_id, run_id, filters, limit
|
||||
)
|
||||
logger.debug(f"Retrieved {len(relevant_memories)} relevant memories")
|
||||
prepared_messages[-1]["content"] = self._format_query_with_memories(
|
||||
messages, relevant_memories
|
||||
)
|
||||
@@ -155,6 +159,7 @@ class Completions:
|
||||
self, messages, user_id, agent_id, run_id, metadata, filters
|
||||
):
|
||||
def add_task():
|
||||
logger.debug("Adding to memory asynchronously")
|
||||
self.mem0_client.add(
|
||||
messages=messages,
|
||||
user_id=user_id,
|
||||
|
||||
Reference in New Issue
Block a user