mirror of
https://github.com/sudoxreboot/groqd
synced 2026-04-14 11:36:49 +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":
|
elif memory_scope == "global":
|
||||||
memory_key = "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 memory_scope == "conversation":
|
||||||
if user_input.conversation_id is not None:
|
if user_input.conversation_id is not None:
|
||||||
conversation_id = user_input.conversation_id
|
conversation_id = user_input.conversation_id
|
||||||
|
|
@ -291,6 +300,13 @@ class GroqdConversationEntity(
|
||||||
conversation_id = ulid.ulid_now()
|
conversation_id = ulid.ulid_now()
|
||||||
history = []
|
history = []
|
||||||
|
|
||||||
|
LOGGER.debug(
|
||||||
|
"Conversation id=%s history_len=%s memory_scope=%s",
|
||||||
|
conversation_id,
|
||||||
|
len(history),
|
||||||
|
memory_scope,
|
||||||
|
)
|
||||||
|
|
||||||
if (
|
if (
|
||||||
user_input.context
|
user_input.context
|
||||||
and user_input.context.user_id
|
and user_input.context.user_id
|
||||||
|
|
@ -475,6 +491,12 @@ class GroqdConversationEntity(
|
||||||
await self._store.async_save(
|
await self._store.async_save(
|
||||||
{"history": self._persisted_history, "memory_index": self._memory_index}
|
{"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 "")
|
intent_response.async_set_speech(response.content or "")
|
||||||
return conversation.ConversationResult(
|
return conversation.ConversationResult(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue