Promote vision functions out of beta #926
Merged
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.
Vision is no longer in beta, as it is officially supported on both GPT-4-Turbo and GPT-4o. That means we can move Marvin's vision functions out of beta as well.
Happily, the final versions of the API are much more powerful than the ones we built the original vision functions for. Marvin's original, beta implementation of the various vision-enhanced required two calls to the LLM: one to caption the images with an eye toward capturing detail relevant for the processing task at hand, and a second to take the resulting text and process it (e.g. for classification, casting, etc.).
The final API can do that in a single pass, so I've modified all the classic Marvin functions (cast, classify, extract) to accept image inputs in addition to strings (or, most interestingly, a mix of images and strings!). These work well and are much faster (almost twice as fast!) than the two-pass beta versions.