diff --git a/contributing/samples/gepa/experiment.py b/contributing/samples/gepa/experiment.py index f3751206a8..2710c3894c 100644 --- a/contributing/samples/gepa/experiment.py +++ b/contributing/samples/gepa/experiment.py @@ -43,7 +43,6 @@ from tau_bench.types import EnvRunResult from tau_bench.types import RunConfig import tau_bench_agent as tau_bench_agent_lib - import utils diff --git a/contributing/samples/gepa/run_experiment.py b/contributing/samples/gepa/run_experiment.py index d857da9635..e31db15788 100644 --- a/contributing/samples/gepa/run_experiment.py +++ b/contributing/samples/gepa/run_experiment.py @@ -25,7 +25,6 @@ from absl import flags import experiment from google.genai import types - import utils _OUTPUT_DIR = flags.DEFINE_string( diff --git a/src/google/adk/flows/llm_flows/base_llm_flow.py b/src/google/adk/flows/llm_flows/base_llm_flow.py index d4af69378d..ac7fe3f4c9 100644 --- a/src/google/adk/flows/llm_flows/base_llm_flow.py +++ b/src/google/adk/flows/llm_flows/base_llm_flow.py @@ -381,6 +381,9 @@ def get_author_for_event(llm_response): id=Event.new_id(), invocation_id=invocation_context.invocation_id, author=get_author_for_event(llm_response), + custom_metadata=getattr( + invocation_context.run_config, 'custom_metadata', None + ), ) async with Aclosing( @@ -495,6 +498,9 @@ async def _run_one_step_async( invocation_id=invocation_context.invocation_id, author=invocation_context.agent.name, branch=invocation_context.branch, + custom_metadata=getattr( + invocation_context.run_config, 'custom_metadata', None + ), ) async with Aclosing( self._call_llm_async( diff --git a/src/google/adk/models/lite_llm.py b/src/google/adk/models/lite_llm.py index cb6e02304e..2b2938b6bb 100644 --- a/src/google/adk/models/lite_llm.py +++ b/src/google/adk/models/lite_llm.py @@ -808,7 +808,11 @@ async def _get_content( return _decode_inline_text_data(part.inline_data.data) content_objects = [] - for part in parts_list: + for part in parts: + # Skip thought parts - these are model reasoning and should not be + # fed back as input in subsequent turns + if getattr(part, "thought", False): + continue if part.text: content_objects.append({ "type": "text",