Examples
- Examples
- Getting Started
- Agents
- Teams
- Workflows
- Applications
- 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
Async
Reasoning Agent
Code
cookbook/agent_concepts/async/reasoning.py
Copy
Ask AI
import asyncio
from agno.agent import Agent
from agno.cli.console import console
from agno.models.openai import OpenAIChat
task = "9.11 and 9.9 -- which is bigger?"
regular_agent = Agent(model=OpenAIChat(id="gpt-4o"), markdown=True)
reasoning_agent = Agent(
model=OpenAIChat(id="gpt-4o"),
reasoning=True,
markdown=True,
)
console.rule("[bold green]Regular Agent[/bold green]")
asyncio.run(regular_agent.aprint_response(task, stream=True))
console.rule("[bold yellow]Reasoning Agent[/bold yellow]")
asyncio.run(
reasoning_agent.aprint_response(task, stream=True, show_full_reasoning=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
Install libraries
Copy
Ask AI
pip install -U openai agno
3
Run Agent
Copy
Ask AI
python cookbook/agent_concepts/async/reasoning.py
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.