-
-
Notifications
You must be signed in to change notification settings - Fork 181
fix(openai): Fix and improve OpenAI audio handling #511
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
Conversation
@pushpak1300 can you take a look at this? |
Preview deployments for prism ⚡️
Commit: Deployment ID: Static site name: |
@aimeos Hey can you provide me the code which will reproduce the issue? With the below code i was able to generate the transcriptions.. $audioFile = Audio::fromLocalPath('audio.mp3');
$response = Prism::audio()
->using('openai', 'whisper-1')
->withInput($audioFile)
->asText();
dd($response)
The result i am getting
|
I noticed another issue #515 here is the fix for that where usage is not correctly shown |
I use this code, which is almost the same but it doesn't work with Prism 0.80:
Which Laravel version do you use? Maybe, there's a difference because the original code passes a specific structure of parameters and file. The code in the PR is much more robust. |
I am using this on laravel 12.20 with prism main branch. Which laravel version you are using ? |
I'm using v12.21.0. |
@pushpak1300 @sixlive
The tests aren't doing a real request, so they don't cover the problem of a wrong multipart HTTP request. |
Closing in favor of #535 |
Uploading audio files to OpenAI doesn't work at all because of incorrect usage of the Laravel HTTP facade for multipart requests. This PR fixes the upload problem and improves handling different response format from whisper-1 API depending on the sent provider specific parameters.