Skip to content

Commit c2c4e46

Browse files
google-genai-botcopybara-github
authored andcommitted
fix: preserve other fields of a part when updating function call
PiperOrigin-RevId: 834751197
1 parent 18ed313 commit c2c4e46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public static void populateClientFunctionCallId(Event modelResponseEvent) {
9797
if (functionCall.id().isEmpty() || functionCall.id().get().isEmpty()) {
9898
FunctionCall updatedFunctionCall =
9999
functionCall.toBuilder().id(generateClientFunctionCallId()).build();
100-
newParts.add(Part.builder().functionCall(updatedFunctionCall).build());
100+
newParts.add(part.toBuilder().functionCall(updatedFunctionCall).build());
101101
modified = true;
102102
} else {
103103
newParts.add(part); // Keep original part if ID exists

0 commit comments

Comments
 (0)