feat: implement generate subtitles provider#381
Conversation
b446aa7 to
3c8362b
Compare
lukasdotcom
left a comment
There was a problem hiding this comment.
A few comments. Also remember to fix the psalm error
Psalm is failing because nextcloud/server#61127 hasn't been merged yet. Once that changes, it should be green again, I think. |
If that fixes it we can wait until the server's pr is merged. |
| // Maximum file size for OpenAI is 25MB. (https://developers.openai.com/api/docs/guides/speech-to-text) | ||
| if ($fileSize > 25 * 1000 * 1000) { | ||
| throw new ProcessingException('Filesize of input too large. Max is 25MB'); |
There was a problem hiding this comment.
would be nice to have this as a user-facing exception, same for the mimetype check below
see #383
| 'alloy', 'ash', 'ballad', 'coral', 'echo', 'fable', | ||
| 'onyx', 'nova', 'sage', 'shimmer', 'verse' | ||
| ]; | ||
| public const DEFAULT_SUBTITLE_FORMAT = 'srt'; |
| public const DEFAULT_SUBTITLE_FORMATS = [ | ||
| 'srt', 'vtt' | ||
| ]; |
There was a problem hiding this comment.
nit: how does SUPPORTED_SUBTITLE_FORMATS sound? Default would imply it can be changed.
Signed-off-by: Edward Ly <contact@edward.ly>
3c8362b to
a78dfe9
Compare
…will get in nextcloud/ocp soon Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
Requires nextcloud/server#61127 and nextcloud/assistant#577
Registers the app as a new provider for the
core:audio2text:subtitlestask, reusing the transcription API to produce output as.srtor.vttfiles instead of just text. Lightly tested with an MP3 of this podcast episode.🤖 AI (if applicable)