Skip to content

fix(llm): prevent base llm flow truncation (#522) #659

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

6 changes: 6 additions & 0 deletions src/google/adk/flows/llm_flows/base_llm_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,12 @@ async def run_async(
yield event
if not last_event or last_event.is_final_response():
break
if last_event.partial:
# TODO: handle this in BaseLlm level.
raise ValueError(
f"Last event shouldn't be partial. LLM max output limit may be"
f' reached.'
)

async def _run_one_step_async(
self,
Expand Down
Loading