fix(singleagent): multi input without text input error (#353)

This commit is contained in:
junwen-lee 2025-07-30 21:40:44 +08:00 committed by GitHub
parent 74f222c2e1
commit 7ff025eef5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 4 deletions

View File

@ -309,10 +309,12 @@ func (dao *MessageDAO) buildModelContent(msgDO *entity.Message) (string, error)
multiContent = append(multiContent, one) multiContent = append(multiContent, one)
} }
if len(multiContent) > 0 { if len(multiContent) > 0 {
if len(msgDO.Content) > 0 {
multiContent = append(multiContent, schema.ChatMessagePart{ multiContent = append(multiContent, schema.ChatMessagePart{
Type: schema.ChatMessagePartTypeText, Type: schema.ChatMessagePartTypeText,
Text: msgDO.Content, Text: msgDO.Content,
}) })
}
} else { } else {
modelContentObj.Content = msgDO.Content modelContentObj.Content = msgDO.Content
} }