diff --git a/contributing/samples/gepa/experiment.py b/contributing/samples/gepa/experiment.py index 2f5d03a772..f68b349d9c 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 cfd850b3a3..1bc4ee58c8 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 824cd26be1..05061fad76 100644 --- a/src/google/adk/flows/llm_flows/base_llm_flow.py +++ b/src/google/adk/flows/llm_flows/base_llm_flow.py @@ -324,6 +324,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( @@ -438,6 +441,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 140473982f..28426e0139 100644 --- a/src/google/adk/models/lite_llm.py +++ b/src/google/adk/models/lite_llm.py @@ -533,6 +533,10 @@ async def _get_content( content_objects = [] 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: if len(parts) == 1: return part.text