docs: update detection core with tips for using Gemini integration#1925
Merged
Borda merged 5 commits intoroboflow:developfrom Feb 4, 2026
Merged
docs: update detection core with tips for using Gemini integration#1925Borda merged 5 commits intoroboflow:developfrom
Borda merged 5 commits intoroboflow:developfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Detections.from_lmm() / Detections.from_vlm() documentation to add Gemini-specific prompt engineering tips, emphasizing best-practice ordering for mixed image+text requests.
Changes:
- Added a “Prompt engineering” tip block for Gemini 2.0 describing normalized box coordinates and recommended prompt guidance.
- Added a note for Gemini 2.5 about placing the text prompt after the image part in the
contentsarray for single-image prompts.
Borda
reviewed
Feb 4, 2026
Borda
reviewed
Feb 4, 2026
Borda
approved these changes
Feb 4, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1925 +/- ##
=======================================
Coverage 72% 72%
=======================================
Files 61 61
Lines 7245 7245
=======================================
Hits 5242 5242
Misses 2003 2003 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
On request of @SkalskiP at PR: https://github.com/roboflow/notebooks/pull/384
This PR improves the documentation regarding the ordering of content in requests that combine images with text prompts. Following Google's Gemini API best practices, text prompts are now placed after image parts in the contents array when using a single image with text.
Type of change
How has this change been tested, please provide a testcase or example of how you tested the change?
According to the Gemini API documentation on image prompts, when using a single image with text, the recommended approach is to place the text prompt after the image part in the contents array. This ordering has been shown to produce significantly better results in practice.
In our testing with Process & Instrument Diagrams (P&IDs) using object detection, this reordering led to drastically improved accuracy in bounding box positioning. While the object labels were already accurate, the spatial precision of detected elements improved considerably with the optimized prompt ordering
Docs