Aggregator Pattern
Overview
Demo Scenario: Daily Briefing Synthesizer
Diagram
Implementation Steps
from glaip_sdk import Agent from tools.mock_time_tool import MockTimeTool, MockCalendarTool, MockWeatherTool time_calendar_agent = Agent( name="time_calendar_agent", tools=[MockTimeTool, MockCalendarTool], model="openai/gpt-5-mini" ) weather_agent = Agent( name="weather_agent", tools=[MockWeatherTool], model="openai/gpt-5-mini" ) synth_agent = Agent( name="synth_agent", instruction="Synthesize a brief morning briefing...", model="openai/gpt-5-mini" )from gllm_pipeline.steps import parallel, step, transform pipeline = ( parallel(branches=[time_calendar_step, weather_step]) | transform( join_partials, ["time_text", "weather_text"], "partials_text" ) | step( component=synth_agent.to_component(), input_state_map={"query": "partials_text"}, output_state="final_answer" ) ) pipeline.state_type = Stateresult = await pipeline.invoke(state) print(result['final_answer'])
How to Run
Output
Notes
Related Documentation
Last updated