You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I am seeing an issue in the Audio Transcribe routine for response_format type of 'text'.
Code works for: srt, json, verbose_json, srt and vtt
Does not work for: text
describe'#transcriptions'do# https://platform.openai.com/docs/api-reference/audio/createTranscriptionlet(:file){'spec/sample_files/audio/01-introduction.mp3'}let(:model){'whisper-1'}# let(:response_format) { %w[json text srt verbose_json vtt].sample }let(:response_format){'text'}let(:parameters){{file: File.open(file,"rb"),model: model,response_format: response_format}}it'transcribes audio'doL.kv'Response Format',response_formatputs1response=client.audio.transcribe(parameters: parameters)puts'does not reach this for text'putsresponse# L.json(response)rescueStandardError=>eL.errore.messageendend
I believe the error is coming from to_json
defjson_post(path:,parameters:)to_json(conn.post(uri(path: path))do |req|
ifparameters[:stream].respond_to?(:call)req.options.on_data=to_json_stream(user_proc: parameters[:stream])parameters[:stream]=true# Necessary to tell OpenAI to stream.elsifparameters[:stream]raiseArgumentError,"The stream parameter must be a Proc or have a #call method"endreq.headers=headersreq.body=parameters.to_jsonend&.body)end
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: [e.g. iOS]
Browser [e.g. chrome, safari]
Version [e.g. 22]
Smartphone (please complete the following information):
Device: [e.g. iPhone6]
OS: [e.g. iOS8.1]
Browser [e.g. stock browser, safari]
Version [e.g. 22]
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
I am seeing an issue in the Audio Transcribe routine for response_format type of 'text'.
Code works for: srt, json, verbose_json, srt and vtt
Does not work for: text
I believe the error is coming from
to_json
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: