What's Changed
- [UI] View top models by spend by @krrishdholakia in #2257
- [FEAT] Use Base64 images with vertex_ai/gemini-pro-vision by @ishaan-jaff in #2263
- [FEAT] add groq api pricing, models by @ishaan-jaff in #2268
- fix: change actual github action for a call to discord RESTful API by @DanielChico in #2262
Feature - Pass Base64 encoded images to vertex_ai/gemini-pro-vision
Docs: https://docs.litellm.ai/docs/providers/vertex#gemini-pro-vision
import litellm
def encode_image(image_path):
import base64
with open(image_path, "rb") as image_file:
return base64.b64encode(image_file.read()).decode("utf-8")
image_path = "cached_logo.jpg"
# Getting the base64 string
base64_image = encode_image(image_path)
response = litellm.completion(
model="vertex_ai/gemini-pro-vision",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "Whats in this image?"},
{
"type": "image_url",
"image_url": {
"url": "data:image/jpeg;base64," + base64_image
},
},
],
}
],
)
print(response)
New Contributors
- @DanielChico made their first contribution in #2262
Full Changelog: v1.28.1...v1.28.2