mirror of
https://github.com/encounter/adk-python.git
synced 2026-07-09 18:19:28 -07:00
chore: Always skip executing partial function calls
Related: https://github.com/google/adk-python/issues/4159 Co-authored-by: Xuan Yang <xygoogle@google.com> PiperOrigin-RevId: 859184844
This commit is contained in:
committed by
Copybara-Service
parent
7b25b8fb1d
commit
d62f9c896c
@@ -38,8 +38,6 @@ from ...agents.readonly_context import ReadonlyContext
|
||||
from ...agents.run_config import StreamingMode
|
||||
from ...agents.transcription_entry import TranscriptionEntry
|
||||
from ...events.event import Event
|
||||
from ...features import FeatureName
|
||||
from ...features import is_feature_enabled
|
||||
from ...models.base_llm_connection import BaseLlmConnection
|
||||
from ...models.llm_request import LlmRequest
|
||||
from ...models.llm_response import LlmResponse
|
||||
@@ -551,14 +549,11 @@ class BaseLlmFlow(ABC):
|
||||
# Handles function calls.
|
||||
if model_response_event.get_function_calls():
|
||||
|
||||
if is_feature_enabled(FeatureName.PROGRESSIVE_SSE_STREAMING):
|
||||
# In progressive SSE streaming mode stage 1, we skip partial FC events
|
||||
# Only execute FCs in the final aggregated event (partial=False)
|
||||
if (
|
||||
invocation_context.run_config.streaming_mode == StreamingMode.SSE
|
||||
and model_response_event.partial
|
||||
):
|
||||
return
|
||||
# Skip partial function call events - they should not trigger execution
|
||||
# since partial events are not saved to session (see runners.py).
|
||||
# Only execute function calls in the non-partial events.
|
||||
if model_response_event.partial:
|
||||
return
|
||||
|
||||
async with Aclosing(
|
||||
self._postprocess_handle_function_calls_async(
|
||||
|
||||
Reference in New Issue
Block a user