Examples
- Examples
- Getting Started
- Agents
- Teams
- Workflows
- Applications
- FastAPI
- WhatsApp
- Slack
- Playground
- AG-UI
- Streamlit Apps
- Evals
Agent Concepts
- Reasoning
- Multimodal
- RAG
- User Control Flows
- Knowledge
- Memory
- Async
- Hybrid Search
- Storage
- Tools
- Vector Databases
- Context
- Embedders
- Agent State
- Observability
- Miscellaneous
Models
- Anthropic
- AWS Bedrock
- AWS Bedrock Claude
- Azure AI Foundry
- Azure OpenAI
- Cerebras
- Cerebras OpenAI
- Cohere
- DeepInfra
- DeepSeek
- Fireworks
- Gemini
- Groq
- Hugging Face
- IBM
- LM Studio
- LiteLLM
- LiteLLM OpenAI
- Meta
- Mistral
- NVIDIA
- Ollama
- OpenAI
- Perplexity
- Together
- XAI
- Vercel
WhatsApp
Basic
Code
cookbook/apps/whatsapp/basic.py
Copy
from agno.agent import Agent
from agno.app.whatsapp.app import WhatsappAPI
from agno.models.openai import OpenAIChat
basic_agent = Agent(
name="Basic Agent",
model=OpenAIChat(id="gpt-4o"),
add_history_to_messages=True,
num_history_responses=3,
add_datetime_to_instructions=True,
markdown=True,
)
whatsapp_app = WhatsappAPI(
agent=basic_agent,
name="Basic Agent",
app_id="basic_agent",
description="A basic agent that can answer questions and help with tasks.",
)
app = whatsapp_app.get_app()
if __name__ == "__main__":
whatsapp_app.serve(app="basic:app", port=8000, reload=True)
Usage
1
Create a virtual environment
Open the Terminal
and create a python virtual environment.
Copy
python3 -m venv .venv
source .venv/bin/activate
2
Set your API key
Copy
export OPENAI_API_KEY=xxx
3
Install libraries
Copy
pip install -U agno openai "uvicorn[standard]"
4
Run Agent
Copy
python cookbook/apps/whatsapp/basic.py
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.