Skip to content

Commit d620bcb

Browse files
CAROLZXYZXYcopybara-github
authored andcommitted
fix: Remove thoughts from contents in llm requests
Merge #2320 Fix #843 COPYBARA_INTEGRATE_REVIEW=#2320 from CAROLZXYZXY:cazheng/fix-843 5b4a4b2 PiperOrigin-RevId: 790592793
1 parent 90b9193 commit d620bcb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/google/adk/flows/llm_flows/contents.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,8 @@ def _convert_foreign_event(event: Event) -> Event:
322322
content.role = 'user'
323323
content.parts = [types.Part(text='For context:')]
324324
for part in event.content.parts:
325-
if part.text:
325+
# Exclude thoughts from the context.
326+
if part.text and not part.thought:
326327
content.parts.append(
327328
types.Part(text=f'[{event.author}] said: {part.text}')
328329
)

0 commit comments

Comments
 (0)