-
Notifications
You must be signed in to change notification settings - Fork 955
fix(google-generativeai,vertexai): image support for Gemini models #3340
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
Changes from all commits
20231b2
535e612
29bbfde
144929b
009db80
ef1b148
0c80bc9
544322e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,3 +1,9 @@ | ||||||||||||||||
| from typing import Callable | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| class Config: | ||||||||||||||||
| exception_logger = None | ||||||||||||||||
| use_legacy_attributes = True | ||||||||||||||||
| upload_base64_image: Callable[[str, str, str, str], str] = ( | ||||||||||||||||
| lambda trace_id, span_id, image_name, base64_string: str | ||||||||||||||||
| ) | ||||||||||||||||
|
Comment on lines
+7
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Fix default upload_base64_image: current lambda returns the The default should return a valid string (ideally a harmless placeholder URL) rather than the Apply this diff: - upload_base64_image: Callable[[str, str, str, str], str] = (
- lambda trace_id, span_id, image_name, base64_string: str
- )
+ # Default: do not upload, but return a harmless placeholder URL.
+ upload_base64_image: Callable[[str, str, str, str], str] = (
+ lambda trace_id, span_id, image_name, base64_string: "about:blank"
+ )Optionally, consider letting this be Optional[Callable] with None default and handling the fallback in span_utils for more explicit behavior. I can draft that change across both google_generativeai and vertexai configs to keep them consistent. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||
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.
The lambda returns the type 'str' instead of a string value. This default no-op doesn't match expected behavior. Consider returning a valid string (or an async no-op function) instead of the type.