diff --git a/.github/workflows/auto-assign.yaml b/.github/workflows/auto-assign.yaml index b5e8896a9..3108307e5 100644 --- a/.github/workflows/auto-assign.yaml +++ b/.github/workflows/auto-assign.yaml @@ -16,8 +16,9 @@ jobs: repo-token: ${{ secrets.CI_GITHUB_TOKEN }} assignees: sestinj,Patrick-Erichsen numOfAssignee: 1 - - name: Add default labels + - name: "Add default labels" uses: actions-ecosystem/action-add-labels@v1 with: github_token: ${{ secrets.GITHUB_TOKEN }} - labels: "needs-triage" + labels: | + "needs-triage" diff --git a/.prettierrc b/.prettierrc index 46664808a..7b5484dd7 100644 --- a/.prettierrc +++ b/.prettierrc @@ -2,5 +2,8 @@ "tabWidth": 2, "useTabs": false, "trailingComma": "all", + "semi": true, + "singleQuote": false, + "bracketSpacing": true, "plugins": ["prettier-plugin-tailwindcss"] } diff --git a/.prompts/test.prompt b/.prompts/test.prompt deleted file mode 100644 index e2f5d8662..000000000 --- a/.prompts/test.prompt +++ /dev/null @@ -1,19 +0,0 @@ -temperature: 0.5 -maxTokens: 4096 -name: jest -description: Write Jest unit tests ---- - -You are an expert programmer - - -{{{ input }}} - -Write unit tests for the above selected code, following each of these instructions: -- Use `jest` -- Properly set up and tear down -- Include important edge cases -- The tests should be complete and sophisticated -- Give the tests just as chat output, don't edit any file -- Don't explain how to set up `jest` -- Write a single code block, making sure to label with the language being used (e.g. "```typscript") \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index b302a1157..b77c6d9b0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -14,11 +14,26 @@ } }, "search.exclude": { - "**/core/vendor/**": true, - "**/gui/dist": true, - "**/extensions/vscode/gui/**": true, - "**/extensions/vscode/out/**": true, - "**/extensions/intellij/build/**": true + "**/package-lock.json": true, + "binary/bin/**": true, + "binary/build/**": true, + "binary/out/**": true, + "binary/tmp/**": true, + "core/llm/llamaTokenizer.js": true, + "core/llm/llamaTokenizer.mjs": true, + "core/vendor/**": true, + "docs/.docusaurus/**": true, + "extensions/intellij/build/**": true, + "extensions/vscode/bin/**": true, + "extensions/vscode/build/**": true, + "extensions/vscode/gui/**": true, + "extensions/vscode/models/all-MiniLM-L6-v2/**": true, + "extensions/vscode/out/**": true, + "extensions/vscode/tag-qry/**": true, + "extensions/vscode/textmate-syntaxes/**": true, + "extensions/vscode/tree-sitter/**": true, + "gui/dist/**": true + // "sync/**": true }, "eslint.workingDirectories": ["./core"] } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index fb4e1241d..8331b5380 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -41,7 +41,7 @@ "background": { "activeOnStart": true, "beginsPattern": ">", - "endsPattern": "node scripts/esbuild.js --sourcemap --watch" + "endsPattern": "VS Code Extension esbuild complete" } } ] diff --git a/core/config/default.ts b/core/config/default.ts index 634c8c599..814552e75 100644 --- a/core/config/default.ts +++ b/core/config/default.ts @@ -6,7 +6,7 @@ import { } from "../"; export const DEFAULT_CHAT_MODEL_CONFIG: ModelDescription = { - model: "claude-3-5-sonnet-20240620", + model: "claude-3-5-sonnet-latest", provider: "anthropic", apiKey: "", title: "Claude 3.5 Sonnet", @@ -23,7 +23,7 @@ export const FREE_TRIAL_MODELS: ModelDescription[] = [ { title: "Claude 3.5 Sonnet (Free Trial)", provider: "free-trial", - model: "claude-3-5-sonnet-20240620", + model: "claude-3-5-sonnet-latest", systemMessage: "You are an expert software developer. You give helpful and concise responses.", }, diff --git a/core/config/types.ts b/core/config/types.ts index 22f1e9128..ca8ee9bec 100644 --- a/core/config/types.ts +++ b/core/config/types.ts @@ -648,6 +648,7 @@ declare global { | "gemma-7b-it" | "gemma2-9b-it" // Anthropic + | "claude-3-5-sonnet-latest" | "claude-3-5-sonnet-20240620" | "claude-3-opus-20240229" | "claude-3-sonnet-20240229" diff --git a/core/context/providers/DiffContextProvider.ts b/core/context/providers/DiffContextProvider.ts index ae0eb42b8..f2c95083f 100644 --- a/core/context/providers/DiffContextProvider.ts +++ b/core/context/providers/DiffContextProvider.ts @@ -17,7 +17,7 @@ class DiffContextProvider extends BaseContextProvider { query: string, extras: ContextProviderExtras, ): Promise { - const diff = await extras.ide.getDiff(false); + const diff = await extras.ide.getDiff(this.options.includeUnstaged ?? true); return [ { description: "The current git diff", diff --git a/core/context/rerankers/tei.ts b/core/context/rerankers/tei.ts index 61f38b98b..2d3f9ab12 100644 --- a/core/context/rerankers/tei.ts +++ b/core/context/rerankers/tei.ts @@ -15,6 +15,7 @@ export class HuggingFaceTEIReranker implements Reranker { apiBase?: string; truncate?: boolean; truncation_direction?: string; + apiKey?: string; }, ) {} @@ -24,9 +25,17 @@ export class HuggingFaceTEIReranker implements Reranker { apiBase += "/"; } + const headers: Record = { + "Content-Type": "application/json", + }; + + if (this.params.apiKey) { + headers["Authorization"] = `Bearer ${this.params.apiKey}`; + } + const resp = await fetch(new URL("rerank", apiBase), { method: "POST", - headers: { "Content-Type": "application/json" }, + headers, body: JSON.stringify({ query: query, return_text: false, diff --git a/core/index.d.ts b/core/index.d.ts index c896c361b..5b0b892f6 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -48,9 +48,9 @@ export interface IndexingProgressUpdate { export type PromptTemplate = | string | (( - history: ChatMessage[], - otherData: Record, - ) => string | ChatMessage[]); + history: ChatMessage[], + otherData: Record, + ) => string | ChatMessage[]); export interface ILLM extends LLMOptions { get providerName(): ModelProvider; @@ -646,7 +646,8 @@ type ModelProvider = | "cerebras" | "askSage" | "vertexai" - | "nebius"; + | "nebius" + | "xAI"; export type ModelName = | "AUTODETECT" @@ -696,6 +697,8 @@ export type ModelName = | "llama3.2-3b" | "llama3.2-11b" | "llama3.2-90b" + // xAI + | "grok-beta" // Other Open-source | "phi2" | "phind-codellama-34b" @@ -710,6 +713,7 @@ export type ModelName = | "gemma-7b-it" | "gemma2-9b-it" // Anthropic + | "claude-3-5-sonnet-latest" | "claude-3-5-sonnet-20240620" | "claude-3-opus-20240229" | "claude-3-sonnet-20240229" @@ -1053,9 +1057,9 @@ export interface Config { embeddingsProvider?: EmbeddingsProviderDescription | EmbeddingsProvider; /** The model that Continue will use for tab autocompletions. */ tabAutocompleteModel?: - | CustomLLM - | ModelDescription - | (CustomLLM | ModelDescription)[]; + | CustomLLM + | ModelDescription + | (CustomLLM | ModelDescription)[]; /** Options for tab autocomplete */ tabAutocompleteOptions?: Partial; /** UI styles customization */ diff --git a/core/indexing/docs/DocsCrawler.ts b/core/indexing/docs/DocsCrawler.ts index 1f72f73b6..d0851f95b 100644 --- a/core/indexing/docs/DocsCrawler.ts +++ b/core/indexing/docs/DocsCrawler.ts @@ -35,15 +35,18 @@ class DocsCrawler { async *crawl( startUrl: URL, maxRequestsPerCrawl: number = this.MAX_REQUESTS_PER_CRAWL, - ): AsyncGenerator { + ): AsyncGenerator { if (startUrl.host === this.GITHUB_HOST) { yield* new GitHubCrawler(startUrl).crawl(); return; } try { - yield* new DefaultCrawler(startUrl).crawl(); - return; + const pageData = await new DefaultCrawler(startUrl).crawl(); + if (pageData.length > 0) { + yield* pageData; + return; + } } catch (e) { console.error("Default crawler failed, trying backup: ", e); } diff --git a/core/indexing/docs/DocsService.ts b/core/indexing/docs/DocsService.ts index d6c3b684c..0224dc3a0 100644 --- a/core/indexing/docs/DocsService.ts +++ b/core/indexing/docs/DocsService.ts @@ -404,12 +404,15 @@ export default class DocsService { async getFavicon(startUrl: string) { const db = await this.getOrCreateSqliteDb(); - const { favicon } = await db.get( + const result = await db.get( `SELECT favicon FROM ${DocsService.sqlitebTableName} WHERE startUrl = ?`, startUrl, ); - return favicon; + if (!result) { + return; + } + return result.favicon; } private async init(configHandler: ConfigHandler) { diff --git a/core/indexing/docs/crawlers/DefaultCrawler.ts b/core/indexing/docs/crawlers/DefaultCrawler.ts index b5282df55..64a65c8fd 100644 --- a/core/indexing/docs/crawlers/DefaultCrawler.ts +++ b/core/indexing/docs/crawlers/DefaultCrawler.ts @@ -6,7 +6,7 @@ import { PageData } from "../DocsCrawler"; export class DefaultCrawler { constructor(private readonly startUrl: URL) {} - async *crawl(): AsyncGenerator { + async crawl(): Promise { const resp = await fetch(new URL("crawl", TRIAL_PROXY_URL).toString(), { method: "POST", headers: { @@ -20,8 +20,6 @@ export class DefaultCrawler { throw new Error(`Failed to crawl site: ${text}`); } const json = (await resp.json()) as PageData[]; - for (const pageData of json) { - yield pageData; - } + return json; } } diff --git a/core/indexing/docs/preIndexedDocs.ts b/core/indexing/docs/preIndexedDocs.ts index 83b439d42..48b777b21 100644 --- a/core/indexing/docs/preIndexedDocs.ts +++ b/core/indexing/docs/preIndexedDocs.ts @@ -299,30 +299,32 @@ const preIndexedDocs: Record< rootUrl: "https://docs.godotengine.org/en/latest/", faviconUrl: "https://godotengine.org/favicon.ico", }, - "https://docs.amplify.aws/react/": { + "https://docs.amplify.aws/react/start/": { title: "AWS Amplify (Gen 2)", startUrl: "https://docs.amplify.aws/react/start/", rootUrl: "https://docs.amplify.aws/react/", - faviconUrl: "https://docs.amplify.aws/favicon.ico" + faviconUrl: "https://docs.amplify.aws/favicon.ico", }, "https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/": { title: "AWS SDK for JavaScript v3", startUrl: "https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/", rootUrl: "https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/", - faviconUrl: "https://docs.aws.amazon.com/favicon.ico" + faviconUrl: "https://docs.aws.amazon.com/favicon.ico", }, "https://docs.aws.amazon.com/cdk/api/v2/docs/aws-construct-library.html": { title: "AWS CDK v2", - startUrl: "https://docs.aws.amazon.com/cdk/api/v2/docs/aws-construct-library.html", + startUrl: + "https://docs.aws.amazon.com/cdk/api/v2/docs/aws-construct-library.html", rootUrl: "https://docs.aws.amazon.com/cdk/api/v2/docs/", - faviconUrl: "https://docs.aws.amazon.com/cdk/api/v2/img/favicon-32x32.png" + faviconUrl: "https://docs.aws.amazon.com/cdk/api/v2/img/favicon-32x32.png", }, "https://awscli.amazonaws.com/v2/documentation/api/latest/index.html": { title: "AWS CLI commands", - startUrl: "https://awscli.amazonaws.com/v2/documentation/api/latest/index.html", + startUrl: + "https://awscli.amazonaws.com/v2/documentation/api/latest/index.html", rootUrl: "https://awscli.amazonaws.com/v2/documentation/api/latest/", - faviconUrl: "https://docs.aws.amazon.com/favicon.ico" - } + faviconUrl: "https://docs.aws.amazon.com/favicon.ico", + }, }; export default preIndexedDocs; diff --git a/core/llm/autodetect.ts b/core/llm/autodetect.ts index c6b1874c3..64e0634a5 100644 --- a/core/llm/autodetect.ts +++ b/core/llm/autodetect.ts @@ -146,7 +146,8 @@ function autodetectTemplateType(model: string): TemplateType | undefined { lower.includes("command") || lower.includes("chat-bison") || lower.includes("pplx") || - lower.includes("gemini") + lower.includes("gemini") || + lower.includes("grok") ) { return undefined; } diff --git a/core/llm/llms/Anthropic.ts b/core/llm/llms/Anthropic.ts index 2ad990e98..eaedde8de 100644 --- a/core/llm/llms/Anthropic.ts +++ b/core/llm/llms/Anthropic.ts @@ -11,16 +11,17 @@ import { streamSse } from "../stream.js"; class Anthropic extends BaseLLM { static providerName: ModelProvider = "anthropic"; static defaultOptions: Partial = { - model: "claude-3-5-sonnet-20240620", + model: "claude-3-5-sonnet-latest", contextLength: 200_000, completionOptions: { - model: "claude-3-5-sonnet-20240620", + model: "claude-3-5-sonnet-latest", maxTokens: 4096, }, apiBase: "https://api.anthropic.com/v1/", }; - public convertArgs(options: CompletionOptions) { // should be public for use within VertexAI + public convertArgs(options: CompletionOptions) { + // should be public for use within VertexAI const finalOptions = { top_k: options.topK, top_p: options.topP, @@ -34,53 +35,61 @@ class Anthropic extends BaseLLM { return finalOptions; } - public convertMessages(msgs: ChatMessage[]): any[] { // should be public for use within VertexAI - const filteredmessages = msgs.filter((m) => m.role !== "system") - const lastTwoUserMsgIndices = filteredmessages + public convertMessages(msgs: ChatMessage[]): any[] { + // should be public for use within VertexAI + const filteredmessages = msgs.filter((m) => m.role !== "system"); + const lastTwoUserMsgIndices = filteredmessages .map((msg, index) => (msg.role === "user" ? index : -1)) - .filter((index) => index !== -1).slice(-2); + .filter((index) => index !== -1) + .slice(-2); const messages = filteredmessages.map((message, filteredMsgIdx) => { - // Add cache_control parameter to the last two user messages - // The second-to-last because it retrieves potentially already cached contents, - // The last one because we want it cached for later retrieval. - // See: https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching - const addCaching = this.cacheBehavior?.cacheConversation && lastTwoUserMsgIndices.includes(filteredMsgIdx); + // Add cache_control parameter to the last two user messages + // The second-to-last because it retrieves potentially already cached contents, + // The last one because we want it cached for later retrieval. + // See: https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching + const addCaching = + this.cacheBehavior?.cacheConversation && + lastTwoUserMsgIndices.includes(filteredMsgIdx); - if (typeof message.content === "string") { - var chatMessage = { - ...message, - content: [{ - type: "text", - text: message.content, - ...(addCaching? { cache_control: { type: "ephemeral" } } : {}) - }] - }; - return chatMessage; - } - - return { + if (typeof message.content === "string") { + var chatMessage = { ...message, - content: message.content.map((part, contentIdx) => { - if (part.type === "text") { - const newpart = { - ...part, - // If multiple text parts, only add cache_control to the last one - ...((addCaching && contentIdx == message.content.length - 1) ? { cache_control: { type: "ephemeral" } } : {}) - }; - return newpart; - } - return { - type: "image", - source: { - type: "base64", - media_type: "image/jpeg", - data: part.imageUrl?.url.split(",")[1], - }, - }; - }), + content: [ + { + type: "text", + text: message.content, + ...(addCaching ? { cache_control: { type: "ephemeral" } } : {}), + }, + ], }; - }); + return chatMessage; + } + + return { + ...message, + content: message.content.map((part, contentIdx) => { + if (part.type === "text") { + const newpart = { + ...part, + // If multiple text parts, only add cache_control to the last one + ...(addCaching && contentIdx == message.content.length - 1 + ? { cache_control: { type: "ephemeral" } } + : {}), + }; + return newpart; + } + return { + type: "image", + source: { + type: "base64", + media_type: "image/jpeg", + data: part.imageUrl?.url.split(",")[1], + }, + }; + }), + }; + }); return messages; } @@ -98,7 +107,8 @@ class Anthropic extends BaseLLM { messages: ChatMessage[], options: CompletionOptions, ): AsyncGenerator { - const shouldCacheSystemMessage = !!this.systemMessage && this.cacheBehavior?.cacheSystemMessage; + const shouldCacheSystemMessage = + !!this.systemMessage && this.cacheBehavior?.cacheSystemMessage; const systemMessage: string = stripImages( messages.filter((m) => m.role === "system")[0]?.content, ); diff --git a/core/llm/llms/FreeTrial.ts b/core/llm/llms/FreeTrial.ts index e3dcdfef7..46d46046c 100644 --- a/core/llm/llms/FreeTrial.ts +++ b/core/llm/llms/FreeTrial.ts @@ -164,7 +164,7 @@ class FreeTrial extends BaseLLM { async listModels(): Promise { return [ "codestral-latest", - "claude-3-5-sonnet-20240620", + "claude-3-5-sonnet-latest", "llama3.1-405b", "llama3.1-70b", "gpt-4o", diff --git a/core/llm/llms/index.ts b/core/llm/llms/index.ts index a3fa6c910..17ff45725 100644 --- a/core/llm/llms/index.ts +++ b/core/llm/llms/index.ts @@ -45,6 +45,7 @@ import VertexAI from "./VertexAI"; import Vllm from "./Vllm"; import WatsonX from "./WatsonX"; import ContinueProxy from "./stubs/ContinueProxy"; +import xAI from "./xAI"; const LLMs = [ Anthropic, @@ -85,6 +86,7 @@ const LLMs = [ Asksage, Nebius, VertexAI, + xAI, ]; export async function llmFromDescription( diff --git a/core/llm/llms/xAI.ts b/core/llm/llms/xAI.ts new file mode 100644 index 000000000..aa33ee70d --- /dev/null +++ b/core/llm/llms/xAI.ts @@ -0,0 +1,20 @@ +import { LLMOptions, ModelProvider } from "../../index.js"; + +import OpenAI from "./OpenAI.js"; + +class xAI extends OpenAI { + static providerName: ModelProvider = "xAI"; + static defaultOptions: Partial = { + apiBase: "https://api.x.ai/v1/", + }; + + private static MODEL_IDS: { [name: string]: string } = { + "grok-beta": "grok-beta", // Future names might not line up + }; + + protected _convertModelName(model: string) { + return xAI.MODEL_IDS[model] || this.model; + } +} + +export default xAI; diff --git a/docs/docs/chat/model-setup.mdx b/docs/docs/chat/model-setup.mdx index 6e9dbcf22..bf968ad12 100644 --- a/docs/docs/chat/model-setup.mdx +++ b/docs/docs/chat/model-setup.mdx @@ -25,7 +25,7 @@ Our current top recommendation is Claude Sonnet 3.5 from [Anthropic](../customiz { "title": "Claude 3.5 Sonnet", "provider": "anthropic", - "model": "claude-3-5-sonnet-20240620", + "model": "claude-3-5-sonnet-latest", "apiKey": "[ANTHROPIC_API_KEY]" } ] diff --git a/docs/docs/customize/model-providers/top-level/anthropic.md b/docs/docs/customize/model-providers/top-level/anthropic.md index c4bb24a4c..9333a8e84 100644 --- a/docs/docs/customize/model-providers/top-level/anthropic.md +++ b/docs/docs/customize/model-providers/top-level/anthropic.md @@ -19,7 +19,7 @@ We recommend configuring **Claude 3.5 Sonnet** as your chat model. { "title": "Claude 3.5 Sonnet", "provider": "anthropic", - "model": "claude-3-5-sonnet-20240620", + "model": "claude-3-5-sonnet-latest", "apiKey": "[API_KEY]" } ] @@ -61,7 +61,7 @@ To enable caching of the system message and the turn-by-turn conversation, updat }, "title": "Anthropic", "provider": "anthropic", - "model": "claude-3-5-sonnet-20240620", + "model": "claude-3-5-sonnet-latest", "apiKey": "[API_KEY]" } ] diff --git a/docs/docs/customize/model-providers/top-level/xAI.md b/docs/docs/customize/model-providers/top-level/xAI.md new file mode 100644 index 000000000..fbdfa83ad --- /dev/null +++ b/docs/docs/customize/model-providers/top-level/xAI.md @@ -0,0 +1,53 @@ +--- +title: xAI +slug: ../xai +--- + +:::info + +You can get an API key from the [xAI console](https://console.x.ai/) + +::: + +## Chat model + +We recommend configuring **grok-beta** as your chat model. + +```json title="config.json" +{ + "models": [ + { + "title": "Grok Beta", + "provider": "xAI", + "model": "grok-beta", + "apiKey": "[API_KEY]" + } + ] +} +``` + +## Autocomplete model + +xAI currently does not offer any autocomplete models. + +[Click here](../../model-types/autocomplete.md) to see a list of autocomplete model providers. + +## Embeddings model + +xAI currently does not offer any embeddings models. + +[Click here](../../model-types/embeddings.md) to see a list of embeddings model providers. + +## Reranking model + +xAI currently does not offer any reranking models. + +[Click here](../../model-types/reranking.md) to see a list of reranking model providers. + +## Legacy Completions + +To force usage of `chat/completions` instead of `completions` endpoint you can set + +```json +"useLegacyCompletionsEndpoint": false +``` diff --git a/docs/docs/customize/model-types/reranking.md b/docs/docs/customize/model-types/reranking.md index 4aceade4a..a87918cb2 100644 --- a/docs/docs/customize/model-types/reranking.md +++ b/docs/docs/customize/model-types/reranking.md @@ -72,6 +72,7 @@ The `"modelTitle"` field must match one of the models in your "models" array in "name": "huggingface-tei", "params": { "apiBase": "http://localhost:8080", + "apiKey": "", "truncate": true, "truncation_direction": "Right" } diff --git a/docs/docs/reference.md b/docs/docs/reference.md index 19e8f386e..391273943 100644 --- a/docs/docs/reference.md +++ b/docs/docs/reference.md @@ -421,7 +421,7 @@ Several experimental config parameters are available, as described below: - `fix`: Prompt for fixing code. - `optimize`: Prompt for optimizing code. - `fixGrammar`: Prompt for fixing grammar or spelling. -- `useChromiumForDocsCrawling`: Use chromium to crawl docs instead of default lighter-weight tool that can't render sites. Downloads and installs Chromium to `~/.continue/.utils`. +- `useChromiumForDocsCrawling`: Use Chromium to crawl docs locally. Useful if the default Cheerio crawler fails on sites that require JavaScript rendering. Downloads and installs Chromium to `~/.continue/.utils`.. Example diff --git a/extensions/intellij/.gitignore b/extensions/intellij/.gitignore index 46efc4768..13ca3bab9 100644 --- a/extensions/intellij/.gitignore +++ b/extensions/intellij/.gitignore @@ -1,4 +1,5 @@ src/main/resources/webview +!src/main/resources/webview/index.html src/main/resources/bin src/main/resources/config_schema.json src/main/resources/continue_rc_schema.json \ No newline at end of file diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/ServerConstants.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/ServerConstants.kt index 5a1b8af0e..cdcb58c18 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/ServerConstants.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/ServerConstants.kt @@ -14,7 +14,7 @@ const val DEFAULT_CONFIG = { "models": [ { - "model": "claude-3-5-sonnet-20240620", + "model": "claude-3-5-sonnet-latest", "provider": "anthropic", "apiKey": "", "title": "Claude 3.5 Sonnet" diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/ConfigJsonSchemaProviderFactory.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/ConfigJsonSchemaProviderFactory.kt index c303b26fb..2056d216e 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/ConfigJsonSchemaProviderFactory.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/ConfigJsonSchemaProviderFactory.kt @@ -22,7 +22,7 @@ class ConfigJsonSchemaProviderFactory : JsonSchemaProviderFactory { class ConfigJsonSchemaFileProvider : JsonSchemaFileProvider { override fun isAvailable(file: VirtualFile): Boolean { - return path.endsWith("/.continue/config.json") + return file.path.endsWith("/.continue/config.json") } override fun getName(): String { diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/services/ContinueExtensionSettingsService.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/services/ContinueExtensionSettingsService.kt index f73ba509c..5db34ff29 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/services/ContinueExtensionSettingsService.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/services/ContinueExtensionSettingsService.kt @@ -2,10 +2,12 @@ package com.github.continuedev.continueintellijextension.services import com.github.continuedev.continueintellijextension.constants.getConfigJsPath import com.github.continuedev.continueintellijextension.constants.getConfigJsonPath +import com.intellij.openapi.application.ApplicationInfo import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.components.* import com.intellij.openapi.options.Configurable import com.intellij.openapi.project.DumbAware +import com.intellij.openapi.util.SystemInfo import com.intellij.util.concurrency.AppExecutorUtil import com.intellij.util.messages.Topic import kotlinx.serialization.Serializable @@ -28,6 +30,7 @@ class ContinueSettingsComponent : DumbAware { val userToken: JTextField = JTextField() val enableTabAutocomplete: JCheckBox = JCheckBox("Enable Tab Autocomplete") val enableContinueTeamsBeta: JCheckBox = JCheckBox("Enable Continue for Teams Beta") + val enableOSR: JCheckBox = JCheckBox("Enable Off-Screen Rendering") val displayEditorTooltip: JCheckBox = JCheckBox("Display Editor Tooltip") init { @@ -56,6 +59,8 @@ class ContinueSettingsComponent : DumbAware { constraints.gridy++ panel.add(enableContinueTeamsBeta, constraints) constraints.gridy++ + panel.add(enableOSR, constraints) + constraints.gridy++ panel.add(displayEditorTooltip, constraints) constraints.gridy++ @@ -87,6 +92,7 @@ open class ContinueExtensionSettings : PersistentStateComponent= minBuildNumber +} \ No newline at end of file diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinueBrowser.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinueBrowser.kt index 03d4f4715..7891a02dc 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinueBrowser.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinueBrowser.kt @@ -5,6 +5,7 @@ import com.github.continuedev.continueintellijextension.constants.MessageTypes import com.github.continuedev.continueintellijextension.constants.getConfigJsonPath import com.github.continuedev.continueintellijextension.`continue`.* import com.github.continuedev.continueintellijextension.factories.CustomSchemeHandlerFactory +import com.github.continuedev.continueintellijextension.services.ContinueExtensionSettings import com.github.continuedev.continueintellijextension.services.ContinuePluginService import com.google.gson.Gson import com.google.gson.JsonObject @@ -78,7 +79,8 @@ class ContinueBrowser(val project: Project, url: String) { val browser: JBCefBrowser init { - this.browser = JBCefBrowser.createBuilder().setOffScreenRendering(shouldRenderOffScreen()).build() + val enableOSR = ServiceManager.getService(ContinueExtensionSettings::class.java).continueState.enableOSR + this.browser = JBCefBrowser.createBuilder().setOffScreenRendering(enableOSR).build() browser.jbCefClient.setProperty( @@ -274,34 +276,4 @@ class ContinueBrowser(val project: Project, url: String) { return """window.postMessage($jsonData, "*");""" } - /** - * This function checks if the pluginSinceBuild is greater than or equal to 233, which corresponds - * to IntelliJ platform version 2023.3 and later. - * - * Setting `setOffScreenRendering` to `false` causes a number of issues such as a white screen flash when loading - * the GUI and the inability to set `cursor: pointer`. However, setting `setOffScreenRendering` to `true` on - * platform versions prior to 2023.3.4 causes larger issues such as an inability to type input for certain langauges, - * e.g. Korean. - * - * References: - * 1. https://youtrack.jetbrains.com/issue/IDEA-347828/JCEF-white-flash-when-tool-window-show#focus=Comments-27-9334070.0-0 - * This issue mentions that white screen flash problems were resolved in platformVersion 2023.3.4. - * 2. https://www.jetbrains.com/idea/download/other.html - * This documentation shows mappings from platformVersion to branchNumber. - * - * We use the branchNumber (e.g., 233) instead of the full version number (e.g., 2023.3.4) because - * it's a simple integer without dot notation, making it easier to compare. - */ - private fun shouldRenderOffScreen(): Boolean { - // With the 0.0.77 release, non-Mac users have been reporting issues with paste functionality - // in the browser. Disabling OSR for all non-Mac users for now. - if (!SystemInfo.isMac) { - return false - } - - val minBuildNumber = 233 - val applicationInfo = ApplicationInfo.getInstance() - val currentBuildNumber = applicationInfo.build.baselineVersion - return currentBuildNumber >= minBuildNumber - } } diff --git a/extensions/intellij/src/main/resources/continue_rc_schema.json b/extensions/intellij/src/main/resources/continue_rc_schema.json deleted file mode 100644 index 3282e0344..000000000 --- a/extensions/intellij/src/main/resources/continue_rc_schema.json +++ /dev/null @@ -1,3301 +0,0 @@ -{ - "title": "config.json", - "$ref": "#/definitions/SerializedContinueConfig", - "definitions": { - "BaseCompletionOptions": { - "title": "BaseCompletionOptions", - "type": "object", - "properties": { - "stream": { - "title": "Stream", - "description": "Whether to stream the LLM response. Currently only respected by the 'anthropic' provider. Otherwise will always stream.", - "type": "boolean", - "default": true - }, - "temperature": { - "title": "Temperature", - "description": "The temperature of the completion.", - "type": "number" - }, - "topP": { - "title": "Top P", - "description": "The topP of the completion.", - "type": "number" - }, - "topK": { - "title": "Top K", - "description": "The topK of the completion.", - "type": "integer" - }, - "presencePenalty": { - "title": "Presence Penalty", - "description": "The presence penalty Aof the completion.", - "type": "number" - }, - "frequencePenalty": { - "title": "Frequency Penalty", - "description": "The frequency penalty of the completion.", - "type": "number" - }, - "mirostat": { - "title": "Mirostat", - "description": "Enable Mirostat sampling, controlling perplexity during text generation (default: 0, 0 = disabled, 1 = Mirostat, 2 = Mirostat 2.0). Only available for Ollama, LM Studio, and llama.cpp providers", - "type": "number" - }, - "stop": { - "title": "Stop", - "description": "The stop tokens of the completion.", - "type": "array", - "items": { - "type": "string" - } - }, - "maxTokens": { - "title": "Max Tokens", - "description": "The maximum number of tokens to generate.", - "default": 600, - "type": "integer" - }, - "numThreads": { - "title": "Number of threads", - "description": "The number of threads used in the generation process. Only available for Ollama (this is the num_thread parameter)", - "type": "integer" - }, - "keepAlive": { - "title": "Ollama keep_alive", - "description": "The number of seconds after no requests are made to unload the model from memory. Defaults to 60*30 = 30min", - "type": "integer" - } - } - }, - "ClientCertificateOptions": { - "title": "ClientCertificateOptions", - "type": "object", - "properties": { - "cert": { - "title": "Cert Path", - "description": "Path to the client certificate file", - "type": "string" - }, - "key": { - "title": "Key Path", - "description": "Path to the client certificate key file", - "type": "string" - }, - "passphrase": { - "title": "Passphrase", - "description": "Passphrase for the client certificate key file", - "type": "string" - } - }, - "required": [ - "cert", - "key" - ] - }, - "RequestOptions": { - "title": "RequestOptions", - "type": "object", - "properties": { - "timeout": { - "title": "Timeout", - "description": "Set the timeout for each request to the LLM. If you are running a local LLM that takes a while to respond, you might want to set this to avoid timeouts.", - "default": 7200, - "type": "integer" - }, - "verifySsl": { - "title": "Verify Ssl", - "description": "Whether to verify SSL certificates for requests.", - "type": "boolean" - }, - "caBundlePath": { - "title": "Ca Bundle Path", - "description": "Path to a custom CA bundle to use when making the HTTP request", - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "proxy": { - "title": "Proxy", - "description": "Proxy URL to use when making the HTTP request", - "type": "string" - }, - "headers": { - "title": "Headers", - "description": "Headers to use when making the HTTP request", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "extraBodyProperties": { - "title": "Extra Body Properties", - "description": "This object will be merged with the body when making the HTTP requests", - "type": "object" - }, - "noProxy": { - "title": "No Proxy", - "description": "A list of hostnames for which Continue should not use the proxy specified in requestOptions.proxy", - "type": "array", - "items": { - "type": "string" - } - }, - "clientCertificate": { - "title": "Client Certificate", - "description": "Client certificate to use when making the HTTP request", - "$ref": "#/definitions/ClientCertificateOptions" - } - } - }, - "ModelDescription": { - "title": "ModelDescription", - "type": "object", - "properties": { - "title": { - "title": "Title", - "description": "The title you wish to give your model.", - "type": "string" - }, - "provider": { - "title": "Provider", - "description": "The provider of the model. This is used to determine the type of model, and how to interact with it.", - "enum": [ - "openai", - "free-trial", - "anthropic", - "cohere", - "bedrock", - "bedrockimport", - "sagemaker", - "together", - "ollama", - "huggingface-tgi", - "huggingface-inference-api", - "llama.cpp", - "replicate", - "gemini", - "lmstudio", - "llamafile", - "mistral", - "deepinfra", - "groq", - "fireworks", - "cloudflare", - "deepseek", - "azure", - "msty", - "watsonx", - "openrouter", - "sambanova", - "nvidia", - "vllm", - "cerebras", - "askSage", - "nebius", - "vertexai" - ], - "markdownEnumDescriptions": [ - "### OpenAI\nUse gpt-4, gpt-3.5-turbo, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.\n\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/openai)", - "### Free Trial\nNew users can try out Continue for free using a proxy server that securely makes calls to OpenAI using our API key. If you are ready to use your own API key or have used all 250 free uses, you can enter your API key in config.json where it says `apiKey=\"\"` or select another model provider.\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/freetrial)", - "### Anthropic\nTo get started with Anthropic models, you first need to sign up for the open beta [here](https://claude.ai/login) to obtain an API key.\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/anthropicllm)", - "### Anthropic Vertex AI\nTo get started you need to enable the [Vertex AI API](https://console.cloud.google.com/marketplace/product/google/aiplatform.googleapis.com) and set up the [Google Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc).", - "### Cohere\nTo use Cohere, visit the [Cohere dashboard](https://dashboard.cohere.com/api-keys) to create an API key.\n\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/cohere)", - "### Bedrock\nTo get started with Bedrock you need to sign up on AWS [here](https://aws.amazon.com/bedrock)", - "### Bedrock Imported Models\nTo get started with Bedrock you need to sign up on AWS [here](https://aws.amazon.com/bedrock)", - "### Sagemaker\nSagemaker is AWS' machine learning platform.", - "### Together\nTogether is a hosted service that provides extremely fast streaming of open-source language models. To get started with Together:\n1. Obtain an API key from [here](https://together.ai)\n2. Paste below\n3. Select a model preset\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/togetherllm)", - "### Ollama\nTo get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama run `. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.json (e.g. `model=\"codellama:7b-instruct\"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/ollama)", - "### Huggingface TGI\n\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/huggingfacetgi)", - "### Huggingface Inference API\n\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/huggingfaceinferenceapi)", - "### Llama.cpp\nllama.cpp comes with a [built-in server](https://github.com/ggerganov/llama.cpp/tree/master/examples/server#llamacppexampleserver) that can be run from source. To do this:\n\n1. Clone the repository with `git clone https://github.com/ggerganov/llama.cpp`.\n2. `cd llama.cpp`\n3. Run `make` to build the server.\n4. Download the model you'd like to use and place it in the `llama.cpp/models` directory (the best place to find models is [The Bloke on HuggingFace](https://huggingface.co/TheBloke))\n5. Run the llama.cpp server with the command below (replacing with the model you downloaded):\n\n```shell\n.\\server.exe -c 4096 --host 0.0.0.0 -t 16 --mlock -m models/codellama-7b-instruct.Q8_0.gguf\n```\n\nAfter it's up and running, you can start using Continue.\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/llamacpp)", - "### Replicate\nReplicate is a hosted service that makes it easy to run ML models. To get started with Replicate:\n1. Obtain an API key from [here](https://replicate.com)\n2. Paste below\n3. Select a model preset\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/replicatellm)", - "### Gemini API\nTo get started with Google Makersuite, obtain your API key from [here](https://makersuite.google.com) and paste it below.\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/geminiapi)", - "### Gemini API on Vertex AI\nTo get started you need to enable the [Vertex AI API](https://console.cloud.google.com/marketplace/product/google/aiplatform.googleapis.com) and set up the [Google Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc).", - "### LMStudio\nLMStudio provides a professional and well-designed GUI for exploring, configuring, and serving LLMs. It is available on both Mac and Windows. To get started:\n1. Download from [lmstudio.ai](https://lmstudio.ai/) and open the application\n2. Search for and download the desired model from the home screen of LMStudio.\n3. In the left-bar, click the '<->' icon to open the Local Inference Server and press 'Start Server'.\n4. Once your model is loaded and the server has started, you can begin using Continue.\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/lmstudio)", - "### Llamafile\nTo get started with llamafiles, find and download a binary on their [GitHub repo](https://github.com/Mozilla-Ocho/llamafile#binary-instructions). Then run it with the following command:\n\n```shell\nchmod +x ./llamafile\n./llamafile\n```\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/llamafile)", - "### Mistral API\n\nTo get access to the Mistral API, obtain your API key from the [Mistral platform](https://docs.mistral.ai/)", - "### Mistral API on Vertex AI\nTo get started you need to enable the [Vertex AI API](https://console.cloud.google.com/marketplace/product/google/aiplatform.googleapis.com) and set up the [Google Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc).", - "### DeepInfra\n\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/deepinfra)", - "### Groq\nGroq provides extremely fast inference of open-source language models. To get started, obtain an API key from [their console](https://console.groq.com/keys).", - "### Fireworks\nFireworks is a fast inference engine for open-source language models. To get started, obtain an API key from [their console](https://fireworks.ai/api-keys).", - "### Cloudflare Workers AI\n\n[Reference](https://developers.cloudflare.com/workers-ai/)", - "### Deepseek\n Deepseek's API provides the best pricing for their state-of-the-art Deepseek Coder models. To get started, obtain an API key from [their console](https://platform.deepseek.com/api_keys)", - "### Azure OpenAI\n Azure OpenAI lets you securely run OpenAI's models on Azure. To get started, follow the steps [here](https://docs.continue.dev/reference/Model%20Providers/azure)", - "### Msty\nMsty is the simplest way to get started with online or local LLMs on all desktop platforms - Windows, Mac, and Linux. No fussing around, one-click and you are up and running. To get started, follow these steps:\n1. Download from [Msty.app](https://msty.app/), open the application, and click 'Setup Local AI'.\n2. Go to the Local AI Module page and download a model of your choice.\n3. Once the model has finished downloading, you can start asking questions through Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/Msty)", - "### IBM watsonx\nwatsonx, developed by IBM, offers a variety of pre-trained AI foundation models that can be used for natural language processing (NLP), computer vision, and speech recognition tasks.", - "### OpenRouter\nOpenRouter offers a single API to access almost any language model. To get started, obtain an API key from [their console](https://openrouter.ai/settings/keys).", - "### NVIDIA NIMs\nNVIDIA offers a single API to access almost any language model. To find out more, visit the [LLM APIs Documentation](https://docs.api.nvidia.com/nim/reference/llm-apis).\nFor information specific to getting a key, please check out the [docs here](https://docs.nvidia.com/nim/large-language-models/latest/getting-started.html#option-1-from-api-catalog)", - "### vLLM\nvLLM is a highly performant way of hosting LLMs for a team. To get started, follow their [quickstart](https://docs.vllm.ai/en/latest/getting_started/quickstart.html) to set up your server.", - "### Cerebras\nCerebras Inference uses specialized silicon to provides superfast inference. To get started, get your API keys from [their console](https://cloud.cerebras.ai/).", - "### Ask Sage\nAsk Sage is an agnostic hosted service that provides language models. To get started with Ask Sage:\n1. Obtain an API key from your account. For more information, visit [Ask Sage](https://docs.asksage.ai/).\n2. Paste the API key below.\n3. Select a model preset.\n> [Reference](https://docs.asksage.ai/)" - ], - "type": "string" - }, - "model": { - "title": "Model", - "description": "The name of the model. Used to autodetect prompt template.", - "type": "string" - }, - "apiKey": { - "title": "Api Key", - "description": "OpenAI, Anthropic, Cohere, Together, or other API key", - "type": "string" - }, - "apiBase": { - "title": "Api Base", - "description": "The base URL of the LLM API.", - "type": "string" - }, - "region": { - "title": "Region", - "description": "The region where the model is hosted", - "anyOf": [ - { - "enum": [ - "us-east-1", - "us-east-2", - "us-west-1", - "us-west-2", - "eu-west-1", - "eu-central-1", - "ap-southeast-1", - "ap-northeast-1", - "ap-south-1", - "us-central1", - "us-east1", - "us-east4", - "us-east5", - "us-west1", - "us-west4", - "us-south1", - "northamerica-northeast1", - "southamerica-east1", - "europe-central2", - "europe-north1", - "europe-west1", - "europe-west2", - "europe-west3", - "europe-west4", - "europe-west6", - "europe-west8", - "europe-west9", - "europe-southwest1", - "asia-east1", - "asia-east2", - "asia-south1", - "asia-northeast1", - "asia-northeast3", - "asia-southeast1", - "australia-southeast1", - "me-central1", - "me-central2", - "me-west1" - ], - "type": "string" - }, - { - "type": "string" - } - ] - }, - "profile": { - "title": "Profile", - "description": "The AWS security profile to use", - "type": "string" - }, - "modelArn": { - "title": "Profile", - "description": "The AWS arn for the imported model", - "type": "string" - }, - "contextLength": { - "title": "Context Length", - "description": "The maximum context length of the LLM in tokens, as counted by countTokens.", - "default": 2048, - "type": "integer" - }, - "maxStopWords": { - "title": "Max Stop Words", - "description": "The maximum number of stop words that the API will accept. You can set this if you are receiving an error about the number of stop words, but otherwise should leave it undefined.", - "type": "integer" - }, - "template": { - "title": "Template", - "description": "The chat template used to format messages. This is auto-detected for most models, but can be overridden here. Choose none if you are using vLLM or another server that automatically handles prompting.", - "enum": [ - "llama2", - "alpaca", - "zephyr", - "phi2", - "phind", - "anthropic", - "chatml", - "none", - "deepseek", - "openchat", - "xwin-coder", - "neural-chat", - "codellama-70b", - "llava", - "gemma", - "llama3" - ], - "type": "string" - }, - "promptTemplates": { - "title": "Prompt Templates", - "markdownDescription": "A mapping of prompt template name ('edit' is currently the only one used in Continue) to a string giving the prompt template. See [here](https://docs.continue.dev/model-setup/configuration#customizing-the-edit-prompt) for an example.", - "x-intellij-html-description": "A mapping of prompt template name ('edit' is currently the only one used in Continue) to a string giving the prompt template. See here for an example.", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "completionOptions": { - "title": "Completion Options", - "description": "Options for the completion endpoint. Read more about the completion options in the documentation.", - "default": { - "temperature": null, - "topP": null, - "topK": null, - "presencePenalty": null, - "frequencyPenalty": null, - "stop": null, - "maxTokens": 2048 - }, - "allOf": [ - { - "$ref": "#/definitions/BaseCompletionOptions" - } - ] - }, - "systemMessage": { - "title": "System Message", - "description": "A system message that will always be followed by the LLM", - "type": "string" - }, - "requestOptions": { - "title": "Request Options", - "description": "Options for the HTTP request to the LLM.", - "default": { - "timeout": 7200, - "verifySsl": null, - "caBundlePath": null, - "proxy": null, - "headers": null, - "extraBodyProperties": null - }, - "allOf": [ - { - "$ref": "#/definitions/RequestOptions" - } - ] - }, - "apiType": { - "title": "Api Type", - "markdownDescription": "OpenAI API type, either `openai` or `azure`", - "x-intellij-html-description": "OpenAI API type, either openai or azure", - "enum": [ - "openai", - "azure" - ] - }, - "apiVersion": { - "title": "Api Version", - "description": "Azure OpenAI API version (e.g. 2023-07-01-preview)", - "type": "string" - }, - "deployment": { - "title": "Deployment", - "description": "Azure OpenAI deployment", - "type": "string" - }, - "capabilities": { - "type": "object", - "description": "We will attempt to automatically detect the capabilities of the model based on its title and provider, but this may not always be accurate. You can override the model's capabilities here.", - "properties": { - "uploadImage": { - "type": "boolean", - "description": "Indicates whether the model can upload images." - } - } - } - }, - "required": [ - "title", - "provider", - "model" - ], - "allOf": [ - { - "if": { - "properties": { - "provider": { - "type": "str" - } - }, - "not": { - "required": [ - "provider" - ] - } - }, - "then": { - "properties": { - "model": { - "description": "Choose a provider first, then model options will be shown here." - } - } - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "openai", - "anthropic", - "cohere", - "gemini", - "huggingface-inference-api", - "replicate", - "together", - "cloudflare", - "sambanova", - "nebius" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "required": [ - "apiKey" - ] - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "bedrockimport" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "required": [ - "modelArn" - ] - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "huggingface-tgi", - "huggingface-inference-api" - ] - } - } - }, - "then": { - "required": [ - "apiBase" - ] - }, - "required": [ - "provider" - ] - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "openai" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "deployment": { - "type": "string" - }, - "apiType": { - "type": "string" - }, - "apiVersion": { - "type": "string" - } - } - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "cloudflare" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "accountId": { - "type": "string" - }, - "aiGatewaySlug": { - "type": "string" - }, - "model": { - "anyOf": [ - { - "enum": [ - "@cf/meta/llama-3-8b-instruct", - "@hf/thebloke/deepseek-coder-6.7b-instruct-awq", - "@cf/deepseek-ai/deepseek-math-7b-instruct", - "@cf/thebloke/discolm-german-7b-v1-awq", - "@cf/tiiuae/falcon-7b-instruct", - "@cf/google/gemma-2b-it-lora", - "@hf/google/gemma-7b-it", - "@cf/google/gemma-7b-it-lora", - "@hf/nousresearch/hermes-2-pro-mistral-7b", - "@cf/meta/llama-2-7b-chat-fp16", - "@cf/meta/llama-2-7b-chat-int8", - "@cf/meta-llama/llama-2-7b-chat-hf-lora", - "@hf/thebloke/llama-2-13b-chat-awq", - "@hf/thebloke/llamaguard-7b-awq", - "@cf/mistral/mistral-7b-instruct-v0.1", - "@hf/mistral/mistral-7b-instruct-v0.2", - "@cf/mistral/mistral-7b-instruct-v0.2-lora", - "@hf/thebloke/neural-chat-7b-v3-1-awq", - "@cf/openchat/openchat-3.5-0106", - "@hf/thebloke/openhermes-2.5-mistral-7b-awq", - "@cf/microsoft/phi-2", - "@cf/qwen/qwen1.5-0.5b-chat", - "@cf/qwen/qwen1.5-1.8b-chat", - "@cf/qwen/qwen1.5-7b-chat-awq", - "@cf/qwen/qwen1.5-14b-chat-awq", - "@cf/defog/sqlcoder-7b-2", - "@hf/nexusflow/starling-lm-7b-beta", - "@cf/tinyllama/tinyllama-1.1b-chat-v1.0", - "@hf/thebloke/zephyr-7b-beta-awq", - "@hf/thebloke/deepseek-coder-6.7b-base-awq" - ] - }, - { - "type": "string" - } - ] - } - } - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "openai" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "model": { - "anyOf": [ - { - "enum": [ - "gpt-3.5-turbo", - "gpt-3.5-turbo-16k", - "gpt-4o", - "gpt-4o-mini", - "gpt-4", - "gpt-3.5-turbo-0613", - "gpt-4-32k", - "gpt-4-0125-preview", - "gpt-4-turbo", - "AUTODETECT" - ] - }, - { - "type": "string" - } - ] - } - } - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "replicate" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "model": { - "anyOf": [ - { - "enum": [ - "llama3.1-8b", - "llama3.1-70b", - "llama3.1-405b", - "llama3-8b", - "llama3-70b", - "codellama-7b", - "codellama-13b", - "codellama-34b", - "llama2-7b", - "llama2-13b" - ] - }, - { - "type": "string" - } - ] - }, - "markdownDescription": "Select a pre-defined option, or find an exact model ID from Replicate [here](https://replicate.com/collections/streaming-language-models).", - "x-intellij-html-description": "Select a pre-defined option, or find an exact model ID from Replicate here." - } - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "free-trial" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "model": { - "enum": [ - "gpt-4o", - "codestral-latest", - "llama3.1-70b", - "llama3.1-405b", - "gpt-3.5-turbo", - "gemini-pro", - "claude-3-5-sonnet-20240620", - "claude-3-haiku-20240307", - "AUTODETECT" - ] - } - } - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "openai" - ] - }, - "apiType": { - "not": { - "const": "azure" - } - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "model": { - "anyOf": [ - { - "enum": [ - "gpt-3.5-turbo", - "gpt-3.5-turbo-16k", - "gpt-4o", - "gpt-4o-mini", - "gpt-4", - "gpt-3.5-turbo-0613", - "gpt-4-32k", - "gpt-4-turbo", - "gpt-4-vision-preview", - "mistral-7b", - "mistral-8x7b", - "llama2-7b", - "llama2-13b", - "codellama-7b", - "codellama-13b", - "codellama-34b", - "codellama-70b", - "llama3-8b", - "llama3-70b", - "llama3.1-8b", - "llama3.1-70b", - "llama3.1-405b", - "phind-codellama-34b", - "wizardcoder-7b", - "wizardcoder-13b", - "wizardcoder-34b", - "zephyr-7b", - "codeup-13b", - "deepseek-7b", - "deepseek-33b", - "neural-chat-7b", - "deepseek-1b", - "stable-code-3b", - "starcoder-1b", - "starcoder-3b", - "starcoder2-3b", - "mistral-tiny", - "mistral-small", - "mistral-medium", - "AUTODETECT" - ] - }, - { - "type": "string" - } - ] - } - } - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "anthropic" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "cacheBehavior": { - "title": "Caching Behavior", - "description": "Options for the prompt caching", - "properties": { - "cacheSystemMessage": { - "type": "boolean" - }, - "cacheConversation": { - "type": "boolean" - } - } - }, - "model": { - "anyOf": [ - { - "enum": [ - "claude-2", - "claude-instant-1", - "claude-3-5-sonnet-20240620", - "claude-3-opus-20240229", - "claude-3-sonnet-20240229", - "claude-3-haiku-20240307", - "claude-2.1" - ] - }, - { - "type": "string" - } - ] - } - } - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "cohere" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "model": { - "enum": [ - "command-r", - "command-r-plus" - ] - } - } - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "bedrock" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "model": { - "anyOf": [ - { - "enum": [ - "claude-3-sonnet-20240229", - "claude-3-haiku-20240307", - "claude-2" - ] - }, - { - "type": "string" - } - ] - } - } - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "sagemaker" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "model": { - "description": "SageMaker endpoint name" - } - } - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "gemini" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "cacheBehavior": { - "title": "Caching Behavior", - "description": "Options for the prompt caching", - "properties": { - "cacheSystemMessage": { - "type": "boolean" - } - } - }, - "model": { - "enum": [ - "chat-bison-001", - "gemini-pro", - "gemini-1.5-pro-latest", - "gemini-1.5-pro", - "gemini-1.5-flash-latest", - "gemini-1.5-flash" - ] - } - } - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "together" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "model": { - "anyOf": [ - { - "enum": [ - "mistral-7b", - "mistral-8x7b", - "llama2-7b", - "llama2-13b", - "llama3-8b", - "llama3-70b", - "llama3.1-8b", - "llama3.1-70b", - "llama3.1-405b", - "codellama-7b", - "codellama-13b", - "codellama-34b", - "codellama-70b", - "phind-codellama-34b" - ] - }, - { - "type": "string" - } - ], - "markdownDescription": "Select a pre-defined option, or find an exact model string from Together AI [here](https://docs.together.ai/docs/inference-models).", - "x-intellij-html-description": "Select a pre-defined option, or find an exact model string from Together AI here." - } - } - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "deepinfra" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "model": { - "markdownDescription": "Find the model name you want to use from DeepInfra [here](https://deepinfra.com/models?type=text-generation).", - "x-intellij-html-description": "Find the model name you want to use from DeepInfra here." - } - } - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "huggingface-tgi", - "huggingface-inference-api", - "llama.cpp", - "text-gen-webui", - "llamafile" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "model": { - "anyOf": [ - { - "enum": [ - "mistral-7b", - "mistral-8x7b", - "llama2-7b", - "llama2-13b", - "codellama-7b", - "codellama-13b", - "codellama-34b", - "codellama-70b", - "llama3-8b", - "llama3-70b", - "llama3.1-8b", - "llama3.1-70b", - "llama3.1-405b", - "phind-codellama-34b", - "wizardcoder-7b", - "wizardcoder-13b", - "wizardcoder-34b", - "zephyr-7b", - "codeup-13b", - "deepseek-7b", - "deepseek-33b", - "neural-chat-7b", - "deepseek-1b", - "stable-code-3b", - "starcoder-1b", - "starcoder-3b", - "starcoder2-3b" - ] - }, - { - "type": "string" - } - ] - } - } - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "ollama" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "model": { - "anyOf": [ - { - "enum": [ - "mistral-7b", - "llama2-7b", - "llama2-13b", - "codellama-7b", - "codellama-13b", - "codellama-34b", - "codellama-70b", - "llama3-8b", - "llama3-70b", - "llama3.1-8b", - "llama3.1-70b", - "llama3.1-405b", - "phi-2", - "phind-codellama-34b", - "wizardcoder-7b", - "wizardcoder-13b", - "wizardcoder-34b", - "zephyr-7b", - "codeup-13b", - "deepseek-7b", - "deepseek-33b", - "neural-chat-7b", - "deepseek-1b", - "stable-code-3b", - "starcoder-1b", - "starcoder-3b", - "starcoder2-3b", - "AUTODETECT" - ] - }, - { - "type": "string" - } - ], - "markdownDescription": "Select a pre-defined option, or find the exact model tag for an Ollama model [here](https://ollama.ai/library).", - "x-intellij-html-description": "Select a pre-defined option, or find the exact model tag for an Ollama model here." - } - } - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "mistral" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "model": { - "enum": [ - "codestral-latest", - "codestral-mamba-latest", - "open-mistral-7b", - "open-mixtral-8x7b", - "open-mixtral-8x22b", - "mistral-small-latest", - "mistral-large-latest" - ] - } - } - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "vertexai" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "required": [ - "projectId", - "region" - ] - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "deepseek" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "cacheBehavior": { - "title": "Caching Behavior", - "description": "Options for the prompt caching", - "properties": { - "cacheSystemMessage": { - "type": "boolean" - }, - "cacheConversation": { - "type": "boolean" - } - } - }, - "model": { - "enum": [ - "deepseek-chat", - "deepseek-coder" - ] - } - } - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "groq" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "model": { - "enum": [ - "llama2-70b", - "mistral-8x7b", - "gemma", - "gemma2", - "llama3-8b", - "llama3-70b", - "llama3.1-8b", - "llama3.1-70b", - "llama3.1-405b", - "AUTODETECT" - ] - } - } - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "fireworks" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "model": { - "enum": [ - "starcoder-7b" - ] - } - } - } - }, - { - "if": { - "properties": { - "apiType": { - "const": "azure" - } - }, - "required": [ - "apiType" - ] - }, - "then": { - "required": [ - "deployment", - "apiBase" - ] - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "openai" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "useLegacyCompletionsEndpoint": { - "type": "boolean" - } - } - } - }, - { - "if": { - "properties": { - "provider": { - "const": "llamafile" - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "llamafileCommand": { - "type": "string" - } - } - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "cerebras" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "model": { - "enum": [ - "llama3.1-8b", - "llama3.1-70b" - ] - } - } - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "text-gen-webui" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "streamingUrl": { - "type": "string" - } - } - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "flowise" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "timeout": { - "title": "Timeout", - "description": "Set the timeout for each request to Flowise. If you are running a local version of Flowise it might takes a while to respond, you might want to set this to avoid timeouts.", - "default": 5000, - "type": "integer" - }, - "additionalHeaders": { - "description": "A list of additional headers", - "type": "array", - "items": { - "type": "object", - "properties": { - "key": { - "title": "Key", - "description": "Header key", - "type": "string" - }, - "value": { - "title": "Value", - "description": "Header value", - "type": "string" - } - }, - "required": [ - "key", - "value" - ] - } - }, - "additionalFlowiseConfiguration": { - "description": "A list of additional properties to be sent along `overrideConfig`", - "type": "array", - "items": { - "type": "object", - "properties": { - "key": { - "title": "Key", - "description": "Configuration Property key", - "type": "string" - }, - "value": { - "title": "Value", - "description": "Configuration Property value" - } - }, - "required": [ - "key", - "value" - ] - } - }, - "model": { - "anyOf": [ - { - "enum": [ - "gpt-3.5-turbo", - "gpt-3.5-turbo-16k", - "gpt-4o", - "gpt-4o-mini", - "gpt-4", - "gpt-3.5-turbo-0613", - "gpt-4-32k", - "gpt-4-turbo", - "gpt-4-vision-preview", - "mistral-7b", - "mistral-8x7b", - "llama2-7b", - "llama2-13b", - "codellama-7b", - "codellama-13b", - "codellama-34b", - "codellama-70b", - "llama3-8b", - "llama3-70b", - "llama3.1-8b", - "llama3.1-70b", - "llama3.1-405b", - "phind-codellama-34b", - "wizardcoder-7b", - "wizardcoder-13b", - "wizardcoder-34b", - "zephyr-7b", - "codeup-13b", - "deepseek-7b", - "deepseek-33b", - "claude-2", - "claude-instant-1", - "claude-3-5-sonnet-20240620", - "claude-3-opus-20240229", - "claude-3-sonnet-20240229", - "claude-3-haiku-20240307", - "claude-2.1", - "command-r", - "command-r-plus", - "chat-bison-001", - "gemini-pro", - "gemini-1.5-pro-latest", - "gemini-1.5-pro", - "gemini-1.5-flash-latest", - "gemini-1.5-flash", - "mistral-tiny", - "mistral-small", - "mistral-medium", - "deepseek-1b", - "stable-code-3b", - "starcoder-1b", - "starcoder-3b", - "starcoder2-3b" - ] - }, - { - "type": "string" - } - ] - } - } - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "watsonx" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "apiBase": { - "type": "string" - }, - "apiKey": { - "type": "string" - }, - "apiVersion": { - "type": "string" - }, - "projectId": { - "type": "string" - }, - "deploymentId": { - "type": "string" - }, - "model": { - "enum": [ - "ibm/granite-13b-chat-v2", - "ibm/granite-3b-code-instruct", - "ibm/granite-8b-code-instruct", - "ibm/granite-20b-code-instruct", - "ibm/granite-3b-code-instruct", - "ibm/granite-8b-code-instruct", - "ibm/granite-34b-code-instruct", - "ibm/granite-3-8b-instruct", - "ibm/granite-3-2b-instruct", - "mistralai/mistral-large", - "meta-llama/llama-3-8b-instruct", - "meta-llama/llama-3-70b-instruct" - ] - } - }, - "required": [ - "apiBase", - "apiKey", - "apiVersion" - ] - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "sambanova" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "model": { - "anyOf": [ - { - "enum": [ - "llama3.1-8b", - "llama3.1-70b", - "llama3.1-405b" - ] - }, - { - "type": "string" - } - ], - "description": "Select a pre-defined option." - } - } - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "ask-sage" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "model": { - "anyOf": [ - { - "enum": [ - "gpt-4o", - "gpt-4o-mini", - "gpt-4gov", - "gpt-4ogov", - "claude-3.5-sonnet", - "claude-3-opus", - "mistral-large", - "llama-3-chat", - "gemini-pro", - "AUTODETECT" - ] - }, - { - "type": "string" - } - ] - } - } - } - } - ] - }, - "ModelRoles": { - "title": "ModelRoles", - "type": "object", - "properties": { - "default": { - "title": "Default", - "description": "The default model. If other model roles are not set, they will fall back to default.", - "type": "string" - }, - "chat": { - "title": "Chat", - "description": "The model to use for chat. If not set, will fall back to default.", - "type": "string" - }, - "edit": { - "title": "Edit", - "description": "The model to use for editing. If not set, will fall back to default.", - "type": "string" - }, - "summarize": { - "title": "Summarize", - "description": "The model to use for summarization. If not set, will fall back to default.", - "type": "string" - } - }, - "required": [ - "default" - ] - }, - "SlashCommand": { - "title": "SlashCommand", - "type": "object", - "properties": { - "name": { - "title": "Name", - "anyOf": [ - { - "enum": [ - "issue", - "share", - "cmd", - "edit", - "comment", - "http", - "commit", - "review" - ], - "type": "string", - "markdownEnumDescriptions": [ - "Generate a link to a drafted GitHub issue", - "Export the current chat session to markdown", - "Generate a terminal command and paste it into the terminal", - "Edit the highlighted code with given instructions", - "Add comments to the highlighted code", - "Write a custom slash command at your own HTTP endpoint. Set 'url' in the params object for the endpoint you have setup.", - "Generate a commit message for the current changes", - "Review code and give feedback" - ] - }, - { - "type": "string" - } - ] - }, - "description": { - "title": "Description", - "type": "string" - }, - "step": { - "title": "Step", - "description": "This property is no longer required and has no effect. To use a built-in slash command, instead set the 'name' property to one of the pre-configured options.", - "type": "string" - }, - "params": { - "title": "Params", - "default": {}, - "type": "object" - } - }, - "allOf": [ - { - "if": { - "properties": { - "name": { - "enum": [ - "issue" - ] - } - } - }, - "then": { - "properties": { - "params": { - "properties": { - "repositoryUrl": { - "type": "string", - "description": "Enter the URL of the GitHub repository for which you want to generate the issue." - } - }, - "required": [ - "repositoryUrl" - ] - } - }, - "required": [ - "params" - ] - } - }, - { - "if": { - "properties": { - "name": { - "enum": [ - "edit" - ] - } - } - }, - "then": { - "properties": { - "params": { - "properties": { - "recap": { - "type": "boolean", - "markdownDescription": "If recap is set to `true`, Continue will generate a summary of the changes after making the edit.", - "x-intellij-html-description": "If recap is set to true, Continue will generate a summary of the changes after making the edit." - }, - "tokenLimit": { - "type": "integer", - "description": "By default, Continue doesn't let you edit extremely large ranges (beyond 1,200 tokens), because the LLM is unlikely to succeed. But if you would like to override this limit with the understanding of possible failure you may do so here." - } - } - } - } - } - }, - { - "if": { - "properties": { - "name": { - "enum": [ - "share" - ] - } - } - }, - "then": { - "properties": { - "params": { - "properties": { - "outputDir": { - "type": "string", - "markdownDescription": "If outputDir is set to `.` or begins with `./` or `.\\`, file will be saved to the current workspace or a subdirectory thereof, respectively. `~` can similarly be used to specify the user's home directory.", - "x-intellij-html-description": "If outputDir is set to . or begins with ./ or .\\, file will be saved to the current workspace or a subdirectory thereof, respectively. ~ can similarly be used to specify the user's home directory." - } - } - } - } - } - }, - { - "if": { - "properties": { - "name": { - "enum": [ - "commit" - ] - } - } - }, - "then": { - "properties": { - "params": { - "properties": { - "includeUnstaged": { - "type": "boolean", - "markdownDescription": "If set to `true`, then unstaged changes are also included in the prompt, otherwise only staged changes are included. Default is `false`.", - "x-intellij-html-description": "If set to true, then unstaged changes are also included in the prompt, otherwise only staged changes are included. Default is false." - } - } - } - } - } - } - ], - "required": [ - "name", - "description" - ] - }, - "CustomCommand": { - "title": "CustomCommand", - "type": "object", - "properties": { - "name": { - "title": "Name", - "type": "string" - }, - "prompt": { - "title": "Prompt", - "type": "string" - }, - "description": { - "title": "Description", - "type": "string" - } - }, - "required": [ - "name", - "prompt", - "description" - ] - }, - "ContextProviderWithParams": { - "title": "ContextProviderWithParams", - "type": "object", - "properties": { - "name": { - "title": "Name", - "anyOf": [ - { - "enum": [ - "diff", - "terminal", - "debugger", - "open", - "google", - "search", - "http", - "codebase", - "problems", - "folder", - "issue", - "docs", - "tree", - "highlights", - "outline", - "postgres", - "code", - "currentFile", - "url", - "database", - "os", - "repo-map", - "greptile", - "web" - ], - "markdownEnumDescriptions": [ - "Reference the contents of the current changes as given by `git diff`", - "Reference the last terminal command", - "Reference the contents of the local variables in the debugger with top n level (defaulting to 3) of call stack for that thread", - "Reference the contents of all open or pinned files.", - "Enter a search phrase and include the Google search results as context", - "Reference the results of a ripgrep search in your codebase", - "Write a custom context provider at your own HTTP endpoint. Set 'url' in the params object for the endpoint you have setup.", - "Use embeddings to automatically find relevant files from throughout the codebase", - "Reference all linting errors and warnings in the currently open file", - "Include important files from a folder in the prompt, as determined by similarity search", - "Reference GitHub issues from a repository", - "Retrieve important pages from a documentation website, as determined by similarity search", - "Display a file tree of the current workspace", - "Include important highlighted sections from your code", - "Include a repo map showing important code objects", - "References Postgres table schema and sample rows", - "Reference specific functions and classes from throughout your codebase", - "Reference the contents of the currently active file", - "Reference the contents of a page at a URL", - "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", - "Search the web for sources related to your question" - ], - "type": "string" - }, - { - "type": "string" - } - ] - }, - "params": { - "title": "Params", - "default": {}, - "type": "object" - } - }, - "allOf": [ - { - "if": { - "properties": { - "name": { - "enum": [ - "discord" - ] - } - } - }, - "then": { - "allOf": [ - { - "properties": { - "params": { - "properties": { - "discordKey": { - "type": "string", - "description": "Your Discord bot token to access the Discord API. Required to fetch messages from servers." - }, - "guildId": { - "type": "string", - "description": "The ID of the guild (server) from which to fetch channels and messages." - }, - "channels": { - "type": "array", - "description": "A list of channel objects to search for messages", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of the channel" - }, - "name": { - "type": "string", - "description": "The name of the channel" - } - }, - "required": [ - "id" - ] - } - } - }, - "required": [ - "discordKey" - ] - } - } - }, - { - "oneOf": [ - { - "properties": { - "params": { - "required": [ - "guildId" - ] - } - } - }, - { - "properties": { - "params": { - "required": [ - "channels" - ] - } - } - } - ] - } - ] - } - }, - { - "if": { - "properties": { - "name": { - "enum": [ - "google" - ] - } - } - }, - "then": { - "properties": { - "params": { - "properties": { - "serperApiKey": { - "type": "string", - "description": "Your API key for https://serper.dev in order to get Google search results" - } - }, - "required": [ - "serperApiKey" - ] - } - }, - "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": { - "name": { - "enum": [ - "open" - ] - } - } - }, - "then": { - "properties": { - "params": { - "properties": { - "onlyPinned": { - "type": "boolean", - "description": "If set to true, only 'pinned' files will be included.", - "default": false - } - } - } - } - } - }, - { - "if": { - "properties": { - "name": { - "enum": [ - "issue" - ] - } - } - }, - "then": { - "properties": { - "params": { - "properties": { - "githubToken": { - "type": "string", - "description": "Your GitHub token to access the GitHub API. Required for private repositories." - }, - "repos": { - "type": "array", - "description": "A list of repositories to search for issues", - "items": { - "type": "object", - "properties": { - "owner": { - "type": "string", - "description": "The owner of the repository" - }, - "repo": { - "type": "string", - "description": "The name of the repository" - }, - "type": { - "type": "string", - "description": "The type of issues to search for", - "enum": [ - "open", - "closed", - "all" - ] - } - }, - "required": [ - "owner", - "repo" - ] - } - } - }, - "required": [ - "repos" - ] - } - }, - "required": [ - "params" - ] - } - }, - { - "if": { - "properties": { - "name": { - "enum": [ - "database" - ] - } - } - }, - "then": { - "properties": { - "params": { - "properties": { - "connections": { - "type": "array", - "description": "A list of database connections", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "A unique name for this database connection" - }, - "connection_type": { - "type": "string", - "description": "The type of database (e.g., 'postgres', 'mysql')", - "enum": [ - "postgres", - "mysql", - "sqlite" - ] - }, - "connection": { - "type": "object", - "properties": { - "user": { - "type": "string", - "description": "The database user name" - }, - "host": { - "type": "string", - "description": "The host address of the database server" - }, - "database": { - "type": "string", - "description": "The name of the database to connect to" - }, - "password": { - "type": "string", - "description": "The password for the database user" - }, - "port": { - "type": "integer", - "description": "The port number to connect to at the host" - }, - "filename": { - "type": "string", - "description": "File location for simple file DB's" - } - }, - "required": [] - } - }, - "required": [ - "name", - "connection_type", - "connection" - ] - } - } - }, - "required": [ - "connections" - ] - } - }, - "required": [ - "params" - ] - } - }, - { - "if": { - "properties": { - "name": { - "enum": [ - "gitlab-mr" - ] - } - } - }, - "then": { - "properties": { - "params": { - "properties": { - "domain": { - "type": "string", - "description": "Your GitLab domain, will default to gitlab.com" - }, - "token": { - "type": "string", - "description": "Your private access token." - }, - "filterComments": { - "type": "boolean", - "description": "If you have code selected, filters out comments that aren't related to the selection." - } - }, - "required": [ - "token" - ] - } - }, - "required": [ - "params" - ] - } - }, - { - "if": { - "properties": { - "name": { - "enum": [ - "jira" - ] - } - } - }, - "then": { - "properties": { - "params": { - "properties": { - "domain": { - "type": "string", - "description": "Your Jira domain, for example company.atlassian.net." - }, - "email": { - "type": "string", - "description": "The email that you log into Jira with" - }, - "token": { - "type": "string", - "description": "Your atlassian API token from https://id.atlassian.com/manage-profile/security/api-tokens" - }, - "issueQuery": { - "type": "string", - "description": "Customize the query used to find Jira issues" - }, - "apiVersion": { - "type": "integer", - "markdownDescription": "This context provider supports both Jira API version 2 and 3. It will use version 3 by default since that's what the cloud version uses, but if you have the datacenter version of Jira, you'll need to set the API Version to 2 using the `apiVersion` property.", - "x-intellij-html-description": "This context provider supports both Jira API version 2 and 3. It will use version 3 by default since that's what the cloud version uses, but if you have the datacenter version of Jira, you'll need to set the API Version to 2 using the apiVersion property." - }, - "requestOptions": { - "title": "Request Options", - "description": "Options for the HTTPS request to Jira.", - "default": { - "timeout": 7200, - "verifySsl": null, - "caBundlePath": null, - "proxy": null, - "headers": null, - "extraBodyProperties": null - }, - "allOf": [ - { - "$ref": "#/definitions/RequestOptions" - } - ] - } - }, - "required": [ - "domain", - "token" - ] - } - }, - "required": [ - "params" - ] - } - }, - { - "if": { - "properties": { - "name": { - "enum": [ - "http" - ] - } - } - }, - "then": { - "properties": { - "params": { - "properties": { - "url": { - "type": "string", - "description": "The HTTP endpoint of your context provider server." - }, - "options": { - "title": "Custom Options", - "description": "Additional options to pass to your custom HTTP server.", - "type": "object" - } - }, - "required": [ - "url" - ] - } - }, - "required": [ - "params" - ] - } - }, - { - "if": { - "properties": { - "name": { - "enum": [ - "codebase", - "folder" - ] - } - } - }, - "then": { - "properties": { - "params": { - "properties": { - "nRetrieve": { - "title": "N Retrieve", - "description": "Number of results to initially retrieve from vector database", - "default": 50, - "type": "integer" - }, - "nFinal": { - "title": "N Final", - "description": "Final number of results to use after re-ranking", - "default": 10, - "type": "integer" - }, - "useReranking": { - "title": "Use Reranking", - "description": "Whether to use re-ranking, which will allow initial selection of nRetrieve results, then will use an LLM to select the top nFinal results. Disabling re-ranking will give faster, but less accurate, results.", - "default": true, - "type": "boolean" - } - } - } - } - } - }, - { - "if": { - "properties": { - "name": { - "enum": [ - "postgres" - ] - } - } - }, - "then": { - "properties": { - "params": { - "properties": { - "host": { - "title": "Host", - "description": "Database host", - "default": "localhost", - "type": "string" - }, - "port": { - "title": "Port", - "description": "Database port", - "default": 5432, - "type": "integer" - }, - "user": { - "title": "User", - "description": "Database user", - "default": "postgres", - "type": "string" - }, - "password": { - "title": "Password", - "description": "Database password", - "type": "string" - }, - "database": { - "title": "Database", - "description": "Database name", - "default": "postgres", - "type": "string" - }, - "schema": { - "title": "Schema", - "description": "Database schema", - "default": "public", - "type": "string" - }, - "sampleRows": { - "title": "Sample Rows", - "description": "Number of rows to sample from the database", - "default": 3, - "type": "integer" - } - } - } - }, - "required": [ - "host", - "port", - "user", - "password", - "database" - ] - } - }, - { - "if": { - "properties": { - "name": { - "enum": [ - "greptile" - ] - } - } - }, - "then": { - "properties": { - "params": { - "properties": { - "GithubToken": { - "title": "GithubToken", - "description": "Your github access token", - "default": "", - "type": "string" - }, - "GreptileToken": { - "title": "GreptileToken", - "description": "Your greptile access token", - "default": "", - "type": "string" - } - } - } - }, - "required": [ - "GreptileToken", - "GithubToken" - ] - } - } - ], - "required": [ - "name" - ] - }, - "SerializedContinueConfig": { - "title": "config.json", - "type": "object", - "properties": { - "docs": { - "title": "Docs", - "description": "A list of documentation sites to be indexed", - "type": "array", - "items": { - "type": "object", - "properties": { - "title": { - "type": "string", - "description": "The title of the documentation site" - }, - "startUrl": { - "type": "string", - "description": "The starting URL for indexing the documentation" - }, - "rootUrl": { - "type": "string", - "description": "The root URL of the documentation site" - }, - "maxDepth": { - "type": "integer", - "description": "The maximum depth to crawl the documentation site" - }, - "favicon": { - "type": "string", - "description": "The URL path to a favicon for the site - by default, it will be `/favicon.ico` path from the Start URL" - } - }, - "required": [ - "title", - "startUrl" - ] - } - }, - "allowAnonymousTelemetry": { - "title": "Allow Anonymous Telemetry", - "markdownDescription": "If this field is set to `true`, we will collect anonymous telemetry as described in the documentation page on telemetry. If set to `false`, we will not collect any data. Learn more in [the docs](https://docs.continue.dev/telemetry).", - "x-intellij-html-description": "If this field is set to `true`, we will collect anonymous telemetry as described in the documentation page on telemetry. If set to `false`, we will not collect any data. Learn more in the docs.", - "default": true, - "type": "boolean" - }, - "models": { - "title": "Models", - "markdownDescription": "Learn about setting up models in [the documentation](https://docs.continue.dev/model-setup/overview).", - "x-intellij-html-description": "Learn about setting up models in the documentation.", - "default": [ - { - "title": "GPT-4 (trial)", - "provider": "free-trial", - "model": "gpt-4", - "apiKey": "" - } - ], - "type": "array", - "items": { - "$ref": "#/definitions/ModelDescription" - } - }, - "systemMessage": { - "title": "System Message", - "description": "A system message that will always be followed by the LLM", - "type": "string" - }, - "completionOptions": { - "title": "Completion Options", - "description": "Default options for completion. These will be overriden by any options set for a specific model.", - "default": { - "temperature": null, - "topP": null, - "topK": null, - "presencePenalty": null, - "frequencyPenalty": null, - "stop": null, - "maxTokens": 600 - }, - "allOf": [ - { - "$ref": "#/definitions/BaseCompletionOptions" - } - ] - }, - "requestOptions": { - "title": "Request Options", - "description": "Default request options for all fetch requests from models and context providers. These will be overriden by any model-specific request options.", - "allOf": [ - { - "$ref": "#/definitions/RequestOptions" - } - ] - }, - "slashCommands": { - "title": "Slash Commands", - "markdownDescription": "An array of slash commands that let you take custom actions from the sidebar. Learn more in the [documentation](https://docs.continue.dev/customization/slash-commands).", - "x-intellij-html-description": "An array of slash commands that let you take custom actions from the sidebar. Learn more in the documentation.", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/SlashCommand" - } - }, - "customCommands": { - "title": "Custom Commands", - "markdownDescription": "An array of custom commands that allow you to reuse prompts. Each has name, description, and prompt properties. When you enter `/` in the text input, it will act as a shortcut to the prompt. Learn more in the [documentation](https://docs.continue.dev/customization/slash-commands#custom-commands-use-natural-language).", - "x-intellij-html-description": "An array of custom commands that allow you to reuse prompts. Each has name, description, and prompt properties. When you enter / in the text input, it will act as a shortcut to the prompt. Learn more in the documentation.", - "default": [ - { - "name": "test", - "prompt": "{{{ input }}}\n\nWrite a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.", - "description": "This is an example custom command. Open config.json to edit it and create more" - } - ], - "type": "array", - "items": { - "$ref": "#/definitions/CustomCommand" - } - }, - "contextProviders": { - "title": "Context Providers", - "markdownDescription": "A list of ContextProvider objects that can be used to provide context to the LLM by typing '@'. Read more about ContextProviders in [the documentation](https://docs.continue.dev/customization/context-providers).", - "x-intellij-html-description": "A list of ContextProvider objects that can be used to provide context to the LLM by typing '@'. Read more about ContextProviders in the documentation.", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/ContextProviderWithParams" - } - }, - "userToken": { - "title": "User Token", - "description": "An optional token to identify the user.", - "type": "string" - }, - "disableIndexing": { - "title": "Disable Indexing", - "markdownDescription": "If set to `true`, Continue will not index the codebase. This is mainly used for debugging purposes.", - "x-intellij-html-description": "If set to true, Continue will not index the codebase. This is mainly used for debugging purposes.", - "default": false, - "type": "boolean" - }, - "disableSessionTitles": { - "title": "Disable Session Titles", - "markdownDescription": "If set to `true`, Continue will not make extra requests to the LLM to generate a summary title of each session.", - "x-intellij-html-description": "If set to true, Continue will not make extra requests to the LLM to generate a summary title of each session.", - "default": false, - "type": "boolean" - }, - "embeddingsProvider": { - "title": "Embeddings Provider", - "markdownDescription": "The method that will be used to generate codebase embeddings. The default is `transformers.js`, which will run locally in the browser. Learn about the other options [here](https://docs.continue.dev/features/codebase-embeddings#embeddings-providers).", - "x-intellij-html-description": "The method that will be used to generate codebase embeddings. The default is transformers.js, which will run locally in the browser. Learn about the other options here.

Note: transformers.js currently cannot be used in JetBrains.", - "type": "object", - "properties": { - "provider": { - "enum": [ - "huggingface-tei", - "transformers.js", - "ollama", - "openai", - "cohere", - "free-trial", - "gemini", - "voyage", - "nvidia", - "bedrock", - "sagemaker", - "nebius", - "vertexai" - ] - }, - "model": { - "type": "string" - }, - "apiKey": { - "type": "string" - }, - "apiBase": { - "type": "string" - }, - "requestOptions": { - "title": "Request Options", - "description": "Request options to be used in any fetch requests made by the embeddings provider", - "$ref": "#/definitions/RequestOptions" - }, - "maxChunkSize": { - "title": "Maximum Chunk Size", - "description": "The maximum number of tokens that each chunk of a document is allowed to have", - "type": "integer", - "minimum": 128, - "exclusiveMaximum": 2147483647 - }, - "maxBatchSize": { - "title": "Maximum Batch Size", - "description": "The maximum number of chunks that can be sent to the embeddings provider in a single request", - "type": "integer", - "minimum": 1, - "exclusiveMaximum": 2147483647 - }, - "region": { - "title": "Region", - "description": "The region where the model is hosted", - "$ref": "#/definitions/ModelDescription/properties/region" - }, - "profile": { - "title": "Profile", - "description": "The AWS security profile to use", - "type": "string" - } - }, - "required": [ - "provider" - ], - "allOf": [ - { - "if": { - "properties": { - "provider": { - "enum": [ - "cohere", - "voyage", - "nvidia", - "gemini" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "required": [ - "apiKey" - ] - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "sagemaker" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "model": { - "description": "SageMaker endpoint name" - } - }, - "required": [ - "model" - ] - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "vertexai" - ] - } - }, - "required": [ - "provider" - ] - }, - "then": { - "properties": { - "projectId": { - "description": "The name of your VertexAI project" - }, - "region": { - "description": "The region your VertexAI model is hosted in - typically central1", - "default": "central1" - }, - "model": { - "default": "text-embedding-004" - } - }, - "required": [ - "projectId", - "model", - "region" - ] - } - } - ] - }, - "reranker": { - "title": "Reranker", - "description": "The reranker is responsible for selecting the final results when retrieving snippets from your codebase.", - "type": "object", - "properties": { - "name": { - "enum": [ - "cohere", - "voyage", - "llm", - "free-trial", - "huggingface-tei" - ] - }, - "params": { - "type": "object" - } - }, - "required": [ - "name" - ], - "allOf": [ - { - "if": { - "properties": { - "name": { - "enum": [ - "cohere" - ] - } - }, - "required": [ - "name" - ] - }, - "then": { - "properties": { - "params": { - "type": "object", - "properties": { - "model": { - "enum": [ - "rerank-english-v3.0", - "rerank-multilingual-v3.0", - "rerank-english-v2.0", - "rerank-multilingual-v2.0" - ] - }, - "apiBase": { - "type": "string" - }, - "apiKey": { - "type": "string" - } - }, - "required": [ - "apiKey" - ] - } - } - } - }, - { - "if": { - "properties": { - "name": { - "enum": [ - "llm" - ] - } - }, - "required": [ - "name" - ] - }, - "then": { - "properties": { - "params": { - "type": "object", - "properties": { - "modelTitle": { - "type": "string" - } - }, - "required": [ - "modelTitle" - ] - } - } - } - }, - { - "if": { - "properties": { - "name": { - "enum": [ - "voyage" - ] - } - }, - "required": [ - "name" - ] - }, - "then": { - "properties": { - "params": { - "type": "object", - "properties": { - "apiKey": { - "type": "string" - }, - "model": { - "enum": [ - "rerank-lite-1", - "rerank-1", - "rerank-2", - "rerank-2-lite" - ] - } - }, - "required": [ - "apiKey" - ] - } - } - } - }, - { - "if": { - "properties": { - "name": { - "enum": [ - "huggingface-tei" - ] - } - }, - "required": [ - "name" - ] - }, - "then": { - "properties": { - "params": { - "type": "object", - "properties": { - "apiBase": { - "type": "string", - "default": "http://localhost:8080" - }, - "truncate": { - "type": "boolean", - "description": "Whether to truncate long sequences to the maximum allowed context length.", - "default": false - }, - "truncation_direction": { - "enum": [ - "Right", - "Left" - ], - "description": "Whether to truncate sequences from the left or right.", - "default": "Right" - } - }, - "required": [ - "apiBase" - ] - } - }, - "if": { - "properties": { - "truncate": { - "const": true - } - } - }, - "then": { - "required": [ - "truncation_direction" - ] - } - } - } - ] - }, - "tabAutocompleteModel": { - "title": "Tab Autocomplete Model", - "markdownDescription": "The model used for tab autocompletion. If undefined, Continue will default to using starcoder2:3b on a local Ollama instance.\n\n*IMPORTANT*:\n\nIf you use a custom model, ensure that it is one trained for fill-in-the-middle completions. An instruct model is typically not well-suited to autocomplete and you may receive unsatisfactory completions.", - "x-intellij-html-description": "The model used for tab autocompletion. If undefined, Continue will default to using starcoder2:3b on a local Ollama instance.

IMPORTANT:

If you use a custom model, ensure that it is one trained for fill-in-the-middle completions. An instruct model is typically not well-suited to autocomplete and you may receive unsatisfactory completions.", - "default": { - "title": "Tab Autocomplete Model", - "provider": "ollama", - "model": "deepseek-coder:1.3b-base" - }, - "oneOf": [ - { - "$ref": "#/definitions/ModelDescription" - }, - { - "type": "array", - "items": { - "$ref": "#/definitions/ModelDescription" - } - } - ] - }, - "tabAutocompleteOptions": { - "title": "TabAutocompleteOptions", - "type": "object", - "markdownDescription": "These options let you customize your tab-autocomplete experience. Read about all options in [the docs](https://docs.continue.dev/features/tab-autocomplete#configuration-options).", - "x-intellij-html-description": "These options let you customize your tab-autocomplete experience. Read about all options in the docs.", - "properties": { - "disable": { - "type": "boolean", - "description": "Disable tab autocomplete. This can also be done from the IDE settings.", - "default": false - }, - "useCopyBuffer": { - "type": "boolean", - "description": "Determines whether the copy buffer will be considered when contructing the prompt." - }, - "useFileSuffix": { - "type": "boolean", - "description": "Determines whether to use the file suffix in the prompt." - }, - "maxPromptTokens": { - "type": "number", - "description": "The maximum number of prompt tokens to use. A smaller number will yield faster completions, but less context." - }, - "debounceDelay": { - "type": "number", - "description": "The delay in milliseconds before triggering autocomplete after a keystroke." - }, - "maxSuffixPercentage": { - "type": "number", - "description": "The maximum percentage of the prompt that can be dedicated to the suffix." - }, - "prefixPercentage": { - "type": "number", - "description": "The percentage of the input that should be dedicated to the prefix." - }, - "transform": { - "type": "boolean", - "description": "Whether LLM output should be transformed to correct common model pitfalls." - }, - "template": { - "type": "string", - "description": "An optional template string to be used for autocomplete. It will be rendered with the Mustache templating language, and is passed the 'prefix' and 'suffix' variables." - }, - "multilineCompletions": { - "enum": [ - "always", - "never", - "auto" - ], - "description": "If set to true, Continue will only complete a single line at a time." - }, - "useCache": { - "type": "boolean", - "description": "Whether to cache completions" - }, - "onlyMyCode": { - "type": "boolean", - "description": "If set to true, Continue will not include any snippets from go to definition unless they are within your repository" - }, - "useOtherFiles": { - "type": "boolean", - "description": "Defaults to true. If set to false, Continue will not attempt to include snippets from other files." - }, - "disableInFiles": { - "description": "A list of files / glob patterns in which to disable tab autocomplete. For example, *.csv if you'd like to disable autocomplete in .csv files.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [] - }, - "ui": { - "type": "object", - "properties": { - "codeBlockToolbarPosition": { - "enum": [ - "top", - "bottom" - ], - "default": "top", - "description": "Whether to show the copy and apply code buttons at the top or bottom of code blocks in the sidebar." - }, - "fontSize": { - "type": "number" - }, - "displayRawMarkdown": { - "type": "boolean", - "description": "If set to true, we will display the model output as raw markdown.", - "default": false - }, - "showChatScrollbar": { - "title": "Show Chat Scrollbar", - "markdownDescription": "If set to `true`, a scrollbar will be displayed in the chat window to navigate through messages.", - "x-intellij-html-description": "If set to true, a scrollbar will be displayed in the chat window to navigate through messages.", - "default": false, - "type": "boolean" - } - } - }, - "analytics": { - "type": "object", - "properties": { - "provider": { - "type": "string", - "enum": [ - "posthog", - "logstash" - ], - "description": "The 3rd party analytics provider to use.", - "default": "posthog", - "markdownEnumDescriptions": [ - "### Posthog\nTo use Posthog, set up an account, obtain your client key, and enter it in the client key field." - ] - }, - "url": { - "type": "string", - "description": "The URL to which analytics will be sent" - }, - "clientKey": { - "type": "string", - "description": "The client key to use for analytics" - } - }, - "required": [ - "provider" - ], - "allOf": [ - { - "if": { - "properties": { - "provider": { - "enum": [ - "posthog" - ] - } - } - }, - "then": { - "required": [ - "clientKey" - ] - } - }, - { - "if": { - "properties": { - "provider": { - "enum": [ - "logstash" - ] - } - } - }, - "then": { - "required": [ - "url" - ] - } - } - ] - }, - "experimental": { - "type": "object", - "title": "Experimental", - "description": "Experimental properties are subject to change.", - "properties": { - "defaultContext": { - "type": "array", - "items": { - "allOf": [ - { - "$ref": "#/definitions/ContextProviderWithParams" - }, - { - "properties": { - "query": { - "type": "string", - "description": "Required for certain context providers, like 'url' in order to specify the input, or which of the dropdown items to select." - } - } - } - ] - } - }, - "modelRoles": { - "type": "object", - "properties": { - "inlineEdit": { - "description": "The 'title' property of the model you wish to use for inline edits", - "type": "string" - }, - "applyCodeBlock": { - "description": "The 'title' property of the model you wish to use for applying code blocks", - "type": "string" - }, - "repoMapFileSelection": { - "description": "The 'title' property of the model you wish to use for repo map file selections", - "type": "string" - } - } - }, - "readResponseTTS": { - "type": "boolean", - "default": true, - "description": "Automatically read LLM chat responses aloud using system TTS models" - }, - "promptPath": { - "type": "string" - }, - "quickActions": { - "type": "array", - "items": { - "type": "object", - "properties": { - "title": { - "type": "string", - "description": "The title of the quick action that will display in the Code Lens." - }, - "prompt": { - "type": "string", - "description": "The prompt that will be sent to the model when the quick action is invoked, with the function or class body concatenated." - }, - "sendToChat": { - "type": "boolean", - "description": "If true, the result of the quick action will be sent to the chat panel. If false, the streamed result will be inserted into the document.", - "default": false - } - }, - "required": [ - "prompt", - "title" - ] - }, - "description": "Quick actions are a way to add custom commands to the Code Lens of function and class declarations." - }, - "contextMenuPrompts": { - "type": "object", - "properties": { - "comment": { - "type": "string", - "default": "Write comments for this code. Do not change anything about the code itself." - }, - "docstring": { - "type": "string", - "default": "Write a docstring for this code. Do not change anything about the code itself." - }, - "fix": { - "type": "string", - "default": "Fix this code" - }, - "optimize": { - "type": "string", - "default": "Optimize this code" - }, - "fixGrammar": { - "type": "string", - "default": "If there are any grammar or spelling mistakes in this writing, fix them. Do not make other large changes to the writing." - } - } - } - } - }, - "mergeBehavior": { - "type": "string", - "enum": [ - "merge", - "overwrite" - ], - "default": "merge", - "title": "Merge behavior", - "markdownDescription": "If set to 'merge', .continuerc.json will be applied on top of config.json (arrays and objects are merged). If set to 'overwrite', then every top-level property of .continuerc.json will overwrite that property from config.json." - } - } - } - } -} \ No newline at end of file diff --git a/extensions/intellij/src/main/resources/icons/continue.svg b/extensions/intellij/src/main/resources/icons/continue.svg deleted file mode 100644 index ab3f4d8bb..000000000 --- a/extensions/intellij/src/main/resources/icons/continue.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/extensions/vscode/.continuerc.json b/extensions/vscode/.continuerc.json deleted file mode 100644 index 2533f4d69..000000000 --- a/extensions/vscode/.continuerc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "customCommands": [] -} diff --git a/extensions/vscode/.gitignore b/extensions/vscode/.gitignore index af05aed4d..e0a5e65fc 100644 --- a/extensions/vscode/.gitignore +++ b/extensions/vscode/.gitignore @@ -10,7 +10,7 @@ exe bin assets -gui/* +gui/** !gui/onigasm.wasm .devcontainer diff --git a/extensions/vscode/.prompts/review.prompt b/extensions/vscode/.prompts/review.prompt deleted file mode 100644 index 85bbcad6e..000000000 --- a/extensions/vscode/.prompts/review.prompt +++ /dev/null @@ -1,28 +0,0 @@ -temperature: 0.0 ---- -{{{ diff }}} - -Give me feedback on the above changes. For each file, you should output a markdown section including the following: -- If you found any problems, an h3 like "❌ " -- If you didn't find any problems, an h3 like "✅ " -- If you found any problems, add below a bullet point description of what you found, including a minimal code snippet explaining how to fix it -- If you didn't find any problems, you don't need to add anything else - -Here is an example. The example is surrounded in backticks, but your response should not be: - -``` -### ✅ - -### ❌ - - -``` - -You should look primarily for the following types of issues, and only mention other problems if they are highly pressing. - -- console.logs that have been left after debugging -- repeated code -- algorithmic errors that could fail under edge cases -- something that could be refactored - -Make sure to review ALL files that were changed, do not skip any. \ No newline at end of file diff --git a/extensions/vscode/.prompts/test.prompt b/extensions/vscode/.prompts/test.prompt deleted file mode 100644 index 369fe07dc..000000000 --- a/extensions/vscode/.prompts/test.prompt +++ /dev/null @@ -1,17 +0,0 @@ -temperature: 0.5 -maxTokens: 4096 ---- - -You are an expert programmer - - -{{{ input }}} - -Write unit tests for the above selected code, following each of these instructions: -- Use `jest` -- Properly set up and tear down -- Include important edge cases -- The tests should be complete and sophisticated -- Give the tests just as chat output, don't edit any file -- Don't explain how to set up `jest` -- Write a single code block, making sure to label with the language being used (e.g. "```typscript") \ No newline at end of file diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index f69ce7e5c..f18bdbb6a 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -201,7 +201,8 @@ "cerebras", "askSage", "nebius", - "vertexai" + "vertexai", + "xAI" ], "markdownEnumDescriptions": [ "### OpenAI\nUse gpt-4, gpt-3.5-turbo, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.\n\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/openai)", @@ -236,7 +237,8 @@ "### NVIDIA NIMs\nNVIDIA offers a single API to access almost any language model. To find out more, visit the [LLM APIs Documentation](https://docs.api.nvidia.com/nim/reference/llm-apis).\nFor information specific to getting a key, please check out the [docs here](https://docs.nvidia.com/nim/large-language-models/latest/getting-started.html#option-1-from-api-catalog)", "### vLLM\nvLLM is a highly performant way of hosting LLMs for a team. To get started, follow their [quickstart](https://docs.vllm.ai/en/latest/getting_started/quickstart.html) to set up your server.", "### Cerebras\nCerebras Inference uses specialized silicon to provides superfast inference. To get started, get your API keys from [their console](https://cloud.cerebras.ai/).", - "### Ask Sage\nAsk Sage is an agnostic hosted service that provides language models. To get started with Ask Sage:\n1. Obtain an API key from your account. For more information, visit [Ask Sage](https://docs.asksage.ai/).\n2. Paste the API key below.\n3. Select a model preset.\n> [Reference](https://docs.asksage.ai/)" + "### Ask Sage\nAsk Sage is an agnostic hosted service that provides language models. To get started with Ask Sage:\n1. Obtain an API key from your account. For more information, visit [Ask Sage](https://docs.asksage.ai/).\n2. Paste the API key below.\n3. Select a model preset.\n> [Reference](https://docs.asksage.ai/)", + "### xAI offers a world class developer tool set to build scalable applications powered by Grok. To get started, obtain an API key from [the x Console](https://console.x.ai/), and see the [docs](https://docs.x.ai/docs/)" ], "type": "string" }, @@ -471,7 +473,8 @@ "together", "cloudflare", "sambanova", - "nebius" + "nebius", + "xAI" ] } }, @@ -655,6 +658,37 @@ } } }, + { + "if": { + "properties": { + "provider": { + "enum": [ + "xAI" + ] + } + }, + "required": [ + "provider" + ] + }, + "then": { + "properties": { + "model": { + "anyOf": [ + { + "enum": [ + "grok-beta", + "AUTODETECT" + ] + }, + { + "type": "string" + } + ] + } + } + } + }, { "if": { "properties": { @@ -719,7 +753,7 @@ "llama3.1-405b", "gpt-3.5-turbo", "gemini-pro", - "claude-3-5-sonnet-20240620", + "claude-3-5-sonnet-latest", "claude-3-haiku-20240307", "AUTODETECT" ] @@ -834,7 +868,7 @@ "enum": [ "claude-2", "claude-instant-1", - "claude-3-5-sonnet-20240620", + "claude-3-5-sonnet-latest", "claude-3-opus-20240229", "claude-3-sonnet-20240229", "claude-3-haiku-20240307", @@ -1301,7 +1335,10 @@ ] }, "then": { - "required": ["deployment", "apiBase"] + "required": [ + "deployment", + "apiBase" + ] } }, { @@ -1491,6 +1528,7 @@ "deepseek-33b", "claude-2", "claude-instant-1", + "claude-3-5-sonnet-latest", "claude-3-5-sonnet-20240620", "claude-3-opus-20240229", "claude-3-sonnet-20240229", @@ -2962,6 +3000,9 @@ "type": "string", "default": "http://localhost:8080" }, + "apiKey": { + "type": "string" + }, "truncate": { "type": "boolean", "description": "Whether to truncate long sequences to the maximum allowed context length.", @@ -3279,6 +3320,11 @@ "default": "If there are any grammar or spelling mistakes in this writing, fix them. Do not make other large changes to the writing." } } + }, + "useChromiumForDocsCrawling": { + "type": "boolean", + "description": "Use Chromium to crawl docs locally. Useful if the default Cheerio crawler fails on sites that require JavaScript rendering. Downloads and installs Chromium to `~/.continue/.utils`.", + "default": false } } } diff --git a/extensions/vscode/gui/continue-dev-square.png b/extensions/vscode/gui/continue-dev-square.png deleted file mode 100644 index e4b625568..000000000 Binary files a/extensions/vscode/gui/continue-dev-square.png and /dev/null differ diff --git a/extensions/vscode/gui/continue.gif b/extensions/vscode/gui/continue.gif deleted file mode 100644 index daed66637..000000000 Binary files a/extensions/vscode/gui/continue.gif and /dev/null differ diff --git a/extensions/vscode/gui/index.html b/extensions/vscode/gui/index.html deleted file mode 100644 index c8053de74..000000000 --- a/extensions/vscode/gui/index.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - Continue - - - - -
- - - diff --git a/extensions/vscode/gui/logos/anthropic.png b/extensions/vscode/gui/logos/anthropic.png deleted file mode 100644 index 9adf1b71b..000000000 Binary files a/extensions/vscode/gui/logos/anthropic.png and /dev/null differ diff --git a/extensions/vscode/gui/logos/google-palm.png b/extensions/vscode/gui/logos/google-palm.png deleted file mode 100644 index 0f9dc3451..000000000 Binary files a/extensions/vscode/gui/logos/google-palm.png and /dev/null differ diff --git a/extensions/vscode/gui/logos/hf.png b/extensions/vscode/gui/logos/hf.png deleted file mode 100644 index 49e2841dd..000000000 Binary files a/extensions/vscode/gui/logos/hf.png and /dev/null differ diff --git a/extensions/vscode/gui/logos/llamacpp.png b/extensions/vscode/gui/logos/llamacpp.png deleted file mode 100644 index 119087b0e..000000000 Binary files a/extensions/vscode/gui/logos/llamacpp.png and /dev/null differ diff --git a/extensions/vscode/gui/logos/lmstudio.png b/extensions/vscode/gui/logos/lmstudio.png deleted file mode 100644 index b2b73591f..000000000 Binary files a/extensions/vscode/gui/logos/lmstudio.png and /dev/null differ diff --git a/extensions/vscode/gui/logos/meta.png b/extensions/vscode/gui/logos/meta.png deleted file mode 100644 index 84a15698e..000000000 Binary files a/extensions/vscode/gui/logos/meta.png and /dev/null differ diff --git a/extensions/vscode/gui/logos/mistral.png b/extensions/vscode/gui/logos/mistral.png deleted file mode 100644 index 0f535f84e..000000000 Binary files a/extensions/vscode/gui/logos/mistral.png and /dev/null differ diff --git a/extensions/vscode/gui/logos/ollama.png b/extensions/vscode/gui/logos/ollama.png deleted file mode 100644 index 56ef23f4a..000000000 Binary files a/extensions/vscode/gui/logos/ollama.png and /dev/null differ diff --git a/extensions/vscode/gui/logos/openai.png b/extensions/vscode/gui/logos/openai.png deleted file mode 100644 index e24b90113..000000000 Binary files a/extensions/vscode/gui/logos/openai.png and /dev/null differ diff --git a/extensions/vscode/gui/logos/replicate.png b/extensions/vscode/gui/logos/replicate.png deleted file mode 100644 index f71504f59..000000000 Binary files a/extensions/vscode/gui/logos/replicate.png and /dev/null differ diff --git a/extensions/vscode/gui/logos/together.png b/extensions/vscode/gui/logos/together.png deleted file mode 100644 index e989afdde..000000000 Binary files a/extensions/vscode/gui/logos/together.png and /dev/null differ diff --git a/extensions/vscode/gui/logos/wizardlm.png b/extensions/vscode/gui/logos/wizardlm.png deleted file mode 100644 index a420cf038..000000000 Binary files a/extensions/vscode/gui/logos/wizardlm.png and /dev/null differ diff --git a/extensions/vscode/gui/play_button.png b/extensions/vscode/gui/play_button.png deleted file mode 100644 index af3793758..000000000 Binary files a/extensions/vscode/gui/play_button.png and /dev/null differ diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index cc2a41fb6..c38d47b0d 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -2,7 +2,7 @@ "name": "continue", "icon": "media/icon.png", "author": "Continue Dev, Inc", - "version": "0.9.225", + "version": "0.9.226", "repository": { "type": "git", "url": "https://github.com/continuedev/continue" diff --git a/extensions/vscode/scripts/esbuild.js b/extensions/vscode/scripts/esbuild.js index f3d2c09db..7e367bfaa 100644 --- a/extensions/vscode/scripts/esbuild.js +++ b/extensions/vscode/scripts/esbuild.js @@ -30,4 +30,5 @@ const esbuildConfig = { } else { await esbuild.build(esbuildConfig); } -})(); + console.log("VS Code Extension esbuild complete"); // Used in task endpattern to signal completion +})(); \ No newline at end of file diff --git a/extensions/vscode/scripts/utils.js b/extensions/vscode/scripts/utils.js index fc4e1e020..7d62fefa4 100644 --- a/extensions/vscode/scripts/utils.js +++ b/extensions/vscode/scripts/utils.js @@ -18,8 +18,8 @@ function copyConfigSchema() { enum: ["merge", "overwrite"], default: "merge", title: "Merge behavior", - markdownDescription: - "If set to 'merge', .continuerc.json will be applied on top of config.json (arrays and objects are merged). If set to 'overwrite', then every top-level property of .continuerc.json will overwrite that property from config.json.", + markdownDescription: "If set to 'merge', .continuerc.json will be applied on top of config.json (arrays and objects are merged). If set to 'overwrite', then every top-level property of .continuerc.json will overwrite that property from config.json.", + "x-intellij-html-description": "

