@@ -288,9 +288,9 @@ async def run_my_agent() -> str:
288
288
289
289
In certain cases, you might want to modify the output of the tool-agents before returning it to the central agent. This may be useful if you want to:
290
290
291
- - Extract a specific piece of information (e.g., a JSON payload) from the sub-agent's chat history.
292
- - Convert or reformat the agent’s final answer (e.g., transform Markdown into plain text or CSV).
293
- - Validate the output or provide a fallback value when the agent’s response is missing or malformed.
291
+ - Extract a specific piece of information (e.g., a JSON payload) from the sub-agent's chat history.
292
+ - Convert or reformat the agent’s final answer (e.g., transform Markdown into plain text or CSV).
293
+ - Validate the output or provide a fallback value when the agent’s response is missing or malformed.
294
294
295
295
You can do this by supplying the ` custom_output_extractor ` argument to the ` as_tool ` method:
296
296
@@ -370,16 +370,16 @@ asyncio.run(main())
370
370
371
371
The ` is_enabled ` parameter accepts:
372
372
373
- - ** Boolean values** : ` True ` (always enabled) or ` False ` (always disabled)
374
- - ** Callable functions** : Functions that take ` (context, agent) ` and return a boolean
375
- - ** Async functions** : Async functions for complex conditional logic
373
+ - ** Boolean values** : ` True ` (always enabled) or ` False ` (always disabled)
374
+ - ** Callable functions** : Functions that take ` (context, agent) ` and return a boolean
375
+ - ** Async functions** : Async functions for complex conditional logic
376
376
377
377
Disabled tools are completely hidden from the LLM at runtime, making this useful for:
378
378
379
- - Feature gating based on user permissions
380
- - Environment-specific tool availability (dev vs prod)
381
- - A/B testing different tool configurations
382
- - Dynamic tool filtering based on runtime state
379
+ - Feature gating based on user permissions
380
+ - Environment-specific tool availability (dev vs prod)
381
+ - A/B testing different tool configurations
382
+ - Dynamic tool filtering based on runtime state
383
383
384
384
## Handling errors in function tools
385
385
0 commit comments