mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-17 21:53:42 +08:00
♻️ refactor: provider refactor (#41)
* ♻️ refactor: provider refactor
* 完善百度/讯飞的函数调用,现在可以在`lobe-chat`中正常调用函数了
This commit is contained in:
@@ -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),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user