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

# autogen.agentchat.contrib.img_utils.gpt4v_formatter

<code class="doc-symbol doc-symbol-heading doc-symbol-function" />

#### gpt4v\_formatter

```python theme={null}
gpt4v_formatter(prompt: str, img_format: str = 'uri') -> list[str | dict[str, Any]]
```

Formats the input prompt by replacing image tags and returns a list of text and images.<br />

<b>Parameters:</b>

| Name         | Description                                                                                                                     |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------- |
| `prompt`     | The input string that may contain image tags like `img ...>`.<br /><br />**Type:** str                                          |
| `img_format` | what image format should be used.<br /><br />One of "uri", "url", "pil".<br /><br />**Type:** str<br /><br />**Default:** 'uri' |

<b>Returns:</b>

| Type                                 | Description                                                                                 |
| ------------------------------------ | ------------------------------------------------------------------------------------------- |
| list\[str \| dict\[str, typing.Any]] | List\[Union\[str, dict\[str, Any]]]: A list of alternating text and image dictionary items. |

<br />
