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
Playground
Audio Conversation Agent
This example shows how to use the audio conversation agent with playground.
Code
cookbook/apps/playground/audio_conversation_agent.py
Copy
Ask AI
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.playground import Playground
from agno.storage.sqlite import SqliteStorage
audio_and_text_agent = Agent(
agent_id="audio-text-agent",
name="Audio and Text Chat Agent",
model=OpenAIChat(
id="gpt-4o-audio-preview",
modalities=["text", "audio"],
audio={"voice": "alloy", "format": "pcm16"},
),
debug_mode=True,
add_history_to_messages=True,
add_datetime_to_instructions=True,
storage=SqliteStorage(
table_name="audio_agent", db_file="tmp/audio_agent.db", auto_upgrade_schema=True
),
)
playground = Playground(
agents=[audio_and_text_agent],
name="Audio Conversation Agent",
description="A playground for audio conversation agent",
app_id="audio-conversation-agent",
)
app = playground.get_app()
if __name__ == "__main__":
playground.serve(app="audio_conversation_agent:app", reload=True)
Usage
1
Create a virtual environment
Open the Terminal
and create a python virtual environment.
Copy
Ask AI
python3 -m venv .venv
source .venv/bin/activate
2
Set your API key
Copy
Ask AI
export OPENAI_API_KEY=xxx
3
Install libraries
Copy
Ask AI
pip install -U agno "uvicorn[standard]" openai
4
Run Agent
Copy
Ask AI
python cookbook/apps/playground/audio_conversation_agent.py
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.