From f35375ee1a6c84cc7b8184241e9c63e474e07978 Mon Sep 17 00:00:00 2001 From: Evan Simkowitz Date: Thu, 16 Jan 2025 18:02:18 -0800 Subject: [PATCH] Fix openai regression (#1758) this impacts custom openai providers, not wave proxy --- pkg/waveai/openaibackend.go | 2 +- pkg/waveai/waveai.go | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/waveai/openaibackend.go b/pkg/waveai/openaibackend.go index f2a007a10..36135884a 100644 --- a/pkg/waveai/openaibackend.go +++ b/pkg/waveai/openaibackend.go @@ -29,7 +29,7 @@ func defaultAzureMapperFn(model string) string { func setApiType(opts *wshrpc.WaveAIOptsType, clientConfig *openaiapi.ClientConfig) error { ourApiType := strings.ToLower(opts.APIType) - if ourApiType == "" || ourApiType == strings.ToLower(string(openaiapi.APITypeOpenAI)) { + if ourApiType == "" || ourApiType == APIType_OpenAI || ourApiType == strings.ToLower(string(openaiapi.APITypeOpenAI)) { clientConfig.APIType = openaiapi.APITypeOpenAI return nil } else if ourApiType == strings.ToLower(string(openaiapi.APITypeAzure)) { diff --git a/pkg/waveai/waveai.go b/pkg/waveai/waveai.go index 68ee09028..b9198f595 100644 --- a/pkg/waveai/waveai.go +++ b/pkg/waveai/waveai.go @@ -75,7 +75,6 @@ func RunAICommand(ctx context.Context, request wshrpc.WaveAIStreamRequest) chan request.Opts.Model = "default" backend = WaveAICloudBackend{} } else { - request.Opts.APIType = APIType_OpenAI backend = OpenAIBackend{} } if backend == nil {