Sweep: Use STT model name when calling OpenAI API #9
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.
Purpose
This pull request addresses an issue where the STT model name is not used when calling the OpenAI API, resulting in the default model
whisper-1
being used instead of the configured model.Description
The changes in this pull request include:
In the
backend/apps/audio/main.py
file, thetranscribe
function now accepts amodel
parameter, which is used to set themodel_size_or_path
in thewhisper_kwargs
dictionary.In the
src/lib/apis/openai/index.ts
file, a newtranscribe
function has been added that takes amodel
parameter and appends it to the form data when making the API request to OpenAI.In the
src/lib/components/chat/Settings/Audio.svelte
file, a new input field has been added to allow the user to specify the STT model name when thewhisper-openai
STT engine is selected.Summary
backend/apps/audio/main.py
to use the providedmodel
parameter when calling the OpenAI APItranscribe
function insrc/lib/apis/openai/index.ts
that accepts amodel
parametersrc/lib/components/chat/Settings/Audio.svelte
to allow the user to specify the STT model name when using thewhisper-openai
engineFixes #8.
Tip
To get Sweep to edit this pull request, you can:
This is an automated message generated by Sweep AI.