mirror of
https://github.com/sudoxreboot/groqd
synced 2026-04-14 03:26:35 +00:00
Add debug logging for memory handling
This commit is contained in:
parent
dd0407410f
commit
a87778065e
1 changed files with 22 additions and 0 deletions
|
|
@ -276,6 +276,15 @@ class GroqdConversationEntity(
|
|||
elif memory_scope == "global":
|
||||
memory_key = "global"
|
||||
|
||||
LOGGER.debug(
|
||||
"Memory scope=%s memory_key=%s conv_id=%s device_id=%s user_id=%s",
|
||||
memory_scope,
|
||||
memory_key,
|
||||
user_input.conversation_id,
|
||||
user_input.device_id,
|
||||
user_input.context.user_id if user_input.context else None,
|
||||
)
|
||||
|
||||
if memory_scope == "conversation":
|
||||
if user_input.conversation_id is not None:
|
||||
conversation_id = user_input.conversation_id
|
||||
|
|
@ -291,6 +300,13 @@ class GroqdConversationEntity(
|
|||
conversation_id = ulid.ulid_now()
|
||||
history = []
|
||||
|
||||
LOGGER.debug(
|
||||
"Conversation id=%s history_len=%s memory_scope=%s",
|
||||
conversation_id,
|
||||
len(history),
|
||||
memory_scope,
|
||||
)
|
||||
|
||||
if (
|
||||
user_input.context
|
||||
and user_input.context.user_id
|
||||
|
|
@ -475,6 +491,12 @@ class GroqdConversationEntity(
|
|||
await self._store.async_save(
|
||||
{"history": self._persisted_history, "memory_index": self._memory_index}
|
||||
)
|
||||
LOGGER.debug(
|
||||
"Persisted memory_key=%s history_len=%s conv_id=%s",
|
||||
memory_key,
|
||||
len(history),
|
||||
conversation_id,
|
||||
)
|
||||
|
||||
intent_response.async_set_speech(response.content or "")
|
||||
return conversation.ConversationResult(
|
||||
|
|
|
|||
Loading…
Reference in a new issue