MCPcopy Create free account
hub / github.com/Thunder-Compute/thunder-cli / runCreateModel

Function runCreateModel

tui/create.go:1148–1169  ·  view source on GitHub ↗
(m createModel)

Source from the content-addressed store, hash-verified

1146}
1147
1148func runCreateModel(m createModel) (*CreateConfig, error) {
1149 p := tea.NewProgram(m)
1150 finalModel, err := p.Run()
1151 if err != nil {
1152 return nil, fmt.Errorf("error running TUI: %w", err)
1153 }
1154
1155 result, ok := finalModel.(createModel)
1156 if !ok {
1157 return nil, fmt.Errorf("unexpected model type")
1158 }
1159
1160 if result.err != nil {
1161 return nil, result.err
1162 }
1163
1164 if result.quitting || !result.config.Confirmed {
1165 return nil, ErrCancelled
1166 }
1167
1168 return &result.config, nil
1169}
1170
1171func RunCreateInteractive(client *api.Client, specs *utils.SpecStore) (*CreateConfig, error) {
1172 InitCommonStyles(os.Stdout)

Callers 2

RunCreateInteractiveFunction · 0.85
RunCreateHybridFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected