upgrade to voyage rerank-2 by default

This commit is contained in:
Nate 2024-10-07 17:28:11 -07:00
parent bbd29eab80
commit cf8dbe2e40
8 changed files with 27 additions and 10 deletions

2
.vscode/launch.json vendored
View file

@ -12,7 +12,7 @@
"cwd": "${workspaceFolder}/extensions/vscode",
"args": [
// Pass a directory to manually test in
"${workspaceFolder}/manual-testing-sandbox",
"${workspaceFolder}/gui",
"${workspaceFolder}/manual-testing-sandbox/test.js",
"--extensionDevelopmentPath=${workspaceFolder}/extensions/vscode"
],

View file

@ -24,7 +24,7 @@ export class VoyageReranker implements Reranker {
body: JSON.stringify({
query,
documents: chunks.map((chunk) => chunk.content),
model: this.params.model ?? "rerank-lite-1",
model: this.params.model ?? "rerank-2",
}),
});
const data: any = await resp.json();

View file

@ -11,18 +11,18 @@ In Continue, reranking is used by [@Codebase](../deep-dives/codebase.md) in orde
## Recommended reranking models
If you have the ability to use any model, we recommend `rerank-1` by Voyage AI, which is listed below along with the rest of the options for rerankers.
If you have the ability to use any model, we recommend `rerank-2` by Voyage AI, which is listed below along with the rest of the options for rerankers.
### Voyage AI
Voyage AI offers the best reranking model for code with their `rerank-1` model. After obtaining an API key from [here](https://www.voyageai.com/), you can configure like this:
Voyage AI offers the best reranking model for code with their `rerank-2` model. After obtaining an API key from [here](https://www.voyageai.com/), you can configure like this:
```json title="config.json"
{
"reranker": {
"name": "voyage",
"params": {
"model": "rerank-1",
"model": "rerank-2",
"apiKey": "<VOYAGE_API_KEY>"
}
}

View file

@ -146,4 +146,4 @@ If you wish to return 10 total results for each query for example, then you woul
2. Send all of these 50 results to the reranker API along with the query in order to get relevancy scores for each
3. Sort the results by relevancy score and return the top 10
We recommend using the `rerank-1` model from Voyage AI, which has examples of usage [here](https://docs.voyageai.com/docs/reranker).
We recommend using the `rerank-2` model from Voyage AI, which has examples of usage [here](https://docs.voyageai.com/docs/reranker).

View file

@ -2299,7 +2299,12 @@
"type": "string"
},
"model": {
"enum": ["rerank-lite-1", "rerank-1"]
"enum": [
"rerank-lite-1",
"rerank-1",
"rerank-2",
"rerank-2-lite"
]
}
},
"required": ["apiKey"]

View file

@ -2299,7 +2299,12 @@
"type": "string"
},
"model": {
"enum": ["rerank-lite-1", "rerank-1"]
"enum": [
"rerank-lite-1",
"rerank-1",
"rerank-2",
"rerank-2-lite"
]
}
},
"required": ["apiKey"]

View file

@ -2299,7 +2299,12 @@
"type": "string"
},
"model": {
"enum": ["rerank-lite-1", "rerank-1"]
"enum": [
"rerank-lite-1",
"rerank-1",
"rerank-2",
"rerank-2-lite"
]
}
},
"required": ["apiKey"]

View file

@ -2576,7 +2576,9 @@
"model": {
"enum": [
"rerank-lite-1",
"rerank-1"
"rerank-1",
"rerank-2",
"rerank-2-lite"
]
}
},