Models
- Recommended:
mistral/mistral-large-latest(best quality) - Medium:
mistral/mistral-medium-latest(balanced) - Small:
mistral/mistral-small-latest(fast, efficient) - Code:
mistral/codestral-latest(coding tasks)
Python
Copy
# export MISTRAL_API_KEY=your-api-key
from praisonaiagents import Agent
agent = Agent(
instructions="You are a helpful assistant",
llm="mistral/mistral-large-latest"
)
agent.start("Explain transformer architecture")
With Tools
Copy
# export MISTRAL_API_KEY=your-api-key
from praisonaiagents import Agent
def analyze_code(code: str) -> str:
"""Analyze code for issues."""
return f"Analysis of code: {code[:50]}..."
agent = Agent(
instructions="You are a code reviewer",
llm="mistral/codestral-latest",
tools=[analyze_code]
)
agent.start("Review this Python function")
Multi-Agent
Copy
# export MISTRAL_API_KEY=your-api-key
from praisonaiagents import Agent, Task, Agents
researcher = Agent(
instructions="You research topics thoroughly",
llm="mistral/mistral-large-latest"
)
writer = Agent(
instructions="You write clear summaries",
llm="mistral/mistral-small-latest"
)
task1 = Task(description="Research LLM architectures", agent=researcher)
task2 = Task(description="Write a summary", agent=writer)
agents = AgentManager(agents=[researcher, writer], tasks=[task1, task2])
agents.start()
CLI
Copy
export MISTRAL_API_KEY=your-api-key
# Basic prompt
python -m praisonai "Explain AI" --llm mistral/mistral-large-latest
# With temperature
python -m praisonai "Write a story" --llm mistral/mistral-small-latest --temperature 0.8
# Run agents.yaml
python -m praisonai
YAML
Copy
framework: praisonai
topic: AI architecture research
agents:
researcher:
role: AI Researcher
goal: Research AI architectures
instructions: You are an expert in AI systems
llm:
model: mistral/mistral-large-latest
tasks:
research_task:
description: Research the latest AI architectures
expected_output: Comprehensive architecture report
writer:
role: Technical Writer
goal: Create clear documentation
instructions: You write clear technical content
llm:
model: mistral/mistral-small-latest
tasks:
write_task:
description: Write a summary of the research
expected_output: Well-written technical summary

