Skip to content

Commit 94388bd

Browse files
fpagnybene2k1RoRoJ
authored
Update query-vision-models.mdx (#4412)
* Update query-vision-models.mdx Add snippets related to dependencies installation * Update pages/generative-apis/how-to/query-vision-models.mdx Co-authored-by: Rowena Jones <[email protected]> --------- Co-authored-by: Benedikt Rollik <[email protected]> Co-authored-by: Rowena Jones <[email protected]>
1 parent adcf519 commit 94388bd

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

pages/generative-apis/how-to/query-vision-models.mdx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,13 @@ A conversation style may include a default system prompt. You may set this promp
123123
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.
124124
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.
125125

126-
The following Python code sample shows you how to encode an image in base64 format and pass it to your request payload.
126+
To encode Base64 images in Python, you first need to install `Pillow` library:
127+
128+
```bash
129+
pip install pillow
130+
```
131+
132+
Then, the following Python code sample shows you how to encode an image in Base64 format and pass it to your request payload:
127133

128134
```python
129135
import base64
@@ -156,8 +162,7 @@ payload = {
156162
}
157163
]
158164
}
159-
],
160-
... # other parameters
165+
]
161166
}
162167

163168
```

0 commit comments

Comments
 (0)