mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-17 17:16:38 +08:00
fix: update request URL formatting in Adaptor for proper query string handling
This commit is contained in:
parent
33493aa8b3
commit
61d5f0eccf
@ -33,19 +33,16 @@ func (a *Adaptor) GetRequestURL(meta *meta.Meta) (string, error) {
|
||||
action := ""
|
||||
switch meta.Mode {
|
||||
case relaymode.Embeddings:
|
||||
action = "batchEmbedContents"
|
||||
action = "batchEmbedContents?"
|
||||
default:
|
||||
action = "generateContent"
|
||||
action = "generateContent?"
|
||||
}
|
||||
|
||||
if meta.IsStream {
|
||||
if version == "v1" {
|
||||
action = "streamGenerateContent?alt=sse"
|
||||
} else {
|
||||
action = "streamGenerateContent"
|
||||
}
|
||||
action = "streamGenerateContent?alt=sse&"
|
||||
}
|
||||
return fmt.Sprintf("%s/%s/models/%s:%s?key=%s", meta.BaseURL, version, meta.ActualModelName, action, meta.APIKey), nil
|
||||
|
||||
return fmt.Sprintf("%s/%s/models/%s:%skey=%s", meta.BaseURL, version, meta.ActualModelName, action, meta.APIKey), nil
|
||||
}
|
||||
|
||||
func (a *Adaptor) SetupRequestHeader(c *gin.Context, req *http.Request, meta *meta.Meta) error {
|
||||
|
Loading…
Reference in New Issue
Block a user