Generate your OpenAI API key from OpenAI.
Use other LLM providers like Ollama, Anthropic, Groq, Google, etc. Please refer to the Models for more information.
3
Create Agents
Create app.py:
Copy
from praisonaiagents import Agent, PraisonAIAgents# Create a simple agentsummarise_agent = Agent(instructions="Summarise Photosynthesis")# Run the agentagents = PraisonAIAgents(agents=[summarise_agent])agents.start()
4
Run Agents
Execute your script:
Copy
python app.py
You’ll see:
Agent initialization
Task execution progress
Final results
You have successfully CreatedAI Agents and made them work for you!
Generate your OpenAI API key from OpenAI
Use other LLM providers like Ollama, Anthropic, Groq, Google, etc. Please refer to the Models for more information.
3
Create Agent
Create app.py:
Copy
from praisonaiagents import Agent, Task, PraisonAIAgents# Create an agentresearcher = Agent( name="Researcher", role="Senior Research Analyst", goal="Uncover cutting-edge developments in AI", backstory="You are an expert at a technology research group", verbose=True, llm="gpt-4o")# Define a tasktask = Task( name="research_task", description="Analyze 2024's AI advancements", expected_output="A detailed report", agent=researcher)# Run the agentsagents = PraisonAIAgents( agents=[researcher], tasks=[task], verbose=False)result = agents.start()