MCPcopy Index your code
hub / github.com/Stevenic/codepilot / query

Method query

lib/CodeIndex.js:212–224  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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.

Callers 1

renderAsMessagesMethod · 0.45

Calls 3

isCreatedMethod · 0.95
hasKeysMethod · 0.95
loadMethod · 0.95

Tested by

no test coverage detected