Enha: showSys to skip sys or tool msgs
This commit is contained in:
4
bot.go
4
bot.go
@@ -454,8 +454,8 @@ func findCall(msg, toolCall string, tv *tview.TextView) {
|
|||||||
func chatToTextSlice(showSys bool) []string {
|
func chatToTextSlice(showSys bool) []string {
|
||||||
resp := make([]string, len(chatBody.Messages))
|
resp := make([]string, len(chatBody.Messages))
|
||||||
for i, msg := range chatBody.Messages {
|
for i, msg := range chatBody.Messages {
|
||||||
// INFO: skips system msg
|
// INFO: skips system msg and tool msg
|
||||||
if !showSys && (msg.Role != cfg.AssistantRole && msg.Role != cfg.UserRole) {
|
if !showSys && (msg.Role == cfg.ToolRole || msg.Role == "system") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
resp[i] = msg.ToText(i)
|
resp[i] = msg.ToText(i)
|
||||||
|
|||||||
2
tui.go
2
tui.go
@@ -558,7 +558,7 @@ func init() {
|
|||||||
if event.Key() == tcell.KeyF5 {
|
if event.Key() == tcell.KeyF5 {
|
||||||
// switch cfg.ShowSys
|
// switch cfg.ShowSys
|
||||||
cfg.ShowSys = !cfg.ShowSys
|
cfg.ShowSys = !cfg.ShowSys
|
||||||
textView.SetText(chatToText(cfg.ShowSys)) // TODO: fix removing all new names
|
textView.SetText(chatToText(cfg.ShowSys))
|
||||||
colorText()
|
colorText()
|
||||||
}
|
}
|
||||||
if event.Key() == tcell.KeyF6 {
|
if event.Key() == tcell.KeyF6 {
|
||||||
|
|||||||
Reference in New Issue
Block a user