from praisonaiagents import Agent# Simple but effective instructionsagent = Agent( instructions="You are a helpful coding assistant. Explain concepts simply and provide working code examples.")agent.start("How do I read a file in Python?")
# ❌ No guidanceinstructions = "Answer questions"# ✅ Clear styleinstructions = "Answer in bullet points. Keep explanations under 3 sentences."
4
4. Constraints - What should it avoid?
Copy
# ✅ With boundariesinstructions = """You are a coding assistant.- Only answer programming questions- Never execute dangerous commands- Ask for clarification if the question is unclear"""
from praisonaiagents import Agentagent = Agent( name="CodeHelper", instructions="""You are a senior Python developer.Your goal: Help users write clean, working Python code.When answering:1. First understand what the user wants2. Provide a working code example3. Explain the key parts brieflyStyle:- Use simple language- Include comments in code- Show expected outputConstraints:- Only answer Python questions- Keep explanations short- Ask if something is unclear""")agent.start("How do I sort a list of dictionaries by a key?")
from praisonaiagents import Agentagent = Agent( instructions="""You are a [ROLE] with expertise in [AREA].Your goal: [WHAT TO ACHIEVE]When responding:1. [FIRST STEP]2. [SECOND STEP]3. [THIRD STEP]Style: [HOW TO FORMAT RESPONSES]Constraints:- [WHAT TO AVOID]- [BOUNDARIES]""")