()
| 199 | } |
| 200 | |
| 201 | func (m launchWizardModel) View() string { |
| 202 | if m.manualEntry { |
| 203 | var header string |
| 204 | if m.modelErr != nil { |
| 205 | header = fmt.Sprintf("Model discovery failed: %s\n\n", m.modelErr) |
| 206 | } else { |
| 207 | header = "No models advertised by this endpoint.\n\n" |
| 208 | } |
| 209 | return fmt.Sprintf( |
| 210 | "%sType a model name and press Enter (Esc to pick a different endpoint).\n\nModel: %s_\n", |
| 211 | header, m.manualValue, |
| 212 | ) |
| 213 | } |
| 214 | step := m.activeStep() |
| 215 | if step == nil { |
| 216 | return "" |
| 217 | } |
| 218 | return step.view() |
| 219 | } |
| 220 | |
| 221 | // activeStep returns the picker for the current phase, or nil when |
| 222 | // the wizard is done / in manual-entry mode. |
no test coverage detected