Skip to content
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

fixed verboseJson encoding #236

Merged
merged 3 commits into from
Jan 17, 2025

Conversation

Frank-Buss
Copy link
Contributor

What

This fixes the verboseJson encoding. I tested it with verboseJson, and works still with text as well.

Why

I got this error: Transcription failed: APIErrorResponse(error: OpenAI.APIError(message: "[{'type': 'enum', 'loc': ('body', 'response_format'), 'msg': "Input should be 'json', 'text', 'vtt', 'srt' or 'verbose_json'", 'input': 'verboseJson', 'ctx': {'expected': "'json', 'text', 'vtt', 'srt' or 'verbose_json'"}}]", type: "invalid_request_error", param: nil, code: nil))

because verboseJson was not encoded as verbose_json.

Affected Areas

AudioTranscriptionQuery

Copy link

sonarqubecloud bot commented Nov 8, 2024

@Frank-Buss
Copy link
Contributor Author

Anyone who wants to review it? I need this for my project. I can use my branch, but would be better to integrate this change, so it works for everybody. BTW, I needed it because Whisper returns nonsense for silence, which is easily fixed by testing no_speech_prob for > 0.4 with the verbose json response.

@nezhyborets
Copy link
Collaborator

Hi @Frank-Buss, thanks for your contribution! We may want to somehow breakdown the OpenAITests because the file is starting to become too big, but that is a question for another day.

@nezhyborets nezhyborets merged commit f6d0744 into MacPaw:main Jan 17, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants