fix - support base 64 image conversion for all gemini model

This commit is contained in:
Ishaan Jaff
2024-04-15 18:18:55 -07:00
parent cf4a38d361
commit 462da5a778
2 changed files with 6 additions and 1 deletions
+1
View File
@@ -583,6 +583,7 @@ from .utils import (
completion_cost,
supports_function_calling,
supports_parallel_function_calling,
supports_vision,
get_litellm_params,
Logging,
acreate,
+5 -1
View File
@@ -1286,7 +1286,11 @@ def prompt_factory(
messages=messages, prompt_format=prompt_format, chat_template=chat_template
)
elif custom_llm_provider == "gemini":
if model == "gemini-pro-vision":
if (
model == "gemini-pro-vision"
or litellm.supports_vision(model=model)
or litellm.supports_vision(model=custom_llm_provider + "/" + model)
):
return _gemini_vision_convert_messages(messages=messages)
else:
return gemini_text_image_pt(messages=messages)