Skip to content

Commit ba2c37e

Browse files
authored
Merge branch 'main' into feat/openapi-tool-httpx-client-factory
2 parents ca0cc75 + baf7efb commit ba2c37e

24 files changed

Lines changed: 1622 additions & 954 deletions

src/google/adk/a2a/converters/event_converter.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,10 @@ def convert_event_to_a2a_events(
570570

571571
# Handle regular message content
572572
message = convert_event_to_a2a_message(
573-
event, invocation_context, part_converter=part_converter
573+
event,
574+
invocation_context,
575+
part_converter=part_converter,
576+
role=Role.user if event.author == "user" else Role.agent,
574577
)
575578
if message:
576579
running_event = _create_status_update_event(

src/google/adk/evaluation/base_eval_service.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from pydantic import ConfigDict
2626
from pydantic import Field
2727

28+
from .constants import DEFAULT_LIVE_TIMEOUT_SECONDS
2829
from .eval_case import Invocation
2930
from .eval_metrics import EvalMetric
3031
from .eval_result import EvalCaseResult
@@ -81,6 +82,18 @@ class InferenceConfig(BaseModel):
8182
could also overwhelm those tools.""",
8283
)
8384

85+
use_live: bool = Field(
86+
default=False,
87+
description="""Whether to use live (bidirectional streaming) mode for
88+
inference. This is required for Live API models (e.g., gemini-*-live-*).""",
89+
)
90+
91+
live_timeout_seconds: int = Field(
92+
default=DEFAULT_LIVE_TIMEOUT_SECONDS,
93+
description="""Timeout in seconds for waiting for model turn completion in
94+
live mode.""",
95+
)
96+
8497

8598
class InferenceRequest(BaseModel):
8699
"""Represent a request to perform inferences for the eval cases in an eval set."""

src/google/adk/evaluation/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@
1818
'Eval module is not installed, please install via `pip install'
1919
' "google-adk[eval]"`.'
2020
)
21+
22+
DEFAULT_LIVE_TIMEOUT_SECONDS = 300

0 commit comments

Comments
 (0)