Open github-actions[bot] opened 2 years ago
FIXME: create default config methods for these
https://github.com/redhat-et/copilot-ops/blob/63d4c21def30e1cabd1c0e3769000d38b0911fae/pkg/cmd/utils.go#L79
if err := conf.Load(); err != nil { return nil, err } // TODO: generalize overriding default values via CLI conf.SetDefaults() // override OpenAI URL if openAIURL != "" { conf.OpenAI.BaseURL = openAIURL } // load files fm := filemap.NewFilemap() if err := fm.LoadFiles(files); err != nil { log.Fatalf("error loading files: %s\n", err.Error()) } if len(filesets) > 0 { log.Printf("loading filesets: %v\n", filesets) } if err := fm.LoadFilesets(filesets, conf, config.ConfigFile); err != nil { log.Fatalf("error loading filesets: %s\n", err.Error()) } filemapText := fm.EncodeToInputText() // select backend type selectedBackend := ai.Backend(aiBackend) if selectedBackend == "" { selectedBackend = conf.Backend } // configure backends // FIXME: create default config methods for these r := Request{ Config: conf, Filemap: fm, FilemapText: filemapText, UserRequest: request, IsWrite: write, OutputType: outputType, NTokens: nTokens, NCompletions: nCompletions, Backend: selectedBackend, } return &r, nil
FIXME: create default config methods for these
https://github.com/redhat-et/copilot-ops/blob/63d4c21def30e1cabd1c0e3769000d38b0911fae/pkg/cmd/utils.go#L79