Skip to content

ADK changes #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ public static String generateClientFunctionCallId() {
/**
* Populates missing function call IDs in the provided event's content.
*
* <p>If the event contains function calls without an ID, this method generates a unique client-side
* ID for each and updates the event content.
* <p>If the event contains function calls without an ID, this method generates a unique
* client-side ID for each and updates the event content.
*
* @param modelResponseEvent The event potentially containing function calls.
*/
Expand All @@ -76,7 +76,7 @@ public static void populateClientFunctionCallId(Event modelResponseEvent) {
for (Part part : originalParts) {
if (part.functionCall().isPresent()) {
FunctionCall functionCall = part.functionCall().get();
if (functionCall.id().isEmpty()) {
if (functionCall.id().isEmpty() || functionCall.id().get().isEmpty()) {
FunctionCall updatedFunctionCall =
functionCall.toBuilder().id(generateClientFunctionCallId()).build();
newParts.add(Part.builder().functionCall(updatedFunctionCall).build());
Expand Down