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

Method run_async

src/google/adk/tools/agent_tool.py:349–369  ·  view source on GitHub ↗
(
      self,
      *,
      args: dict[str, Any],
      tool_context: ToolContext,
  )

Source from the content-addressed store, hash-verified

347
348 @override
349 async def run_async(
350 self,
351 *,
352 args: dict[str, Any],
353 tool_context: ToolContext,
354 ) -> Any:
355 input_schema = _get_input_schema(self.agent)
356 if input_schema:
357 try:
358 node_input = input_schema.model_validate(args)
359 except Exception as e:
360 return f'Error validating input: {e}'
361 else:
362 node_input = args.get('request')
363
364 try:
365 return await tool_context.run_node(
366 self.agent, node_input=node_input, use_sub_branch=True
367 )
368 except Exception as e:
369 return f'Error running sub-agent: {e}'
370
371
372class _DefaultTaskInput(BaseModel):

Callers

nothing calls this directly

Calls 4

_get_input_schemaFunction · 0.85
model_validateMethod · 0.80
run_nodeMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected