Copy
Ask AI
from agno.agent import Agent
from agno.models.deepseek import DeepSeek
agent = Agent(
model=DeepSeek(id="deepseek-chat"),
markdown=True,
)
agent.print_response("Explain transformer architecture", stream=True)
Tool Use
Copy
Ask AI
from agno.agent import Agent
from agno.models.deepseek import DeepSeek
from agno.tools.yfinance import YFinanceTools
agent = Agent(
model=DeepSeek(id="deepseek-chat"),
tools=[YFinanceTools(stock_price=True)],
markdown=True,
)
agent.print_response("What's AAPL's stock price?", stream=True)
Reasoning
Copy
Ask AI
from agno.agent import Agent
from agno.models.deepseek import DeepSeek
agent = Agent(
model=DeepSeek(id="deepseek-reasoner"),
markdown=True,
)
agent.print_response(
"A bat and ball cost $1.10. The bat costs $1 more than the ball. How much does the ball cost?",
stream=True,
)
Structured Output
Copy
Ask AI
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.deepseek import DeepSeek
class Analysis(BaseModel):
summary: str = Field(..., description="Brief summary")
key_points: list[str] = Field(..., description="Key points")
agent = Agent(
model=DeepSeek(id="deepseek-chat"),
output_schema=Analysis,
)
agent.print_response("Analyze the benefits of reasoning models")
Run Examples
Copy
Ask AI
export DEEPSEEK_API_KEY=xxx
git clone https://github.com/agno-agi/agno.git
cd agno/cookbook/92_models/deepseek
python basic.py
python reasoning_agent.py
python tool_use.py