> ## Documentation Index
> Fetch the complete documentation index at: https://ikun.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 具备思考工具的推理代理

## 代码

```python cookbook/reasoning/tools/claude_thinking_tools.py theme={null}
from agno.agent import Agent
from agno.models.anthropic import Claude
from agno.tools.thinking import ThinkingTools
from agno.tools.yfinance import YFinanceTools

reasoning_agent = Agent(
    model=Claude(id="claude-3-7-sonnet-latest"),
    tools=[
        ThinkingTools(add_instructions=True),
        YFinanceTools(
            stock_price=True,
            analyst_recommendations=True,
            company_info=True,
            company_news=True,
        ),
    ],
    instructions="尽可能使用表格",
    markdown=True,
)

if __name__ == "__main__":
    reasoning_agent.print_response(
        "撰写一份关于英伟达（NVDA）的报告。请只包含报告内容，不含其他任何文字说明。",
        stream=True,
        show_full_reasoning=True,
        stream_intermediate_steps=True,
    )


```

## 用法

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="设置你的 API 密钥">
    ```bash theme={null}
    export ANTHROPIC_API_KEY=xxx
    ```
  </Step>

  <Step title="安装库">
    ```bash theme={null}
    pip install -U anthropic agno
    ```
  </Step>

  <Step title="运行代理">
    <CodeGroup>
      ```bash Mac theme={null}
      python cookbook/reasoning/tools/claude_thinking_tools.py
      ```

      ```bash Windows theme={null}
      python cookbook/reasoning/tools/claude_thinking_tools.py
      ```
    </CodeGroup>
  </Step>
</Steps>
