basic_workflow_agentlike.py
1 """Basic Workflow with Agent-like consolidated params.""" 2 from praisonaiagents import Agent 3 from praisonaiagents import AgentFlow, Task 4 5 # Workflow with agent-like params (knowledge, web, guardrails, reflection) 6 workflow = AgentFlow( 7 name="AgentLikeWorkflow", 8 steps=[ 9 Task( 10 name="researcher", 11 action="Research the topic: {{input}}", 12 agent=Agent(instructions="You are a researcher."), 13 ), 14 Task( 15 name="writer", 16 action="Write about the research findings", 17 agent=Agent(instructions="You are a writer."), 18 ), 19 ], 20 # Agent-like consolidated params 21 knowledge=["docs/"], # Enable RAG 22 web=True, # Enable web search 23 guardrails=True, # Enable guardrails 24 reflection=True, # Enable self-reflection 25 ) 26 27 if __name__ == "__main__": 28 print(f"Workflow: {workflow.name}") 29 print(f"Knowledge: {workflow.knowledge}") 30 print(f"Web: {workflow.web}") 31 print(f"Guardrails: {workflow.guardrails}") 32 print(f"Reflection: {workflow.reflection}")