tui: Add setting view with support for changing the current model
This commit is contained in:
@@ -12,6 +12,17 @@ import (
|
||||
)
|
||||
|
||||
func (m *Model) handleInput(msg tea.KeyMsg) tea.Cmd {
|
||||
switch msg.String() {
|
||||
case "ctrl+g":
|
||||
if m.state == pendingResponse {
|
||||
m.stopSignal <- struct{}{}
|
||||
return shared.KeyHandled(msg)
|
||||
}
|
||||
return func() tea.Msg {
|
||||
return shared.MsgViewChange(shared.ViewSettings)
|
||||
}
|
||||
}
|
||||
|
||||
switch m.focus {
|
||||
case focusInput:
|
||||
cmd := m.handleInputKey(msg)
|
||||
|
||||
@@ -288,7 +288,12 @@ func (m *Model) Footer(width int) string {
|
||||
rightSegments = append(rightSegments, segmentStyle.Render(throughput))
|
||||
}
|
||||
|
||||
model := fmt.Sprintf("Model: %s", *m.App.Ctx.Config.Defaults.Model)
|
||||
if m.App.ProviderName != "" {
|
||||
provider := fmt.Sprintf("Provider: %s", m.App.ProviderName)
|
||||
rightSegments = append(rightSegments, segmentStyle.Render(provider))
|
||||
}
|
||||
|
||||
model := fmt.Sprintf("Model: %s", m.App.Model)
|
||||
rightSegments = append(rightSegments, segmentStyle.Render(model))
|
||||
|
||||
left := strings.Join(leftSegments, segmentSeparator)
|
||||
|
||||
Reference in New Issue
Block a user