代码
cookbook/reasoning/models/ollama/reasoning_model_deepseek.py
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
from agno.agent import Agent
from agno.models.ollama.chat import Ollama
agent = Agent(
model=Ollama(id="llama3.2:latest"),
reasoning_model=Ollama(id="deepseek-r1:14b", max_tokens=4096),
)
agent.print_response(
"解决电车难题。评估多种伦理框架。包含一个解决此问题的 ASCII 图。",
stream=True,
)
创建虚拟环境
Terminal 并创建一个 python 虚拟环境。python3 -m venv .venv
source .venv/bin/activate
python3 -m venv .venv
.venv/scripts/activate
安装 Ollama
ollama pull llama3.2:latest
安装库
pip install -U ollama agno
运行 Agent
python cookbook/reasoning/models/ollama/reasoning_model_deepseek.py
python cookbook/reasoning/models/ollama/reasoning_model_deepseek.py