🐛 fix: custom channel error

This commit is contained in:
MartialBE 2024-01-06 16:22:49 +08:00 committed by Buer
parent 47c9630169
commit b3f1b5953c
3 changed files with 5 additions and 3 deletions

View File

@ -26,7 +26,8 @@ func (f AzureProviderFactory) Create(c *gin.Context) base.ProviderInterface {
Context: c, Context: c,
// AudioSpeech: "/audio/speech", // AudioSpeech: "/audio/speech",
}, },
IsAzure: true, IsAzure: true,
BalanceAction: false,
}, },
} }
} }

View File

@ -54,7 +54,7 @@ func CreateOpenAIProvider(c *gin.Context, baseURL string) *OpenAIProvider {
Context: c, Context: c,
}, },
IsAzure: false, IsAzure: false,
BalanceAction: false, BalanceAction: true,
} }
} }

View File

@ -72,8 +72,9 @@ func GetProvider(channel *model.Channel, c *gin.Context) base.ProviderInterface
} }
provider = openai.CreateOpenAIProvider(c, baseURL) provider = openai.CreateOpenAIProvider(c, baseURL)
} else {
provider = factory.Create(c)
} }
provider = factory.Create(c)
provider.SetChannel(channel) provider.SetChannel(channel)
return provider return provider