chore: fix openai vision models #4246
Merged
+9
−2
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.
Describe Your Changes
This press release aims to enable the OpenAI GPT-4o model’s vision capabilities.
Fixes Issues
Changes made
The code changes in this Git diff involve three primary modifications across different files:
package.json:
@janhq/inference-openai-extension
package is updated from1.0.4
to1.0.5
.models.json:
"vision_model": true
is added within the "settings" object.index.ts:
transformPayload
method to remove thestop
property from the payload if it is an empty array. Ifpayload.stop
is an empty array, it uses destructuring to omitstop
and reassigns the remaining parameters back topayload
. This is done before the existing transformation logic for preview models.These changes indicate a minor version update with an addition to the model settings to support a vision model and a code enhancement to handle empty stop word arrays in payload transformations.