From cf8dbe2e40ae896b02e5c2235856fed1c9ecc390 Mon Sep 17 00:00:00 2001 From: Nate Date: Mon, 7 Oct 2024 17:28:11 -0700 Subject: [PATCH] upgrade to voyage rerank-2 by default --- .vscode/launch.json | 2 +- core/context/rerankers/voyage.ts | 2 +- docs/docs/customize/model-types/reranking.md | 6 +++--- docs/docs/customize/tutorials/custom-code-rag.md | 2 +- docs/static/schemas/config.json | 7 ++++++- extensions/intellij/src/main/resources/config_schema.json | 7 ++++++- extensions/vscode/config_schema.json | 7 ++++++- extensions/vscode/continue_rc_schema.json | 4 +++- 8 files changed, 27 insertions(+), 10 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 896793040..f5c81180f 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -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" ], diff --git a/core/context/rerankers/voyage.ts b/core/context/rerankers/voyage.ts index 626c53229..56ba613e2 100644 --- a/core/context/rerankers/voyage.ts +++ b/core/context/rerankers/voyage.ts @@ -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(); diff --git a/docs/docs/customize/model-types/reranking.md b/docs/docs/customize/model-types/reranking.md index 5f3fd77a3..4aceade4a 100644 --- a/docs/docs/customize/model-types/reranking.md +++ b/docs/docs/customize/model-types/reranking.md @@ -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": "" } } diff --git a/docs/docs/customize/tutorials/custom-code-rag.md b/docs/docs/customize/tutorials/custom-code-rag.md index 208180a58..acd778b91 100644 --- a/docs/docs/customize/tutorials/custom-code-rag.md +++ b/docs/docs/customize/tutorials/custom-code-rag.md @@ -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). diff --git a/docs/static/schemas/config.json b/docs/static/schemas/config.json index f63ccf7ac..77de3cf8a 100644 --- a/docs/static/schemas/config.json +++ b/docs/static/schemas/config.json @@ -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"] diff --git a/extensions/intellij/src/main/resources/config_schema.json b/extensions/intellij/src/main/resources/config_schema.json index f63ccf7ac..77de3cf8a 100644 --- a/extensions/intellij/src/main/resources/config_schema.json +++ b/extensions/intellij/src/main/resources/config_schema.json @@ -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"] diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index f63ccf7ac..77de3cf8a 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -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"] diff --git a/extensions/vscode/continue_rc_schema.json b/extensions/vscode/continue_rc_schema.json index c068d0ee6..21f27ca4a 100644 --- a/extensions/vscode/continue_rc_schema.json +++ b/extensions/vscode/continue_rc_schema.json @@ -2576,7 +2576,9 @@ "model": { "enum": [ "rerank-lite-1", - "rerank-1" + "rerank-1", + "rerank-2", + "rerank-2-lite" ] } },