mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-12 19:33:41 +08:00
feat: add session/prefix cache for doubao
This commit is contained in:
@@ -7,9 +7,13 @@ import (
|
||||
)
|
||||
|
||||
func GetRequestURL(meta *meta.Meta) (string, error) {
|
||||
var context = ""
|
||||
if meta.Cache {
|
||||
context = "context/"
|
||||
}
|
||||
switch meta.Mode {
|
||||
case relaymode.ChatCompletions:
|
||||
return fmt.Sprintf("%s/api/v3/chat/completions", meta.BaseURL), nil
|
||||
return fmt.Sprintf("%s/api/v3/%schat/completions", meta.BaseURL, context), nil
|
||||
case relaymode.Embeddings:
|
||||
return fmt.Sprintf("%s/api/v3/embeddings", meta.BaseURL), nil
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user