mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-13 20:03:44 +08:00
支持LoraID , 通过OpenAI Client设置 ExtraHeader 并在讯飞实现中支持
This commit is contained in:
@@ -31,6 +31,9 @@ type Meta struct {
|
||||
RequestURLPath string
|
||||
PromptTokens int // only for DoResponse
|
||||
SystemPrompt string
|
||||
|
||||
//Lora_id
|
||||
LoraId string
|
||||
}
|
||||
|
||||
func GetByContext(c *gin.Context) *Meta {
|
||||
@@ -48,6 +51,7 @@ func GetByContext(c *gin.Context) *Meta {
|
||||
APIKey: strings.TrimPrefix(c.Request.Header.Get("Authorization"), "Bearer "),
|
||||
RequestURLPath: c.Request.URL.String(),
|
||||
SystemPrompt: c.GetString(ctxkey.SystemPrompt),
|
||||
LoraId: c.Request.Header.Get(ctxkey.LoraId),
|
||||
}
|
||||
cfg, ok := c.Get(ctxkey.Config)
|
||||
if ok {
|
||||
|
||||
Reference in New Issue
Block a user