会话名称过长,使用ai进行总结更新,配置文件配置模型
This commit is contained in:
parent
2d1427e0e4
commit
1df0cd60e7
|
|
@ -165,8 +165,8 @@ func SingleTurnConversationText(prompt string, param proto.ModelParam) (string,
|
|||
var answer string
|
||||
var err error
|
||||
apiKey := param.APIKey
|
||||
if apiKey == "" {
|
||||
log.Printf("openai apiKey is empty\n")
|
||||
if apiKey == "" || param.Url == "" {
|
||||
log.Printf("openai apiKey or url is empty\n")
|
||||
return "", nil
|
||||
}
|
||||
openaiClient := openai.NewClient(
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ func UpdateSessionNameByAIAndID(id, userID int, originSessionName string) error
|
|||
log.Println("UpdateSessionNameByAIAndID model param error:", err)
|
||||
return errors.New("session name ai model param error")
|
||||
}
|
||||
modelParam.Url = model.Url
|
||||
newSessionName, err2 := generalModel.SingleTurnConversationText(prompt, modelParam)
|
||||
if err2 != nil {
|
||||
return err
|
||||
|
|
|
|||
Loading…
Reference in New Issue