nextcloud / nextcloud/integration_openai
Does not respect maximum content length for audio transcription
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 75
- Forks
- 32
- Avg merge
- 9d 8h
- Merged PRs (30d)
- 4
Description
Which version of integration_openai are you using?
3.5.0
Which version of Nextcloud are you using?
30.0.5
Which browser are you using? In case you are using the phone App, specify the Android or iOS version and device please.
N/A
Describe the Bug
When an audio file is submitted for transcription, OpenAiAPIService does not check the contentlength before submitting the API request. If the submitted audio file is too long for the API limits, it throws an API request error like this:
A TaskProcessing core:audio2text task with id 8 failed with the following message: OpenAI's Whisper transcription failed with: API request error: 413: Maximum content size limit (26214400) exceeded (26384610 bytes read)
Expected Behavior
The integration should detect the large content size and chunk the audio file for multi-part processing, or recompress with ffmpeg and the voice codec, etc.
At the very least it should throw an error or visible user message when the file is selected for processing and advise the user remediate it.
To Reproduce
Try to transcribe an audio file larger than 25MB with OpenAI API. I'm not sure if the maximum content size is adjustable in localAI but you could test it there too if you know the value.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with OpenAiAPIService and reproduce transcription with an audio file over 25 MB against the OpenAI API. Trace how the request handles content length and how task failures reach the user. Done should prevent an oversized request from failing opaquely, either through supported processing or a visible, actionable size error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100