Set your OpenAI API key as an environment variable in your terminal:
Copy
export OPENAI_API_KEY=your_api_key_here
3
Create a file
Create a new file app.py with the basic setup:
Copy
from praisonaiagents import Agent, Task, Agents, Tools# Create reasoning agentreasoner = Agent( role="Problem Solver", goal="Solve complex problems using logical reasoning", backstory="Expert in logical analysis and problem-solving", tools=[Tools.internet_search],)# Create tasktask = Task( description="Analyze and solve a complex business problem", expected_output="Detailed solution with reasoning steps", agent=reasoner)# Create and start the agentsagents = Agents( agents=[reasoner], tasks=[task], process="sequential", verbose=2)# Start executionresult = agents.start()print(result)
4
Start Agents
Type this in your terminal to run your agents:
Copy
python app.py
1
Install Package
Install the PraisonAI package:
Copy
pip install praisonai
2
Set API Key
Set your OpenAI API key as an environment variable in your terminal:
Copy
export OPENAI_API_KEY=your_api_key_here
3
Create a file
Create a new file agents.yaml with the basic setup:
Copy
framework: praisonaiprocess: sequentialtopic: solve complex business problemagents: # Canonical: use 'agents' instead of 'roles' reasoner: instructions: # Canonical: use 'instructions' instead of 'backstory' Expert in logical analysis and problem-solving. goal: Solve complex problems using logical reasoning role: Problem Solver tools: - internet_search tasks: analysis_task: description: Analyze and solve a complex business problem. expected_output: Detailed solution with reasoning steps.
4
Start Agents
Type this in your terminal to run your agents:
Copy
praisonai agents.yaml
Requirements
Python 3.10 or higher
OpenAI API key. Generate OpenAI API key here. Use Other models using this guide.
Set your OpenAI API key as an environment variable in your terminal:
Copy
export OPENAI_API_KEY=your_api_key_here
3
Create a file
Create a new file app.py with the basic setup:
Copy
from praisonaiagents import Agent, Task, Agents, Tools# Create first agent for analysisanalyst = Agent( role="Business Analyst", goal="Analyze business problems and identify key issues", backstory="Expert in business analysis and problem identification", tools=[Tools.internet_search],)# Create second agent for solution developmentsolver = Agent( role="Solution Architect", goal="Develop comprehensive solutions to business problems", backstory="Expert in solution design and implementation",)# Create first taskanalysis_task = Task( description="Analyze the current market challenges", expected_output="Detailed analysis of key issues", agent=analyst)# Create second tasksolution_task = Task( description="Develop solutions for identified challenges", expected_output="Comprehensive solution strategy", agent=solver)# Create and start the agentsagents = Agents( agents=[analyst, solver], tasks=[analysis_task, solution_task], process="sequential")# Start executionresult = agents.start()
4
Start Agents
Type this in your terminal to run your agents:
Copy
python app.py
1
Install Package
Install the PraisonAI package:
Copy
pip install praisonai
2
Set API Key
Set your OpenAI API key as an environment variable in your terminal:
Copy
export OPENAI_API_KEY=your_api_key_here
3
Create a file
Create a new file agents.yaml with the basic setup:
Copy
framework: praisonaiprocess: sequentialtopic: solve market challengesagents: # Canonical: use 'agents' instead of 'roles' analyst: instructions: # Canonical: use 'instructions' instead of 'backstory' Expert in business analysis and problem identification. goal: Analyze business problems and identify key issues role: Business Analyst tools: - internet_search tasks: analysis_task: description: Analyze the current market challenges. expected_output: Detailed analysis of key issues. solver: instructions: # Canonical: use 'instructions' instead of 'backstory' Expert in solution design and implementation. goal: Develop comprehensive solutions to business problems role: Solution Architect tasks: solution_task: description: Develop solutions for identified challenges. expected_output: Comprehensive solution strategy.