1
0
mirror of https://github.com/fumiama/go-onebot-agent.git synced 2026-06-08 20:10:31 +08:00

fix: image cannot clear

This commit is contained in:
源文雨
2025-12-22 00:37:50 +08:00
parent 39bf5588f4
commit c11c679e46
3 changed files with 6 additions and 4 deletions

View File

@@ -145,10 +145,11 @@ func (ag *Agent) SetViewImageAPI(api deepinfra.API, p model.Protocol) {
}
return nil
})
logrus.Debugln("[goba] SetViewImageAPI calculated min d:", d)
if d < 8 { // very similar (>87.5%)
msgs[i].Data["__agent_desc__"] = desc
hasset = true
logrus.Debugln("[goba] SetViewImageAPI hit cache with d:", d)
logrus.Debugln("[goba] SetViewImageAPI hit cache.")
continue
}
@@ -163,6 +164,7 @@ func (ag *Agent) SetViewImageAPI(api deepinfra.API, p model.Protocol) {
logrus.Debugln("[goba] SetViewImageAPI conv b64 err:", err)
continue
}
p = p.Clone() // clear protocol content
m := p.User(
model.NewContentImageURL(imgs),
model.NewContentText("使用简洁清晰明确的一段中文纯文本描述图片"),