Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions pages/generative-apis/how-to/query-vision-models.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,13 @@ A conversation style may include a default system prompt. You may set this promp
1. **Image URLs**: If the image is available online, you can just include the image URL in your request as demonstrated above. This approach is simple and does not require any encoding.
2. **Base64 encoded**: image Base64 encoding is a standard way to transform binary data, like images, into a text format, making it easier to transmit over the internet.

The following Python code sample shows you how to encode an image in base64 format and pass it to your request payload.
To encode Base64 images in Python, you first need to install `Pillow` library:

```bash
pip install pillow
```

Then, the following Python code sample shows you how to encode an image in Base64 format and pass it to your request payload:

```python
import base64
Expand Down Expand Up @@ -156,8 +162,7 @@ payload = {
}
]
}
],
... # other parameters
]
}

```
Expand Down