-
Notifications
You must be signed in to change notification settings - Fork 0
Quick Start
gitpavleenbali edited this page Feb 17, 2026
·
4 revisions
Get up and running with PYAI in 5 minutes.
pip install pyaiFor Azure OpenAI with Azure AD authentication:
pip install pyai[azure]Set your API keys:
# OpenAI
export OPENAI_API_KEY=sk-your-key
# Azure OpenAI (uses Azure AD - no API key needed!)
export AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
export AZURE_OPENAI_DEPLOYMENT=gpt-4o-minifrom pyai import ask
answer = ask("What is the capital of France?")
print(answer) # Parisfrom pyai import Agent, Runner
from pyai.skills import tool
@tool(description="Get weather for a city")
async def get_weather(city: str) -> str:
return f"Weather in {city}: Sunny, 72Β°F"
agent = Agent(
name="WeatherBot",
instructions="Help users with weather information.",
tools=[get_weather]
)
result = Runner.run_sync(agent, "What's the weather in Tokyo?")
print(result.final_output)from pyai import rag
docs = rag.index("./documents")
answer = docs.ask("What is the main conclusion?")- Three Dimensions - Understand the PYAI architecture
- One-Liner APIs - Explore all easy/ module functions
- Agent Framework - Build sophisticated agents
- Multi-Agent Systems - Orchestrate teams of agents
Intelligence, Embedded.