from praisonaiagents import Agent# Create your first agentagent = Agent( name="ResearchAssistant", instructions="You are a helpful research assistant. Explain things simply and clearly.")# Ask it a questionagent.start("Explain how solar panels work in simple terms")
4
Run Your Agent
python my_agent.py
You should see the agent’s response explaining solar panels!
from praisonaiagents import Agentcoder = Agent( name="CodeHelper", instructions="You are a Python expert. Explain code simply and provide working examples.")coder.start("How do I read a CSV file in Python?")
from praisonaiagents import Agentwriter = Agent( name="StoryWriter", instructions="You write short, engaging stories with vivid descriptions.")writer.start("Write a short story about a robot learning to paint")
from praisonaiagents import Agenttutor = Agent( name="MathTutor", instructions="You explain math concepts step by step. Use simple language.")tutor.start("Explain how percentages work")
from praisonaiagents import Agent# Create a research assistantassistant = Agent( name="ResearchAssistant", instructions="""You are a helpful research assistant.When answering:- Be concise and clear- Use bullet points when helpful- Explain complex topics simply- Admit when you don't know something""")# Ask multiple questionsassistant.start("What are the benefits of exercise?")assistant.start("How does the internet work?")assistant.start("Explain climate change in simple terms")