Merge commit 'af543ab8ecb6827cbbc151c2cff181cdc3286274'

This commit is contained in:
Laisky.Cai
2024-04-08 01:13:00 +00:00
49 changed files with 1024 additions and 335 deletions

View File

@@ -7,6 +7,7 @@ import (
"github.com/Laisky/errors/v2"
"github.com/gin-gonic/gin"
"github.com/songquanpeng/one-api/common/config"
"github.com/songquanpeng/one-api/common/helper"
channelhelper "github.com/songquanpeng/one-api/relay/adaptor"
"github.com/songquanpeng/one-api/relay/adaptor/openai"
@@ -22,7 +23,7 @@ func (a *Adaptor) Init(meta *meta.Meta) {
}
func (a *Adaptor) GetRequestURL(meta *meta.Meta) (string, error) {
version := helper.AssignOrDefault(meta.APIVersion, "v1")
version := helper.AssignOrDefault(meta.APIVersion, config.GeminiVersion)
action := "generateContent"
if meta.IsStream {
action = "streamGenerateContent"