Advanced tool chaining workflow with async execution
This example demonstrates advanced tool chaining where multiple tools are executed in sequence, with the Runner handling complex multi-step workflows automatically.
Copy
Ask AI
import asynciofrom dedalus_labs import AsyncDedalus, DedalusRunnerfrom dotenv import load_dotenvload_dotenv()def add(a: int, b: int) -> int: return a + bdef mul(x: int, y: int) -> int: return x * yasync def main(): client = AsyncDedalus() runner = DedalusRunner(client) result = await runner.run( input="1. Add 2 and 3. 2. Multiply that by 4. 3. Multiply this number by the age of the winner of the 2025 Wimbledon men's singles final. Use your tools to do this.", model=["openai/gpt-4.1"], tools=[add, mul], mcp_servers=["akakak/brave-search-mcp"], stream=False ) print(result.final_output)if __name__ == "__main__": asyncio.run(main())