♻️ refactor: provider refactor (#41)

* ♻️ refactor: provider refactor
* 完善百度/讯飞的函数调用,现在可以在`lobe-chat`中正常调用函数了
This commit is contained in:
Buer
2024-01-19 02:47:10 +08:00
committed by GitHub
parent 0bfe1f5779
commit ef041e28a1
96 changed files with 4339 additions and 3276 deletions

View File

@@ -1,21 +1,23 @@
package azureSpeech
import (
"one-api/common/requester"
"one-api/model"
"one-api/providers/base"
"github.com/gin-gonic/gin"
)
// 定义供应商工厂
type AzureSpeechProviderFactory struct{}
// 创建 AliProvider
func (f AzureSpeechProviderFactory) Create(c *gin.Context) base.ProviderInterface {
func (f AzureSpeechProviderFactory) Create(channel *model.Channel) base.ProviderInterface {
return &AzureSpeechProvider{
BaseProvider: base.BaseProvider{
BaseURL: "",
AudioSpeech: "/cognitiveservices/v1",
Context: c,
Config: base.ProviderConfig{
AudioSpeech: "/cognitiveservices/v1",
},
Channel: channel,
Requester: requester.NewHTTPRequester(channel.Proxy, nil),
},
}
}