Skip to content

Commit b8a97ed

Browse files
google-genai-botcopybara-github
authored andcommitted
fix: Treat empty-but-defined text responses as a text response
Handles an edge case in structured type generation where the JSON content was previously completed but a final, empty response is sent with a STOP finish reason. PiperOrigin-RevId: 774917500
1 parent 120cbab commit b8a97ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/google/adk/models/google_llm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ async def generate_content_async(
124124
if (
125125
llm_response.content
126126
and llm_response.content.parts
127-
and llm_response.content.parts[0].text
127+
and llm_response.content.parts[0].text is not None
128128
):
129129
part0 = llm_response.content.parts[0]
130130
if part0.thought:

0 commit comments

Comments
 (0)