diff --git a/core/commands/slash/stackOverflow.ts b/core/commands/slash/stackOverflow.ts index 92a34a988..3e967990d 100644 --- a/core/commands/slash/stackOverflow.ts +++ b/core/commands/slash/stackOverflow.ts @@ -1,4 +1,4 @@ -import { constants } from "../../deploy/constants.js"; +import { TRIAL_PROXY_URL } from "../../control-plane/client.js"; import { ChatMessageRole, FetchFunction, SlashCommand } from "../../index.js"; import { pruneStringFromBottom } from "../../llm/countTokens.js"; import { stripImages } from "../../llm/images.js"; @@ -15,7 +15,7 @@ async function getResults(q: string, fetch: FetchFunction): Promise { q: `${q} site:stackoverflow.com`, }); - const resp = await fetch(new URL("/search", constants.a), { + const resp = await fetch(new URL("/search", TRIAL_PROXY_URL), { method: "POST", headers: { "Content-Type": "application/json", diff --git a/core/context/providers/WebContextProvider.ts b/core/context/providers/WebContextProvider.ts index b874e695e..2c8cb8928 100644 --- a/core/context/providers/WebContextProvider.ts +++ b/core/context/providers/WebContextProvider.ts @@ -5,10 +5,10 @@ import { ContextProviderExtras, } from "../.."; import { getHeaders } from "../../continueServer/stubs/headers"; -import { constants } from "../../deploy/constants"; +import { TRIAL_PROXY_URL } from "../../control-plane/client"; export default class WebContextProvider extends BaseContextProvider { - private static ENDPOINT = new URL("web", constants.a); + private static ENDPOINT = new URL("web", TRIAL_PROXY_URL); private static DEFAULT_N = 6; static description: ContextProviderDescription = { diff --git a/core/context/rerankers/freeTrial.ts b/core/context/rerankers/freeTrial.ts index 5739a558f..43dbf6fb6 100644 --- a/core/context/rerankers/freeTrial.ts +++ b/core/context/rerankers/freeTrial.ts @@ -1,6 +1,6 @@ import fetch from "node-fetch"; import { getHeaders } from "../../continueServer/stubs/headers.js"; -import { constants } from "../../deploy/constants.js"; +import { TRIAL_PROXY_URL } from "../../control-plane/client.js"; import { Chunk, Reranker } from "../../index.js"; export class FreeTrialReranker implements Reranker { @@ -10,7 +10,7 @@ export class FreeTrialReranker implements Reranker { if (chunks.length === 0) { return []; } - const resp = await fetch(new URL("rerank", constants.a), { + const resp = await fetch(new URL("rerank", TRIAL_PROXY_URL), { method: "POST", headers: { "Content-Type": "application/json", diff --git a/core/control-plane/client.ts b/core/control-plane/client.ts index acfe82cc9..16df8f90c 100644 --- a/core/control-plane/client.ts +++ b/core/control-plane/client.ts @@ -18,6 +18,9 @@ export interface ControlPlaneWorkspace { export interface ControlPlaneModelDescription extends ModelDescription {} +export const TRIAL_PROXY_URL = + "https://proxy-server-blue-l6vsfbzhba-uw.a.run.app"; + export const DEFAULT_CONTROL_PLANE_PROXY_URL = process.env.CONTROL_PLANE_ENV === "local" ? "http://localhost:3001/" diff --git a/core/deploy/constants.ts b/core/deploy/constants.ts index 909e11f34..9cfc053ef 100644 --- a/core/deploy/constants.ts +++ b/core/deploy/constants.ts @@ -1,6 +1,4 @@ export const constants = { - a: "https://proxy-server-blue-l6vsfbzhba-uw.a.run.app", - // a: "http://localhost:3000", b: "1710787199603", c: "NfZFVegMpdyT3P5UmAggr7T7Hb6PlcbB", }; diff --git a/core/indexing/embeddings/FreeTrialEmbeddingsProvider.ts b/core/indexing/embeddings/FreeTrialEmbeddingsProvider.ts index a539a38cc..e0a29f850 100644 --- a/core/indexing/embeddings/FreeTrialEmbeddingsProvider.ts +++ b/core/indexing/embeddings/FreeTrialEmbeddingsProvider.ts @@ -1,6 +1,6 @@ import { Response } from "node-fetch"; import { getHeaders } from "../../continueServer/stubs/headers.js"; -import { constants } from "../../deploy/constants.js"; +import { TRIAL_PROXY_URL } from "../../control-plane/client.js"; import { EmbeddingsProviderName, EmbedOptions, @@ -33,7 +33,7 @@ class FreeTrialEmbeddingsProvider extends BaseEmbeddingsProvider { } const fetchWithBackoff = () => withExponentialBackoff(async () => - this.fetch(new URL("embeddings", constants.a), { + this.fetch(new URL("embeddings", TRIAL_PROXY_URL), { method: "POST", body: JSON.stringify({ input: batch, diff --git a/core/llm/llms/FreeTrial.ts b/core/llm/llms/FreeTrial.ts index 10632b90f..e3dcdfef7 100644 --- a/core/llm/llms/FreeTrial.ts +++ b/core/llm/llms/FreeTrial.ts @@ -1,6 +1,6 @@ import { TRIAL_FIM_MODEL } from "../../config/onboarding.js"; import { getHeaders } from "../../continueServer/stubs/headers.js"; -import { constants } from "../../deploy/constants.js"; +import { TRIAL_PROXY_URL } from "../../control-plane/client.js"; import { ChatMessage, CompletionOptions, ModelProvider } from "../../index.js"; import { BaseLLM } from "../index.js"; import { streamResponse } from "../stream.js"; @@ -66,7 +66,7 @@ class FreeTrial extends BaseLLM { await this._countTokens(prompt, args.model, true); - const response = await this.fetch(`${constants.a}/stream_complete`, { + const response = await this.fetch(`${TRIAL_PROXY_URL}/stream_complete`, { method: "POST", headers: await this._getHeaders(), body: JSON.stringify({ @@ -113,7 +113,7 @@ class FreeTrial extends BaseLLM { true, ); - const response = await this.fetch(`${constants.a}/stream_chat`, { + const response = await this.fetch(`${TRIAL_PROXY_URL}/stream_chat`, { method: "POST", headers: await this._getHeaders(), body: JSON.stringify({ @@ -143,7 +143,7 @@ class FreeTrial extends BaseLLM { options: CompletionOptions, ): AsyncGenerator { const args = this._convertArgs(this.collectArgs(options)); - const resp = await this.fetch(`${constants.a}/stream_fim`, { + const resp = await this.fetch(`${TRIAL_PROXY_URL}/stream_fim`, { method: "POST", headers: await this._getHeaders(), body: JSON.stringify({ diff --git a/docs/static/schemas/config.json b/docs/static/schemas/config.json index f7e4daf53..69221f9c7 100644 --- a/docs/static/schemas/config.json +++ b/docs/static/schemas/config.json @@ -1609,7 +1609,8 @@ "database", "os", "repo-map", - "greptile" + "greptile", + "web" ], "markdownEnumDescriptions": [ "Reference the contents of the current changes as given by `git diff`", @@ -1634,7 +1635,8 @@ "Reference table schemas", "Operating system and CPU Information", "Map of files in the repository with important code highlights", - "Query your greptile index of the current repo" + "Query your greptile index of the current repo", + "Search the web for sources related to your question" ], "type": "string" }, @@ -1739,6 +1741,24 @@ "required": ["params"] } }, + { + "if": { "properties": { "name": { "enum": ["web"] } } }, + "then": { + "properties": { + "params": { + "properties": { + "n": { + "title": "N", + "description": "The number of results to return", + "default": 6, + "type": "integer" + } + } + } + }, + "required": ["params"] + } + }, { "if": { "properties": { diff --git a/extensions/intellij/src/main/resources/config_schema.json b/extensions/intellij/src/main/resources/config_schema.json index f7e4daf53..69221f9c7 100644 --- a/extensions/intellij/src/main/resources/config_schema.json +++ b/extensions/intellij/src/main/resources/config_schema.json @@ -1609,7 +1609,8 @@ "database", "os", "repo-map", - "greptile" + "greptile", + "web" ], "markdownEnumDescriptions": [ "Reference the contents of the current changes as given by `git diff`", @@ -1634,7 +1635,8 @@ "Reference table schemas", "Operating system and CPU Information", "Map of files in the repository with important code highlights", - "Query your greptile index of the current repo" + "Query your greptile index of the current repo", + "Search the web for sources related to your question" ], "type": "string" }, @@ -1739,6 +1741,24 @@ "required": ["params"] } }, + { + "if": { "properties": { "name": { "enum": ["web"] } } }, + "then": { + "properties": { + "params": { + "properties": { + "n": { + "title": "N", + "description": "The number of results to return", + "default": 6, + "type": "integer" + } + } + } + }, + "required": ["params"] + } + }, { "if": { "properties": { diff --git a/extensions/vscode/continue_rc_schema.json b/extensions/vscode/continue_rc_schema.json index 7414be280..02d7f26d2 100644 --- a/extensions/vscode/continue_rc_schema.json +++ b/extensions/vscode/continue_rc_schema.json @@ -1789,7 +1789,8 @@ "database", "os", "repo-map", - "greptile" + "greptile", + "web" ], "markdownEnumDescriptions": [ "Reference the contents of the current changes as given by `git diff`", @@ -1814,7 +1815,8 @@ "Reference table schemas", "Operating system and CPU Information", "Map of files in the repository with important code highlights", - "Query your greptile index of the current repo" + "Query your greptile index of the current repo", + "Search the web for sources related to your question" ], "type": "string" }, @@ -1935,6 +1937,34 @@ ] } }, + { + "if": { + "properties": { + "name": { + "enum": [ + "web" + ] + } + } + }, + "then": { + "properties": { + "params": { + "properties": { + "n": { + "title": "N", + "description": "The number of results to return", + "default": 6, + "type": "integer" + } + } + } + }, + "required": [ + "params" + ] + } + }, { "if": { "properties": { diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index bf3982055..36f98bcf5 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.9.215", + "version": "0.9.216", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "0.9.215", + "version": "0.9.216", "license": "Apache-2.0", "dependencies": { "@electron/rebuild": "^3.2.10", diff --git a/packages/llm-info/src/models/voyage.ts b/packages/llm-info/src/models/voyage.ts index fea218aa3..b68519cea 100644 --- a/packages/llm-info/src/models/voyage.ts +++ b/packages/llm-info/src/models/voyage.ts @@ -18,4 +18,9 @@ export const VoyageLlms = llms("voyage", [ displayName: "Rerank 2 Lite", contextLength: 8096, }, + { + model: "rerank-lite-1", + displayName: "Rerank Lite 1", + contextLength: 8096, + }, ]);