mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-14 20:23:46 +08:00
🎨 添加工厂方法
This commit is contained in:
@@ -7,12 +7,10 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type AzureProvider struct {
|
||||
openai.OpenAIProvider
|
||||
}
|
||||
type AzureProviderFactory struct{}
|
||||
|
||||
// 创建 OpenAIProvider
|
||||
func CreateAzureProvider(c *gin.Context) *AzureProvider {
|
||||
// 创建 AzureProvider
|
||||
func (f AzureProviderFactory) Create(c *gin.Context) base.ProviderInterface {
|
||||
return &AzureProvider{
|
||||
OpenAIProvider: openai.OpenAIProvider{
|
||||
BaseProvider: base.BaseProvider{
|
||||
@@ -32,3 +30,7 @@ func CreateAzureProvider(c *gin.Context) *AzureProvider {
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
type AzureProvider struct {
|
||||
openai.OpenAIProvider
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user