Skip to content

Commit 40af9bb

Browse files
google-genai-botcopybara-github
authored andcommitted
fix: exclude Thought from being printed as context
Synced from adk-python change: google/adk-python#2320 PiperOrigin-RevId: 790874614
1 parent ff3c803 commit 40af9bb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/src/main/java/com/google/adk/flows/llmflows/Contents.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ private static Event convertForeignEvent(Event event) {
131131
String originalAuthor = event.author();
132132

133133
for (Part part : event.content().get().parts().get()) {
134-
if (part.text().isPresent() && !part.text().get().isEmpty()) {
134+
if (part.text().isPresent()
135+
&& !part.text().get().isEmpty()
136+
&& !part.thought().orElse(false)) {
135137
parts.add(Part.fromText(String.format("[%s] said: %s", originalAuthor, part.text().get())));
136138
} else if (part.functionCall().isPresent()) {
137139
FunctionCall functionCall = part.functionCall().get();

0 commit comments

Comments
 (0)