diff --git a/pages/generative-apis/how-to/query-vision-models.mdx b/pages/generative-apis/how-to/query-vision-models.mdx index be6d5321d3..a86347738b 100644 --- a/pages/generative-apis/how-to/query-vision-models.mdx +++ b/pages/generative-apis/how-to/query-vision-models.mdx @@ -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 @@ -156,8 +162,7 @@ payload = { } ] } - ], - ... # other parameters + ] } ```