refactor: Extract reusable private methods

PiperOrigin-RevId: 871151624
This commit is contained in:
Google Team Member
2026-02-17 00:05:25 -08:00
committed by Copybara-Service
parent 706f9fe74d
commit 42eeaef2b3
4 changed files with 334 additions and 384 deletions
@@ -19,7 +19,6 @@ from unittest.mock import AsyncMock
from google.adk.agents.llm_agent import Agent
from google.adk.events.event import Event
from google.adk.flows.llm_flows.base_llm_flow import _handle_after_model_callback
from google.adk.flows.llm_flows.base_llm_flow import BaseLlmFlow
from google.adk.models.google_llm import Gemini
from google.adk.models.llm_request import LlmRequest
@@ -286,7 +285,7 @@ async def test_handle_after_model_callback_grounding_with_no_callbacks(
)
flow = BaseLlmFlowForTesting()
result = await _handle_after_model_callback(
result = await flow._handle_after_model_callback(
invocation_context, llm_response, event
)
@@ -343,7 +342,7 @@ async def test_handle_after_model_callback_grounding_with_callback_override(
)
flow = BaseLlmFlowForTesting()
result = await _handle_after_model_callback(
result = await flow._handle_after_model_callback(
invocation_context, llm_response, event
)
@@ -405,7 +404,7 @@ async def test_handle_after_model_callback_grounding_with_plugin_override(
)
flow = BaseLlmFlowForTesting()
result = await _handle_after_model_callback(
result = await flow._handle_after_model_callback(
invocation_context, llm_response, event
)
@@ -462,13 +461,13 @@ async def test_handle_after_model_callback_caches_canonical_tools():
flow = BaseLlmFlowForTesting()
# Call _handle_after_model_callback multiple times with the same context
result1 = await _handle_after_model_callback(
result1 = await flow._handle_after_model_callback(
invocation_context, llm_response, event
)
result2 = await _handle_after_model_callback(
result2 = await flow._handle_after_model_callback(
invocation_context, llm_response, event
)
result3 = await _handle_after_model_callback(
result3 = await flow._handle_after_model_callback(
invocation_context, llm_response, event
)