feat(ai): add transcription support#1470
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1470 +/- ##
==========================================
+ Coverage 69.26% 69.32% +0.05%
==========================================
Files 373 374 +1
Lines 29523 29686 +163
==========================================
+ Hits 20450 20580 +130
- Misses 8135 8159 +24
- Partials 938 947 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds a fluent AI transcription workflow to the framework, including contracts, facade/application plumbing, helper constructors, OpenAI /audio/transcriptions support, response types, errors, mocks, config stubs, and tests.
Changes:
- Added transcription request/response/provider contracts and application request handling.
- Implemented OpenAI transcription generation, diarized segment parsing, usage mapping, and config defaults.
- Added helper package APIs, generated mocks, and regression tests.
Reviewed changes
Copilot reviewed 16 out of 20 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
mocks/ai/TranscriptionResponse.go |
Adds generated transcription response mock. |
mocks/ai/TranscriptionRequest.go |
Adds generated transcription request mock. |
mocks/ai/TranscriptionProvider.go |
Adds generated transcription provider mock. |
mocks/ai/AI.go |
Adds mocked AI.Transcription. |
errors/list.go |
Adds transcription-related AI errors. |
contracts/ai/transcription.go |
Defines transcription request and segment contracts. |
contracts/ai/response.go |
Adds transcription response contract. |
contracts/ai/provider.go |
Adds transcription prompt/provider contracts. |
contracts/ai/config.go |
Adds transcription model config. |
contracts/ai/ai.go |
Adds transcription entrypoint to AI contract. |
ai/transcription/transcription.go |
Adds transcription helper constructors. |
ai/transcription/transcription_test.go |
Tests transcription helper constructors. |
ai/transcription_request.go |
Implements fluent transcription request. |
ai/setup/stubs.go |
Updates generated AI config stub. |
ai/response.go |
Implements transcription response storage/accessors. |
ai/response_transcription_test.go |
Tests transcription response behavior. |
ai/openai/provider.go |
Implements OpenAI transcription support. |
ai/openai/provider_test.go |
Adds OpenAI transcription tests. |
ai/application.go |
Wires transcription through application/provider resolution. |
ai/application_test.go |
Tests transcription application/request flow. |
Files not reviewed (4)
- mocks/ai/AI.go: Language not supported
- mocks/ai/TranscriptionProvider.go: Language not supported
- mocks/ai/TranscriptionRequest.go: Language not supported
- mocks/ai/TranscriptionResponse.go: Language not supported
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 20 changed files in this pull request and generated 3 comments.
Files not reviewed (4)
- mocks/ai/AI.go: Language not supported
- mocks/ai/TranscriptionProvider.go: Language not supported
- mocks/ai/TranscriptionRequest.go: Language not supported
- mocks/ai/TranscriptionResponse.go: Language not supported
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 22 changed files in this pull request and generated 2 comments.
Files not reviewed (4)
- mocks/ai/AI.go: Language not supported
- mocks/ai/TranscriptionProvider.go: Language not supported
- mocks/ai/TranscriptionRequest.go: Language not supported
- mocks/ai/TranscriptionResponse.go: Language not supported
@copilot review the rest files. |
Agent-Logs-Url: https://github.com/goravel/framework/sessions/fd686dee-9139-4d5c-9ad1-2922227e7dd6 Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com>
... Reviewed the remaining files. Found two issues to fix (commit
All other changed files ( |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 24 changed files in this pull request and generated 2 comments.
Files not reviewed (4)
- mocks/ai/AI.go: Language not supported
- mocks/ai/TranscriptionProvider.go: Language not supported
- mocks/ai/TranscriptionRequest.go: Language not supported
- mocks/ai/TranscriptionResponse.go: Language not supported
Summary
/audio/transcriptionssupport with default transcription models, diarized segment parsing, provider capability validation, and regression coverage for nil-file and empty-response cases.Closes goravel/goravel#963
Why
This branch adds the missing speech-to-text workflow to Goravel's AI package, so applications can transcribe audio through the same fluent request style already used for chat, audio, and image generation. The new contracts and helpers make it possible to pass uploaded files or stored audio directly into a provider-backed transcription request without dropping down to provider-specific code.
The OpenAI implementation now handles both standard and diarized transcription responses, preserves usage metadata, and rejects invalid file inputs before making a provider request. That keeps the new API aligned with the rest of the framework while covering the edge cases and follow-up fixes added during review.