Skip to content

Commit b44d2c9

Browse files
eajajhossaincopybara-github
authored andcommitted
fix: explicitly preserve language and tools during event compaction
Merge #6329 Fixes #6273 PiperOrigin-RevId: 944746917
1 parent 534e8d5 commit b44d2c9

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/google/adk/apps/llm_event_summarizer.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ class LlmEventSummarizer(BaseEventsSummarizer):
5050
' It may or may not start from a compacted history. Please identify and'
5151
' reiterate the user request, summarize the context so far, focusing on'
5252
' key decisions made and information obtained, as well as any unresolved'
53-
' questions or tasks. The summary should be concise and capture the'
53+
' questions or tasks. '
54+
'CRITICAL INSTRUCTIONS: '
55+
'1. Explicitly identify and state the primary language used by the user '
56+
'at the top of your summary (e.g., "Conversation Language: English"). '
57+
'2. If the agent called any tools, accurately list the exact tool names '
58+
'used to maintain tool grounding. '
59+
'The rest of the summary should be concise and capture the'
5460
' essence of the interaction.\n\n{conversation_history}'
5561
)
5662

0 commit comments

Comments
 (0)