* Queries the code index. * @param query Text to query the index with. * @param options Optional. Options to use when querying the index. * @returns Found documents.
(query, options)
| 210 | * @returns Found documents. |
| 211 | */ |
| 212 | query(query, options) { |
| 213 | return __awaiter(this, void 0, void 0, function* () { |
| 214 | if (!(yield this.isCreated())) { |
| 215 | throw new Error('Index has not been created yet. Please run `codepilot create` first.'); |
| 216 | } |
| 217 | if (!(yield this.hasKeys())) { |
| 218 | throw new Error("A local vectra.keys file couldn't be found. Please run `codepilot set --key <your OpenAI key>`."); |
| 219 | } |
| 220 | // Query document index |
| 221 | const index = yield this.load(); |
| 222 | return yield index.queryDocuments(query, options); |
| 223 | }); |
| 224 | } |
| 225 | // LLM-REGION |
| 226 | /** |
| 227 | * Rebuilds the code index. |
no test coverage detected