From dfe355cd9db63576b600cdff3ca21596bb89255d Mon Sep 17 00:00:00 2001 From: Rafal Gajdulewicz Date: Mon, 18 Mar 2024 17:28:15 +0100 Subject: [PATCH] Annotate span with number of results --- vscode/src/chat/chat-view/context.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vscode/src/chat/chat-view/context.ts b/vscode/src/chat/chat-view/context.ts index f2d97d1a0b07..03841dffb729 100644 --- a/vscode/src/chat/chat-view/context.ts +++ b/vscode/src/chat/chat-view/context.ts @@ -336,7 +336,7 @@ async function searchEmbeddingsLocal( text: string, numResults: number = NUM_CODE_RESULTS + NUM_TEXT_RESULTS ): Promise { - return wrapInActiveSpan('chat.context.embeddings.local', async () => { + return wrapInActiveSpan('chat.context.embeddings.local', async span => { if (!localEmbeddings) { return [] } @@ -344,6 +344,7 @@ async function searchEmbeddingsLocal( logDebug('SimpleChatPanelProvider', 'getEnhancedContext > searching local embeddings') const contextItems: ContextItem[] = [] const embeddingsResults = await localEmbeddings.getContext(text, numResults) + span.setAttribute('numResults', embeddingsResults.length) for (const result of embeddingsResults) { const range = new vscode.Range(