(
self,
*,
args: dict[str, Any],
tool_context: ToolContext,
)
| 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 | |
| 372 | class _DefaultTaskInput(BaseModel): |
nothing calls this directly
no test coverage detected