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

# Image to Text Agent

Create a file `image_to_text.py` with the following code:

```python image_to_text.py theme={null}
from pathlib import Path

from phi.agent import Agent
from phi.model.openai import OpenAIChat

agent = Agent(
    model=OpenAIChat(id="gpt-4o"),
    markdown=True,
)

image_path = Path(__file__).parent.joinpath("multimodal-agents.jpg")
agent.print_response(
    "Write a 3 sentence fiction story about the image",
    images=[str(image_path)],
)
```

## Usage

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

  <Step title="Install libraries">
    ```bash theme={null}
    pip install openai phidata
    ```
  </Step>

  <Step title="Run the agent">
    ```bash theme={null}
    python image_to_text.py
    ```
  </Step>
</Steps>
