feat: refactor

This commit is contained in:
leonardotrapani
2026-02-01 17:24:43 +01:00
parent 13b1de4e04
commit 8df3021a9d
33 changed files with 1290 additions and 1577 deletions
+20 -23
View File
@@ -10,7 +10,7 @@ import (
type OpenAIProvider struct{}
func (p *OpenAIProvider) Name() string {
return "openai"
return ProviderOpenAI
}
func (p *OpenAIProvider) RequiresAPIKey() bool {
@@ -37,9 +37,10 @@ func (p *OpenAIProvider) Models() []Model {
Name: "Whisper 1",
Description: "OpenAI's production speech-to-text model",
Type: Transcription,
Streaming: false,
SupportsBatch: true,
SupportsStreaming: false,
Local: false,
AdapterType: "openai",
AdapterType: AdapterOpenAI,
SupportedLanguages: allLangs,
Endpoint: &EndpointConfig{BaseURL: "https://api.openai.com", Path: "/v1/audio/transcriptions"},
DocsURL: docsURL,
@@ -49,11 +50,14 @@ func (p *OpenAIProvider) Models() []Model {
Name: "GPT-4o Transcribe",
Description: "High quality transcription with GPT-4o",
Type: Transcription,
Streaming: false,
SupportsBatch: true,
SupportsStreaming: true,
Local: false,
AdapterType: "openai",
AdapterType: AdapterOpenAI,
StreamingAdapter: AdapterOpenAIRealtime,
SupportedLanguages: allLangs,
Endpoint: &EndpointConfig{BaseURL: "https://api.openai.com", Path: "/v1/audio/transcriptions"},
StreamingEndpoint: &EndpointConfig{BaseURL: "wss://api.openai.com", Path: "/v1/realtime"},
DocsURL: docsURL,
},
{
@@ -61,23 +65,14 @@ func (p *OpenAIProvider) Models() []Model {
Name: "GPT-4o Mini Transcribe",
Description: "Fast transcription with GPT-4o Mini",
Type: Transcription,
Streaming: false,
SupportsBatch: true,
SupportsStreaming: true,
Local: false,
AdapterType: "openai",
AdapterType: AdapterOpenAI,
StreamingAdapter: AdapterOpenAIRealtime,
SupportedLanguages: allLangs,
Endpoint: &EndpointConfig{BaseURL: "https://api.openai.com", Path: "/v1/audio/transcriptions"},
DocsURL: docsURL,
},
{
ID: "gpt-4o-realtime-preview",
Name: "GPT-4o Realtime",
Description: "Real-time streaming transcription with GPT-4o",
Type: Transcription,
Streaming: true,
Local: false,
AdapterType: "openai-realtime",
SupportedLanguages: allLangs,
Endpoint: &EndpointConfig{BaseURL: "wss://api.openai.com", Path: "/v1/realtime"},
StreamingEndpoint: &EndpointConfig{BaseURL: "wss://api.openai.com", Path: "/v1/realtime"},
DocsURL: docsURL,
},
// LLM models
@@ -86,9 +81,10 @@ func (p *OpenAIProvider) Models() []Model {
Name: "GPT-4o Mini",
Description: "Fast and affordable GPT-4 variant",
Type: LLM,
Streaming: false,
SupportsBatch: true,
SupportsStreaming: false,
Local: false,
AdapterType: "openai",
AdapterType: AdapterOpenAI,
SupportedLanguages: allLangs,
Endpoint: &EndpointConfig{BaseURL: "https://api.openai.com", Path: "/v1/chat/completions"},
},
@@ -97,9 +93,10 @@ func (p *OpenAIProvider) Models() []Model {
Name: "GPT-4o",
Description: "Most capable GPT-4 model",
Type: LLM,
Streaming: false,
SupportsBatch: true,
SupportsStreaming: false,
Local: false,
AdapterType: "openai",
AdapterType: AdapterOpenAI,
SupportedLanguages: allLangs,
Endpoint: &EndpointConfig{BaseURL: "https://api.openai.com", Path: "/v1/chat/completions"},
},