MCPcopy Index your code
hub / github.com/google/adk-python / _get_input_schema

Function _get_input_schema

src/google/adk/tools/agent_tool.py:57–79  ·  view source on GitHub ↗

Extracts the input_schema from an agent. For LlmAgent, returns its input_schema directly. For agents with sub_agents, recursively searches the first sub-agent for an input_schema. Args: agent: The agent to extract input_schema from. Returns: The input_schema if found, None other

(agent: BaseAgent)

Source from the content-addressed store, hash-verified

55
56
57def _get_input_schema(agent: BaseAgent) -> Optional[type[BaseModel]]:
58 """Extracts the input_schema from an agent.
59
60 For LlmAgent, returns its input_schema directly.
61 For agents with sub_agents, recursively searches the first sub-agent for an
62 input_schema.
63
64 Args:
65 agent: The agent to extract input_schema from.
66
67 Returns:
68 The input_schema if found, None otherwise.
69 """
70 from ..agents.llm_agent import LlmAgent
71
72 if isinstance(agent, LlmAgent):
73 return agent.input_schema
74
75 # For composite agents, check the first sub-agent
76 if agent.sub_agents:
77 return _get_input_schema(agent.sub_agents[0])
78
79 return None
80
81
82def _get_output_schema(agent: BaseAgent) -> Optional[SchemaType]:

Callers 4

_get_declarationMethod · 0.85
run_asyncMethod · 0.85
run_asyncMethod · 0.85
_get_declarationMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected