MCPcopy Create free account
hub / github.com/compozy/agh / updateModelStep

Method updateModelStep

internal/cli/install.go:448–467  ·  view source on GitHub ↗
(msg tea.KeyMsg)

Source from the content-addressed store, hash-verified

446}
447
448func (m *installWizardModel) updateModelStep(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
449 switch msg.String() {
450 case "esc":
451 m.errText = ""
452 m.step = installWizardStepProvider
453 return m, nil
454 case installWizardEnterKey:
455 if strings.TrimSpace(m.modelInput.Value()) == "" && m.modelRequired() {
456 m.errText = "model is required"
457 return m, nil
458 }
459 m.errText = ""
460 m.step = installWizardStepConfirm
461 return m, nil
462 }
463
464 var cmd tea.Cmd
465 m.modelInput, cmd = m.modelInput.Update(msg)
466 return m, cmd
467}
468
469func (m *installWizardModel) modelRequired() bool {
470 return m.input.ModelRequired[strings.TrimSpace(m.provider)]

Callers 1

UpdateMethod · 0.95

Calls 3

modelRequiredMethod · 0.95
UpdateMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected