From 9719df7d69223c8fbb722cd4ebbdc4be3279cac4 Mon Sep 17 00:00:00 2001 From: leonardotrapani Date: Sun, 1 Feb 2026 00:44:10 +0100 Subject: [PATCH] add gpt-4o-transcribe models to openai provider --- internal/provider/openai.go | 44 +++++++++++++++--------------- internal/provider/provider_test.go | 10 ++++--- progress.txt | 13 +++++---- tasks/prd.jsonc | 2 +- 4 files changed, 37 insertions(+), 32 deletions(-) diff --git a/internal/provider/openai.go b/internal/provider/openai.go index 941d887..227ae94 100644 --- a/internal/provider/openai.go +++ b/internal/provider/openai.go @@ -41,6 +41,28 @@ func (p *OpenAIProvider) Models() []Model { SupportedLanguages: allLangs, Endpoint: &EndpointConfig{BaseURL: "https://api.openai.com", Path: "/v1/audio/transcriptions"}, }, + { + ID: "gpt-4o-transcribe", + Name: "GPT-4o Transcribe", + Description: "High quality transcription with GPT-4o", + Type: Transcription, + Streaming: false, + Local: false, + AdapterType: "openai", + SupportedLanguages: allLangs, + Endpoint: &EndpointConfig{BaseURL: "https://api.openai.com", Path: "/v1/audio/transcriptions"}, + }, + { + ID: "gpt-4o-mini-transcribe", + Name: "GPT-4o Mini Transcribe", + Description: "Fast transcription with GPT-4o Mini", + Type: Transcription, + Streaming: false, + Local: false, + AdapterType: "openai", + SupportedLanguages: allLangs, + Endpoint: &EndpointConfig{BaseURL: "https://api.openai.com", Path: "/v1/audio/transcriptions"}, + }, // LLM models { ID: "gpt-4o-mini", @@ -64,28 +86,6 @@ func (p *OpenAIProvider) Models() []Model { SupportedLanguages: allLangs, Endpoint: &EndpointConfig{BaseURL: "https://api.openai.com", Path: "/v1/chat/completions"}, }, - { - ID: "gpt-4-turbo", - Name: "GPT-4 Turbo", - Description: "Faster GPT-4 with large context window", - Type: LLM, - Streaming: false, - Local: false, - AdapterType: "openai", - SupportedLanguages: allLangs, - Endpoint: &EndpointConfig{BaseURL: "https://api.openai.com", Path: "/v1/chat/completions"}, - }, - { - ID: "gpt-3.5-turbo", - Name: "GPT-3.5 Turbo", - Description: "Fast and cost-effective", - Type: LLM, - Streaming: false, - Local: false, - AdapterType: "openai", - SupportedLanguages: allLangs, - Endpoint: &EndpointConfig{BaseURL: "https://api.openai.com", Path: "/v1/chat/completions"}, - }, } } diff --git a/internal/provider/provider_test.go b/internal/provider/provider_test.go index 58ef292..3492364 100644 --- a/internal/provider/provider_test.go +++ b/internal/provider/provider_test.go @@ -176,11 +176,13 @@ func TestModelsOfType(t *testing.T) { trans := ModelsOfType(p, Transcription) llm := ModelsOfType(p, LLM) - if len(trans) != 1 { - t.Errorf("ModelsOfType(Transcription) = %d, want 1", len(trans)) + // OpenAI has 3 transcription models: whisper-1, gpt-4o-transcribe, gpt-4o-mini-transcribe + if len(trans) != 3 { + t.Errorf("ModelsOfType(Transcription) = %d, want 3", len(trans)) } - if len(llm) != 4 { - t.Errorf("ModelsOfType(LLM) = %d, want 4", len(llm)) + // OpenAI has 2 LLM models: gpt-4o-mini, gpt-4o + if len(llm) != 2 { + t.Errorf("ModelsOfType(LLM) = %d, want 2", len(llm)) } } diff --git a/progress.txt b/progress.txt index b6a2c53..2279086 100644 --- a/progress.txt +++ b/progress.txt @@ -10,13 +10,16 @@ Started: Sun Feb 1 12:22:47 AM CET 2026 - Full 57 language list from OpenAI Whisper - All tests passing, typecheck passes -### Task 2: Add language list and provider-specific mappings -- Added `ToProviderFormat(code string, providerName string) string` function -- Handles auto-detect: whisper-cpp uses "auto", others use "" -- Deepgram locale mappings: en->en-US, pt->pt-BR, zh->zh-CN -- Added comprehensive test coverage for all provider formats +### Task 8: Migrate OpenAI provider to new Model structure +- Added gpt-4o-transcribe and gpt-4o-mini-transcribe transcription models +- Removed gpt-4-turbo and gpt-3.5-turbo LLM models (not in PRD) +- OpenAI now has 5 models: 3 transcription (whisper-1, gpt-4o-transcribe, gpt-4o-mini-transcribe) + 2 LLM (gpt-4o-mini, gpt-4o) +- All models have AdapterType='openai', Endpoint with BaseURL='https://api.openai.com' +- All models use language.AllLanguageCodes() for SupportedLanguages (57 languages) +- Updated provider_test.go to expect 3 transcription and 2 LLM models - All tests passing, typecheck passes + ### Task 3: Create Model type with full metadata - Created `internal/provider/model.go` - ModelType enum: Transcription, LLM diff --git a/tasks/prd.jsonc b/tasks/prd.jsonc index d9597d9..96b3b74 100644 --- a/tasks/prd.jsonc +++ b/tasks/prd.jsonc @@ -215,7 +215,7 @@ "IsLocal() returns false", "Typecheck passes" ], - "passes": false + "passes": true }, { "title": "Migrate Groq provider to new Model structure",