fix: baseURL not working in APITypePaLM
This commit is contained in:
parent
bc2f48b1f2
commit
e7c9003ccf
@ -142,6 +142,9 @@ func relayTextHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode {
|
|||||||
fullRequestURL = "https://generativelanguage.googleapis.com/v1beta2/models/chat-bison-001:generateMessage"
|
fullRequestURL = "https://generativelanguage.googleapis.com/v1beta2/models/chat-bison-001:generateMessage"
|
||||||
apiKey := c.Request.Header.Get("Authorization")
|
apiKey := c.Request.Header.Get("Authorization")
|
||||||
apiKey = strings.TrimPrefix(apiKey, "Bearer ")
|
apiKey = strings.TrimPrefix(apiKey, "Bearer ")
|
||||||
|
if baseURL != "" {
|
||||||
|
fullRequestURL = strings.Replace(fullRequestURL, "https://generativelanguage.googleapis.com", baseURL, 1)
|
||||||
|
}
|
||||||
fullRequestURL += "?key=" + apiKey
|
fullRequestURL += "?key=" + apiKey
|
||||||
case APITypeZhipu:
|
case APITypeZhipu:
|
||||||
method := "invoke"
|
method := "invoke"
|
||||||
|
Loading…
Reference in New Issue
Block a user