basic_step_override.py
1 """Basic example showing step-level override of workflow defaults.""" 2 from praisonaiagents import Agent 3 from praisonaiagents import AgentFlow, Task 4 5 # Workflow with defaults 6 workflow = AgentFlow( 7 name="StepOverrideWorkflow", 8 steps=[ 9 Task( 10 name="step1", 11 action="Process with workflow defaults", 12 agent=Agent(instructions="You are a processor."), 13 # Uses workflow-level web=True (inherited) 14 ), 15 Task( 16 name="step2", 17 action="Process with step override", 18 agent=Agent(instructions="You are a processor."), 19 # Override workflow default 20 web=False, # Disable web for this step 21 reflection="thorough", # Use thorough reflection preset 22 ), 23 ], 24 # Workflow defaults 25 web=True, 26 reflection=True, 27 ) 28 29 if __name__ == "__main__": 30 print(f"Workflow web default: {workflow.web}") 31 print(f"Step1 web: {workflow.steps[0].web}") # None (uses workflow default) 32 print(f"Step2 web: {workflow.steps[1].web}") # False (overridden) 33 print(f"Step2 reflection: {workflow.steps[1].reflection}") # thorough