Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions src/google/adk/flows/llm_flows/_nl_planning.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ class _NlPlanningResponse(BaseLlmResponseProcessor):
async def run_async(
self, invocation_context: InvocationContext, llm_response: LlmResponse
) -> AsyncGenerator[Event, None]:
from ...planners.built_in_planner import BuiltInPlanner

if (
not llm_response
or not llm_response.content
Expand All @@ -82,11 +80,7 @@ async def run_async(
return

planner = _get_planner(invocation_context)
if (
not planner
or type(planner).process_planning_response
is BuiltInPlanner.process_planning_response
):
if not planner:
return

# Postprocess the LLM response.
Expand Down
19 changes: 18 additions & 1 deletion src/google/adk/planners/built_in_planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,21 @@ def process_planning_response(
callback_context: CallbackContext,
response_parts: List[types.Part],
) -> Optional[List[types.Part]]:
return
"""Processes the planning response by returning the model's native content blocks.

The BuiltInPlanner relies on the model's native thinking feature, where
reasoning parts are already marked with thought=True by the model.
This method returns the response parts as-is, preserving the standardized
content blocks produced by the model.

Args:
callback_context: The callback context of the invocation.
response_parts: The LLM response parts.

Returns:
The response parts with the model's native content blocks preserved,
or None if there are no parts to process.
"""
if not response_parts:
return None
return list(response_parts)