-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add experimental reranker service #1401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds an experimental remote reranker service and integrates it into workspace chunk search when enabled.
- Introduces IRerankerService and its implementation with a remote endpoint driven by experimentation.
- Adds enableRerank option to search options and conditional remote rerank logic before existing local rerank flow.
- Registers the new service in the VS Code extension service container.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/platform/workspaceChunkSearch/node/workspaceChunkSearchService.ts | Injects reranker service and adds conditional remote rerank branch in search flow. |
src/platform/workspaceChunkSearch/common/workspaceChunkSearch.ts | Adds enableRerank flag to search options. |
src/platform/workspaceChunkSearch/common/rerankerService.ts | Implements remote reranking with endpoint lookup via experimentation service. |
src/extension/extension/vscode-node/services.ts | Registers the reranker service in the instantiation builder. |
src/platform/workspaceChunkSearch/node/workspaceChunkSearchService.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
} | ||
|
||
async rerank(query: string, documents: readonly FileChunkAndScore[], token: CancellationToken): Promise<readonly FileChunkAndScore[]> { | ||
if (!documents.length || !this.isAvailable || !this._endpoint) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we warn if you call this service and it's not available?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we throw?
}; | ||
|
||
// If explicit rerank is enabled, use the remote reranker | ||
if (options.enableRerank && this._rerankerService.isAvailable) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checking if we really want to do this in the full workspace case too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what @rebornix does in this case today. I think if you explicitly pass "enable rerank" maybe. Or maybe you shouldn't even get the "full workspace" case but be treated as if you want ranked semantic chunks.
Adds an experimental reranking endpoint to be fulfilled via ExP