Skip to content

Commit 8bb4215

Browse files
google-genai-botcopybara-github
authored andcommitted
fix: populate finishReason in LlmResponse
PiperOrigin-RevId: 853076812
1 parent e7380f1 commit 8bb4215

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

core/src/main/java/com/google/adk/models/LlmResponse.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ public final Builder response(GenerateContentResponse response) {
180180
Optional<List<Candidate>> candidatesOpt = response.candidates();
181181
if (candidatesOpt.isPresent() && !candidatesOpt.get().isEmpty()) {
182182
Candidate candidate = candidatesOpt.get().get(0);
183+
this.finishReason(candidate.finishReason());
183184
if (candidate.content().isPresent()) {
184185
this.content(candidate.content().get());
185186
this.groundingMetadata(candidate.groundingMetadata());

0 commit comments

Comments
 (0)