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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Frank-Buss
Copy link

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
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.

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.

1 participant