If set to merge, .continuerc.json will be applied on top of config.json (arrays and objects are merged). If set to overwrite, then every top-level property of .continuerc.json will overwrite that property from config.json.

" }; fs.writeFileSync("continue_rc_schema.json", JSON.stringify(schema, null, 2)); diff --git a/gui/package-lock.json b/gui/package-lock.json index ef9f8cda9..b0be81c6c 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -37,7 +37,7 @@ "react-dom": "^18.2.0", "react-error-boundary": "^4.0.11", "react-hook-form": "^7.47.0", - "react-intersection-observer": "^9.10.3", + "react-intersection-observer": "^9.13.1", "react-markdown": "^9.0.1", "react-redux": "^8.0.5", "react-remark": "^2.1.0", diff --git a/gui/package.json b/gui/package.json index dae097902..ef77ac910 100644 --- a/gui/package.json +++ b/gui/package.json @@ -45,7 +45,7 @@ "react-dom": "^18.2.0", "react-error-boundary": "^4.0.11", "react-hook-form": "^7.47.0", - "react-intersection-observer": "^9.10.3", + "react-intersection-observer": "^9.13.1", "react-markdown": "^9.0.1", "react-redux": "^8.0.5", "react-remark": "^2.1.0", diff --git a/gui/public/logos/xAI.png b/gui/public/logos/xAI.png new file mode 100644 index 000000000..95bdec71a Binary files /dev/null and b/gui/public/logos/xAI.png differ diff --git a/gui/src/components/gui/StepContainer.tsx b/gui/src/components/gui/StepContainer.tsx index 94652bc7d..c90d6c9c7 100644 --- a/gui/src/components/gui/StepContainer.tsx +++ b/gui/src/components/gui/StepContainer.tsx @@ -1,5 +1,4 @@ import { - ArrowPathIcon, BarsArrowDownIcon, HandThumbDownIcon, HandThumbUpIcon, @@ -14,7 +13,7 @@ import { vscBackground, vscInputBackground } from ".."; import { IdeMessengerContext } from "../../context/IdeMessenger"; import useUIConfig from "../../hooks/useUIConfig"; import { RootState } from "../../redux/store"; -import { getFontSize } from "../../util"; +import { getFontSize, getMetaKeyLabel } from "../../util"; import ButtonWithTooltip from "../ButtonWithTooltip"; import { CopyButton } from "../markdown/CopyButton"; import StyledMarkdownPreview from "../markdown/StyledMarkdownPreview"; @@ -50,7 +49,7 @@ function StepContainer(props: StepContainerProps) { const isUserInput = props.item.message.role === "user"; const uiConfig = useUIConfig(); - const shouldRenderActions = !props.isLast || (props.isLast && !active); + const shouldRenderActions = !active || !props.isLast; useEffect(() => { if (!active) { @@ -84,7 +83,11 @@ function StepContainer(props: StepContainerProps) { }; return ( -
+
- - {shouldRenderActions && ( -
- {truncatedEarly && ( - - - - )} - - {props.index !== 1 && ( - - - - )} - - - +
+ {truncatedEarly && ( sendFeedback(true)} + text="Continue generation" + onClick={props.onContinueGeneration} > - + + )} + {props.index !== 1 && ( sendFeedback(false)} + onClick={props.onDelete} > - + -
- )} + )} + + + + sendFeedback(true)} + > + + + + sendFeedback(false)} + > + + +
); } diff --git a/gui/src/components/mainInput/ContinueInputBox.tsx b/gui/src/components/mainInput/ContinueInputBox.tsx index 4924acee8..4a9ea0dfd 100644 --- a/gui/src/components/mainInput/ContinueInputBox.tsx +++ b/gui/src/components/mainInput/ContinueInputBox.tsx @@ -109,7 +109,7 @@ function ContinueInputBox(props: ContinueInputBoxProps) { }, [isGatheringContextStore]); return ( -
+
` props.border ? props.border : `0.5px solid ${vscInputBorder}`}; outline: none; font-size: ${getFontSize()}px; + &:focus { outline: none; @@ -561,86 +564,36 @@ function TipTapEditor(props: TipTapEditorProps) { /** * This handles various issues with meta key actions - * - In JetBrains, when using "off screen rendering", there is a bug where using the meta key to + * - In JetBrains, when using OSR in JCEF, there is a bug where using the meta key to * highlight code using arrow keys is not working * - In VS Code, while working with .ipynb files there is a problem where copy/paste/cut will affect * the actual notebook cells, even when performing them in our GUI + * + * Currently keydown events for a number of keys are not registering if the + * meta/shift key is pressed, for example "x", "c", "v", "z", etc. + * Until this is resolved we can't turn on OSR for non-Mac users due to issues + * with those key actions. */ const handleKeyDown = async (e: KeyboardEvent) => { if (!editor || !editorFocusedRef.current) return; setActiveKey(e.key); - if (isMetaEquivalentKeyPressed(e)) { - const { key, code } = e; - const isWebEnv = isWebEnvironment(); - const text = editor.state.doc.textBetween( - editor.state.selection.from, - editor.state.selection.to, - ); - - if (isJetBrains()) { - if (code === "KeyJ") { - e.stopPropagation(); - e.preventDefault(); - setIgnoreHighlightedCode(true); - setTimeout(() => { - setIgnoreHighlightedCode(false); - }, 100); - } - - if (isMetaEquivalentKeyPressed(e)) { - e.stopPropagation(); - e.preventDefault(); - handleMetaKeyPressJetBrains(e, text, editor.commands.setContent); - } - } else { - if (code === "KeyL") { - e.stopPropagation(); - e.preventDefault(); - setIgnoreHighlightedCode(true); - setTimeout(() => { - setIgnoreHighlightedCode(false); - }, 100); - return; - } - - switch (key) { - case "x": - e.stopPropagation(); - e.preventDefault(); - if (isWebEnv) { - await navigator.clipboard.writeText(text); - editor.commands.deleteSelection(); - } else { - document.execCommand("cut"); - } - break; - case "c": - e.stopPropagation(); - e.preventDefault(); - if (isWebEnv) { - await navigator.clipboard.writeText(text); - } else { - document.execCommand("copy"); - } - break; - case "v": - e.stopPropagation(); - e.preventDefault(); - if (isWebEnv) { - const clipboardText = await navigator.clipboard.readText(); - editor.commands.insertContent(clipboardText); - } else { - document.execCommand("paste"); - } - break; - } - } - } else if (e.key === "Escape") { + // Allow users to use the escape key to jump back to the editor + if (e.key === "Escape") { e.stopPropagation(); e.preventDefault(); ideMessenger.post("focusEditor", undefined); + return; + } + + // Handle meta key issues + if (isMetaEquivalentKeyPressed(e)) { + if (isJetBrains()) { + handleJetBrainsMetaKeyPress(e, editor); + } + + await handleMetaKeyPress(e, editor); } }; @@ -671,9 +624,6 @@ function TipTapEditor(props: TipTapEditorProps) { [props.onEnter, editor, props.isMainInput], ); - // This is a mechanism for overriding the IDE keyboard shortcut when inside of the webview - const [ignoreHighlightedCode, setIgnoreHighlightedCode] = useState(false); - // Re-focus main input after done generating useEffect(() => { if (editor && !active && props.isMainInput && document.hasFocus()) { @@ -748,71 +698,68 @@ function TipTapEditor(props: TipTapEditorProps) { if (!props.isMainInput || !editor) { return; } - if (!ignoreHighlightedCode) { - const rif: RangeInFile & { contents: string } = - data.rangeInFileWithContents; - const basename = getBasename(rif.filepath); - const relativePath = getRelativePath( - rif.filepath, - await ideMessenger.ide.getWorkspaceDirs(), - ); - const rangeStr = `(${rif.range.start.line + 1}-${ - rif.range.end.line + 1 - })`; - const item: ContextItemWithId = { - content: rif.contents, - name: `${basename} ${rangeStr}`, - // Description is passed on to the LLM to give more context on file path - description: `${relativePath} ${rangeStr}`, - id: { - providerTitle: "code", - itemId: v4(), - }, - uri: { - type: "file", - value: rif.filepath, - }, - }; - let index = 0; - for (const el of editor.getJSON().content) { - if (el.type === "codeBlock") { - index += 2; - } else { - break; - } + const rif: RangeInFile & { contents: string } = + data.rangeInFileWithContents; + const basename = getBasename(rif.filepath); + const relativePath = getRelativePath( + rif.filepath, + await ideMessenger.ide.getWorkspaceDirs(), + ); + const rangeStr = `(${rif.range.start.line + 1}-${ + rif.range.end.line + 1 + })`; + const item: ContextItemWithId = { + content: rif.contents, + name: `${basename} ${rangeStr}`, + // Description is passed on to the LLM to give more context on file path + description: `${relativePath} ${rangeStr}`, + id: { + providerTitle: "code", + itemId: v4(), + }, + uri: { + type: "file", + value: rif.filepath, + }, + }; + + let index = 0; + for (const el of editor.getJSON().content) { + if (el.type === "codeBlock") { + index += 2; + } else { + break; } - editor - .chain() - .insertContentAt(index, { - type: "codeBlock", - attrs: { - item, - }, - }) - .run(); - - if (data.prompt) { - editor.commands.focus("end"); - editor.commands.insertContent(data.prompt); - } - - if (data.shouldRun) { - onEnterRef.current({ useCodebase: false, noContext: true }); - } - - setTimeout(() => { - editor.commands.blur(); - editor.commands.focus("end"); - }, 20); } - setIgnoreHighlightedCode(false); + editor + .chain() + .insertContentAt(index, { + type: "codeBlock", + attrs: { + item, + }, + }) + .run(); + + if (data.prompt) { + editor.commands.focus("end"); + editor.commands.insertContent(data.prompt); + } + + if (data.shouldRun) { + onEnterRef.current({ useCodebase: false, noContext: true }); + } + + setTimeout(() => { + editor.commands.blur(); + editor.commands.focus("end"); + }, 20); }, [ editor, props.isMainInput, historyLength, - ignoreHighlightedCode, props.isMainInput, onEnterRef.current, ], diff --git a/gui/src/components/mainInput/handleMetaKeyPress.ts b/gui/src/components/mainInput/handleMetaKeyPress.ts new file mode 100644 index 000000000..fd122350f --- /dev/null +++ b/gui/src/components/mainInput/handleMetaKeyPress.ts @@ -0,0 +1,107 @@ +import { KeyboardEvent } from "react"; +import { isWebEnvironment } from "../../util"; +import { Editor } from "@tiptap/react"; + +const isWebEnv = isWebEnvironment(); + +export const handleJetBrainsMetaKeyPress = ( + e: KeyboardEvent, + editor: Editor, +) => { + const selection = window.getSelection(); + + const handlers: Record void> = { + Backspace: () => handleJetBrainsMetaBackspace(editor), + ArrowLeft: () => + selection.modify( + e.shiftKey ? "extend" : "move", + "backward", + "lineboundary", + ), + ArrowRight: () => + selection.modify( + e.shiftKey ? "extend" : "move", + "forward", + "lineboundary", + ), + ArrowDown: () => + selection.modify( + e.shiftKey ? "extend" : "move", + "forward", + "documentboundary", + ), + ArrowUp: () => { + selection.modify( + e.shiftKey ? "extend" : "move", + "backward", + "documentboundary", + ); + }, + }; + + if (e.key in handlers) { + e.stopPropagation(); + e.preventDefault(); + handlers[e.key](); + } +}; + +export const handleMetaKeyPress = async (e: KeyboardEvent, editor: Editor) => { + const text = editor.state.doc.textBetween( + editor.state.selection.from, + editor.state.selection.to, + ); + + const handlers: Record Promise> = { + x: () => handleCutOperation(text, editor), + c: () => handleCopyOperation(text), + v: () => handlePasteOperation(editor), + }; + + if (e.key in handlers) { + e.stopPropagation(); + e.preventDefault(); + await handlers[e.key](); + } +}; + +export const handleJetBrainsMetaBackspace = (editor: Editor) => { + const { doc } = editor.state; + + for (let i = doc.content.childCount - 1; i >= 0; i--) { + const node = doc.content.child(i); + + if (node.type.name !== "codeBlock") { + editor.commands.deleteNode(node.type.name); + } + } + + // Add an empty string so the user can keep typing + editor.commands.createParagraphNear(); +}; + +export const handleCutOperation = async (text: string, editor: Editor) => { + if (isWebEnv) { + await navigator.clipboard.writeText(text); + editor.commands.deleteSelection(); + } else { + document.execCommand("cut"); + } +}; + +export const handleCopyOperation = async (text: string) => { + if (isWebEnv) { + await navigator.clipboard.writeText(text); + } else { + document.execCommand("copy"); + } +}; + +export const handlePasteOperation = async (editor: Editor) => { + if (isWebEnv) { + const clipboardText = await navigator.clipboard.readText(); + editor.commands.insertContent(clipboardText); + } else { + document.execCommand("paste"); + } +}; diff --git a/gui/src/pages/AddNewModel/configs/models.ts b/gui/src/pages/AddNewModel/configs/models.ts index 6949d9760..87bdfc546 100644 --- a/gui/src/pages/AddNewModel/configs/models.ts +++ b/gui/src/pages/AddNewModel/configs/models.ts @@ -1,6 +1,6 @@ import { ILLM, ModelProvider } from "core"; -import { InputDescriptor } from "./providers"; import { ModelProviderTags } from "../../../components/modelSelection/utils"; +import { InputDescriptor } from "./providers"; // A dimension is like parameter count - 7b, 13b, 34b, etc. // You would set options to the field that should be changed for that option in the params field of ModelPackage @@ -752,7 +752,7 @@ export const models: { [key: string]: ModelPackage } = { description: "Anthropic's most intelligent model, but much less expensive than Claude 3 Opus", params: { - model: "claude-3-5-sonnet-20240620", + model: "claude-3-5-sonnet-latest", contextLength: 200_000, title: "Claude 3.5 Sonnet", apiKey: "", @@ -870,27 +870,29 @@ export const models: { [key: string]: ModelPackage } = { }, granite3Instruct8b: { title: "Granite 3.0 8b Instruct", - description: "The Granite model series is a family of IBM-trained, dense decoder-only models, which are particularly well-suited for generative tasks.", + description: + "The Granite model series is a family of IBM-trained, dense decoder-only models, which are particularly well-suited for generative tasks.", params: { model: "ibm/granite-3-8b-instruct", contextLength: 8_000, - title: "Granite 3.0 8b Instruct" + title: "Granite 3.0 8b Instruct", }, providerOptions: ["watsonx"], icon: "WatsonX.png", - isOpenSource: false + isOpenSource: false, }, granite3Instruct2b: { title: "Granite 3.0 2b Instruct", - description: "The Granite model series is a family of IBM-trained, dense decoder-only models, which are particularly well-suited for generative tasks.", + description: + "The Granite model series is a family of IBM-trained, dense decoder-only models, which are particularly well-suited for generative tasks.", params: { model: "ibm/granite-3-2b-instruct", contextLength: 2_000, - title: "Granite 3.0 2b Instruct" + title: "Granite 3.0 2b Instruct", }, providerOptions: ["watsonx"], icon: "WatsonX.png", - isOpenSource: false + isOpenSource: false, }, MistralLarge: { title: "Mistral Large", @@ -973,8 +975,6 @@ export const models: { [key: string]: ModelPackage } = { isOpenSource: false, }, - - gpt4gov: { title: "GPT-4 gov", description: @@ -1059,6 +1059,19 @@ export const models: { [key: string]: ModelPackage } = { providerOptions: ["nebius"], isOpenSource: true, }, + grokBeta: { + title: "Grok Beta", + description: "Generative artificial intelligence chatbot developed by xAI.", + refUrl: "", + params: { + title: "Grok Beta", + model: "grok-beta", + contextLength: 128_000, + }, + icon: "xAI.png", + providerOptions: ["xAI"], + isOpenSource: false, + }, AUTODETECT: { title: "Autodetect", description: diff --git a/gui/src/pages/AddNewModel/configs/providers.ts b/gui/src/pages/AddNewModel/configs/providers.ts index 62f6905d1..dd1c3fbdb 100644 --- a/gui/src/pages/AddNewModel/configs/providers.ts +++ b/gui/src/pages/AddNewModel/configs/providers.ts @@ -352,6 +352,27 @@ Select the \`GPT-4o\` model below to complete your provider configuration, but n packages: [models.gemini15Pro, models.geminiPro, models.gemini15Flash], apiKeyUrl: "https://aistudio.google.com/app/apikey", }, + xAI: { + title: "xAI", + provider: "xAI", + icon: "xAI.png", + description: "xAI is a company working on building artificial intelligence to accelerate human scientific discovery", + longDescription: "To get started with xAI, obtain an API key from their [console](https://console.x.ai/).", + tags: [ModelProviderTags.RequiresApiKey, ModelProviderTags.OpenSource], + collectInputFor: [ + { + inputType: "text", + key: "apiKey", + label: "API Key", + placeholder: "Enter your xAI API key", + required: true, + }, + ], + packages: [ + models.grokBeta, + ], + apiKeyUrl: "https://console.x.ai/", + }, lmstudio: { title: "LM Studio", provider: "lmstudio", diff --git a/gui/src/pages/gui/Chat.tsx b/gui/src/pages/gui/Chat.tsx index a24c959af..6ca0cc167 100644 --- a/gui/src/pages/gui/Chat.tsx +++ b/gui/src/pages/gui/Chat.tsx @@ -66,7 +66,6 @@ const TopGuiDiv = styled.div<{ showScrollbar?: boolean; }>` overflow-y: auto; - height: 100%; scrollbar-width: ${(props) => (props.showScrollbar ? "thin" : "none")}; &::-webkit-scrollbar { @@ -75,6 +74,7 @@ const TopGuiDiv = styled.div<{ `; const StopButton = styled.div` + background-color: ${vscBackground}; width: fit-content; margin-right: auto; margin-left: auto; @@ -97,6 +97,7 @@ const StopButton = styled.div` `; const StepsDiv = styled.div` + margin-top: 8px; position: relative; background-color: transparent; @@ -147,16 +148,17 @@ export function Chat() { const { saveSession, getLastSessionId, loadLastSession } = useHistory(dispatch); - useEffect(() => { - if (!active || !topGuiDivRef.current) return; - - const scrollAreaElement = topGuiDivRef.current; - - scrollAreaElement.scrollTop = - scrollAreaElement.scrollHeight - scrollAreaElement.clientHeight; + const scrollToBottom = useCallback(() => { + if (!topGuiDivRef.current) return; + const elem = topGuiDivRef.current; + elem.scrollTop = elem.scrollHeight - elem.clientHeight; setIsAtBottom(true); - }, [active]); + }, [topGuiDivRef, setIsAtBottom]); + + useEffect(() => { + if (active) scrollToBottom(); + }, [active, scrollToBottom]); useEffect(() => { // Cmd + Backspace to delete current step @@ -311,6 +313,7 @@ export function Chat() { return ( <> 0 ? "h-full" : ""}`} ref={topGuiDivRef} onScroll={handleScroll} showScrollbar={state.config.ui?.showChatScrollbar || false} @@ -415,22 +418,56 @@ export function Chat() { ))} +
+ + -