Feat: add default style
This commit is contained in:
3
tools.go
3
tools.go
@@ -9,8 +9,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// TODO: form that message based on existing funcs
|
|
||||||
toolCallRE = regexp.MustCompile(`__tool_call__\s*([\s\S]*?)__tool_call__`)
|
toolCallRE = regexp.MustCompile(`__tool_call__\s*([\s\S]*?)__tool_call__`)
|
||||||
|
// quotesRE = regexp.MustCompile(`(".*")`)
|
||||||
|
// starRE = regexp.MustCompile(`(\*.*\*)`)
|
||||||
basicSysMsg = `Large Language Model that helps user with any of his requests.`
|
basicSysMsg = `Large Language Model that helps user with any of his requests.`
|
||||||
toolSysMsg = `You're a helpful assistant.
|
toolSysMsg = `You're a helpful assistant.
|
||||||
# Tools
|
# Tools
|
||||||
|
|||||||
19
tui.go
19
tui.go
@@ -41,6 +41,20 @@ Press Enter to go back
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
theme := tview.Theme{
|
||||||
|
PrimitiveBackgroundColor: tcell.ColorDefault,
|
||||||
|
ContrastBackgroundColor: tcell.ColorGray,
|
||||||
|
MoreContrastBackgroundColor: tcell.ColorNavy,
|
||||||
|
BorderColor: tcell.ColorGray,
|
||||||
|
TitleColor: tcell.ColorRed,
|
||||||
|
GraphicsColor: tcell.ColorBlue,
|
||||||
|
PrimaryTextColor: tcell.ColorOlive,
|
||||||
|
SecondaryTextColor: tcell.ColorYellow,
|
||||||
|
TertiaryTextColor: tcell.ColorOrange,
|
||||||
|
InverseTextColor: tcell.ColorPurple,
|
||||||
|
ContrastSecondaryTextColor: tcell.ColorLime,
|
||||||
|
}
|
||||||
|
tview.Styles = theme
|
||||||
app = tview.NewApplication()
|
app = tview.NewApplication()
|
||||||
pages = tview.NewPages()
|
pages = tview.NewPages()
|
||||||
textArea = tview.NewTextArea().
|
textArea = tview.NewTextArea().
|
||||||
@@ -64,6 +78,10 @@ func init() {
|
|||||||
AddItem(position, 0, 1, false)
|
AddItem(position, 0, 1, false)
|
||||||
updateStatusLine := func() {
|
updateStatusLine := func() {
|
||||||
position.SetText(fmt.Sprintf(indexLine, botRespMode, activeChatName))
|
position.SetText(fmt.Sprintf(indexLine, botRespMode, activeChatName))
|
||||||
|
// INFO: way too ineffective; it should be optional or removed
|
||||||
|
// tv := textView.GetText(false)
|
||||||
|
// cq := quotesRE.ReplaceAllString(tv, `[orange]$1[white]`)
|
||||||
|
// textView.SetText(starRE.ReplaceAllString(cq, `[yellow]$1[white]`))
|
||||||
}
|
}
|
||||||
chatOpts := []string{"cancel", "new", "rename current"}
|
chatOpts := []string{"cancel", "new", "rename current"}
|
||||||
chatList, err := loadHistoryChats()
|
chatList, err := loadHistoryChats()
|
||||||
@@ -142,6 +160,7 @@ func init() {
|
|||||||
textView.SetText(chatToText(cfg.ShowSys))
|
textView.SetText(chatToText(cfg.ShowSys))
|
||||||
sysModal.ClearButtons()
|
sysModal.ClearButtons()
|
||||||
pages.RemovePage("sys")
|
pages.RemovePage("sys")
|
||||||
|
app.SetFocus(textArea)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
editArea = tview.NewTextArea().
|
editArea = tview.NewTextArea().
|
||||||
|
|||||||
Reference in New Issue
Block a user