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 | |
| parent | 4f6000a43ad2ee019a799c5b5154af9f853e2b83 (diff) | |
| -rw-r--r-- | bot.go | 12 | ||||
| -rw-r--r-- | tools.go | 4 | ||||
| -rw-r--r-- | tui.go | 3 |
3 files changed, 9 insertions, 10 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{ @@ -250,8 +250,8 @@ func UpdateToolCapabilities() { logger.Info("model has vision support", "model", cfg.CurrentModel, "api", cfg.CurrentAPI) } else { logger.Info("model does not have vision support", "model", cfg.CurrentModel, "api", cfg.CurrentAPI) - if windowToolsAvailable && !prevHasVision && modelHasVision == false { - notifyUser("window tools", "Window capture-and-view unavailable: model lacks vision support") + if windowToolsAvailable && !prevHasVision && !modelHasVision { + _ = notifyUser("window tools", "Window capture-and-view unavailable: model lacks vision support") } } registerWindowTools() @@ -213,8 +213,7 @@ func init() { pages.SwitchToPage("main") // or whatever your main page is named }) confirmModal.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { - switch event.Key() { - case tcell.KeyRune: + if event.Key() == tcell.KeyRune { switch event.Rune() { case 'y', 'Y': persona := cfg.UserRole |
