diff options
| author | Grail Finder <wohilas@gmail.com> | 2026-03-02 11:39:55 +0300 |
|---|---|---|
| committer | Grail Finder <wohilas@gmail.com> | 2026-03-02 11:39:55 +0300 |
| commit | 3389b1d83bc9fcc605fdff813c826410d07cfe28 (patch) | |
| tree | a9a3dc852f5fdc2f1b3050e8f70bfc687e6a781b /bot.go | |
| parent | 4f6000a43ad2ee019a799c5b5154af9f853e2b83 (diff) | |
Diffstat (limited to 'bot.go')
| -rw-r--r-- | bot.go | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1213,19 +1213,19 @@ func findCall(msg, toolCall string) bool { // Create RoleMsg with ContentParts var contentParts []any for _, part := range multimodalResp.Parts { - partType, ok := part["type"] - if !ok { - continue - } - if partType == "text" { + partType := part["type"] + switch partType { + case "text": contentParts = append(contentParts, models.TextContentPart{Type: "text", Text: part["text"]}) - } else if partType == "image_url" { + case "image_url": contentParts = append(contentParts, models.ImageContentPart{ Type: "image_url", ImageURL: struct { URL string `json:"url"` }{URL: part["url"]}, }) + default: + continue } } toolResponseMsg = models.RoleMsg{ |
