> ## 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/models/ollama/image_agent.py theme={null}
from pathlib import Path

from agno.agent import Agent
from agno.media import Image
from agno.models.ollama import Ollama

agent = Agent(
    model=Ollama(id="llama3.2-vision"),
    markdown=True,
)

image_path = Path(__file__).parent.joinpath("super-agents.png")
agent.print_response(
    "写一个关于这张图片的3句话的虚构故事",
    images=[Image(filepath=image_path)],
)
```

## 用法

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

  <Step title="安装 Ollama">
    遵循[安装指南](https://github.com/ollama/ollama?tab=readme-ov-file#macos)并运行：

    ```bash theme={null}
    ollama pull llama3.2-vision
    ```
  </Step>

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

  <Step title="运行代理">
    <CodeGroup>
      ```bash Mac theme={null}
      python cookbook/models/ollama/image_agent.py
      ```

      ```bash Windows theme={null}
      python cookbook/models/ollama/image_agent.py
      ```
    </CodeGroup>
  </Step>
</Steps>
