ai-gateway/providers/aiproxy/base.go

21 lines
394 B
Go
Raw Permalink Normal View History

2023-12-02 09:51:28 +00:00
package aiproxy
import (
2023-12-02 10:14:48 +00:00
"one-api/providers/base"
2023-12-02 09:51:28 +00:00
"one-api/providers/openai"
"github.com/gin-gonic/gin"
)
2023-12-02 10:14:48 +00:00
type AIProxyProviderFactory struct{}
2023-12-02 09:51:28 +00:00
2023-12-02 10:14:48 +00:00
func (f AIProxyProviderFactory) Create(c *gin.Context) base.ProviderInterface {
2023-12-02 09:51:28 +00:00
return &AIProxyProvider{
OpenAIProvider: openai.CreateOpenAIProvider(c, "https://api.aiproxy.io"),
}
}
2023-12-02 10:14:48 +00:00
type AIProxyProvider struct {
*openai.OpenAIProvider
}