* Updates the OpenAI keys for the index. * @param keys Keys to use.
(keys)
| 297 | * @param keys Keys to use. |
| 298 | */ |
| 299 | setKeys(keys) { |
| 300 | return __awaiter(this, void 0, void 0, function* () { |
| 301 | if (!(yield this.isCreated())) { |
| 302 | throw new Error('Index has not been created yet. Please run `codepilot create` first.'); |
| 303 | } |
| 304 | // Overwrite keys file |
| 305 | yield fs.writeFile(path.join(this.folderPath, 'vectra.keys'), JSON.stringify(keys)); |
| 306 | this._keys = keys; |
| 307 | }); |
| 308 | } |
| 309 | /** |
| 310 | * Updates the code index configuration. |
| 311 | * @param config Settings to update. |