-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refact: make GeminiMultiModal a thin wrapper around Gemini #17501
Conversation
self._guess_mimetype(decoded_img) | ||
return self | ||
|
||
def _guess_mimetype(self, img_data: bytes) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding this function to guess the mimetype not only in the init but also every time we resolve the image
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handy!
@@ -26,6 +26,9 @@ class CustomLLM(LLM): | |||
`_stream_complete`, and `metadata` methods. | |||
""" | |||
|
|||
def __init__(self, *args: Any, **kwargs: Any): | |||
super().__init__(*args, **kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to make mypy happy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mypy never had an issue with this before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry it was Pyright not mypy, it's mostly annoying in IDEs
@@ -17,17 +18,21 @@ | |||
MessageRole.TOOL: MessageRole.USER, | |||
MessageRole.FUNCTION: MessageRole.USER, | |||
} | |||
ROLES_FROM_GEMINI: Dict[MessageRole, MessageRole] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this worked only brecause MessageRole
derives from str
but let's be explicit
llama-index-integrations/llms/llama-index-llms-gemini/llama_index/llms/gemini/base.py
Show resolved
Hide resolved
llama-index-integrations/llms/llama-index-llms-gemini/llama_index/llms/gemini/base.py
Outdated
Show resolved
Hide resolved
...i_modal_llms/llama-index-multi-modal-llms-gemini/llama_index/multi_modal_llms/gemini/base.py
Outdated
Show resolved
Hide resolved
1b19bcf
to
af2aab2
Compare
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
0c0af0d
to
ac32d8b
Compare
fix unit test fix request_options handling save progress address review comment update notebook example fix completion docs handling
1f2ed00
to
a80e2ab
Compare
Blocked on #17509
Description
llms.gemini.Gemini
class.GeminiMultiModal
class a thin wrapper aroundGemini
to keep backward compatibilityPart of #15950
Version Bump?
Not releasing the package multimodal llm package, that needs to happen after we release core.