diff options
| author | Grail Finder <wohilas@gmail.com> | 2026-02-28 07:57:49 +0300 |
|---|---|---|
| committer | Grail Finder <wohilas@gmail.com> | 2026-02-28 07:57:49 +0300 |
| commit | e52143407367e54f5b04177957f5f0436e28718b (patch) | |
| tree | 9a1abc47cb7f07a924179e66925d3bfc7c1d9ac3 /bot.go | |
| parent | 916c5d3904b366e9f7f6f12867f7f0b71791bb6f (diff) | |
Refactor: move msg totext method to main package
logic requires reference to config
Diffstat (limited to 'bot.go')
| -rw-r--r-- | bot.go | 15 |
1 files changed, 3 insertions, 12 deletions
@@ -1226,7 +1226,7 @@ func chatToTextSlice(messages []models.RoleMsg, showSys bool) []string { if messages[i].Role == cfg.ToolRole || messages[i].Role == "tool" { // Always show shell commands if messages[i].IsShellCommand { - resp[i] = messages[i].ToText(i) + resp[i] = MsgToText(i, &messages[i]) continue } // Hide non-shell tool responses when collapsed @@ -1235,14 +1235,14 @@ func chatToTextSlice(messages []models.RoleMsg, showSys bool) []string { continue } // When expanded, show tool responses - resp[i] = messages[i].ToText(i) + resp[i] = MsgToText(i, &messages[i]) continue } // INFO: skips system msg when showSys is false if !showSys && messages[i].Role == "system" { continue } - resp[i] = messages[i].ToText(i) + resp[i] = MsgToText(i, &messages[i]) } return resp } @@ -1397,15 +1397,6 @@ func init() { os.Exit(1) return } - // Set image base directory for path display - baseDir := cfg.FilePickerDir - if baseDir == "" || baseDir == "." { - // Resolve "." to current working directory - if wd, err := os.Getwd(); err == nil { - baseDir = wd - } - } - models.SetImageBaseDir(baseDir) defaultStarter = []models.RoleMsg{ {Role: "system", Content: basicSysMsg}, {Role: cfg.AssistantRole, Content: defaultFirstMsg}, |
