From ad8743a9b563ae6e09cc140a0b3f9f202715e3b5 Mon Sep 17 00:00:00 2001 From: James Delorey Date: Tue, 28 May 2024 08:08:31 -0500 Subject: [PATCH] feat: Add cloudflare as provider --- core/index.d.ts | 6 +- core/llm/index.ts | 2 + core/llm/llms/Cloudflare.ts | 62 +++ core/llm/llms/index.ts | 2 + .../reference/Model Providers/cloudflare.md | 46 ++ docs/static/schemas/config.json | 67 ++- .../src/main/resources/config_schema.json | 67 ++- extensions/vscode/config_schema.json | 67 ++- extensions/vscode/continue_rc_schema.json | 525 ++++++------------ extensions/vscode/package-lock.json | 6 +- extensions/vscode/package.json | 2 +- gui/package-lock.json | 2 +- 12 files changed, 485 insertions(+), 369 deletions(-) create mode 100644 core/llm/llms/Cloudflare.ts create mode 100644 docs/docs/reference/Model Providers/cloudflare.md diff --git a/core/index.d.ts b/core/index.d.ts index 859e428c9..61f572df1 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -296,6 +296,9 @@ export interface LLMOptions { useLegacyCompletionsEndpoint?: boolean; + // Cloudflare options + accountId?: string; + // Azure options engine?: string; apiVersion?: string; @@ -531,7 +534,8 @@ type ModelProvider = | "groq" | "continue-proxy" | "fireworks" - | "custom"; + | "custom" + | "cloudflare"; export type ModelName = | "AUTODETECT" diff --git a/core/llm/index.ts b/core/llm/index.ts index 8dcf6a2c9..f6e798efc 100644 --- a/core/llm/index.ts +++ b/core/llm/index.ts @@ -93,6 +93,7 @@ export abstract class BaseLLM implements ILLM { apiType?: string; region?: string; projectId?: string; + accountId?: string; private _llmOptions: LLMOptions; @@ -144,6 +145,7 @@ export abstract class BaseLLM implements ILLM { if (this.apiBase && !this.apiBase.endsWith("/")) { this.apiBase = `${this.apiBase}/`; } + this.accountId = options.accountId; this.engine = options.engine; this.apiVersion = options.apiVersion; diff --git a/core/llm/llms/Cloudflare.ts b/core/llm/llms/Cloudflare.ts new file mode 100644 index 000000000..ff2c11564 --- /dev/null +++ b/core/llm/llms/Cloudflare.ts @@ -0,0 +1,62 @@ +import { BaseLLM } from "../index.js"; +import { ChatMessage, CompletionOptions, ModelProvider } from "../../index.js"; +import { stripImages } from "../countTokens.js"; +import { streamSse } from "../stream.js"; + +export default class Cloudflare extends BaseLLM { + static providerName: ModelProvider = "cloudflare"; + + private _convertArgs(options: CompletionOptions) { + const finalOptions = { + max_tokens: options.maxTokens, + }; + + return finalOptions; + } + + protected async *_streamChat( + messages: ChatMessage[], + options: CompletionOptions, + ): AsyncGenerator { + const headers = { + "Content-Type": "application/json", + Authorization: `Bearer ${this.apiKey}`, + ...this.requestOptions?.headers, + }; + + const resp = await this.fetch( + new URL( + `https://api.cloudflare.com/client/v4/accounts/${this.accountId}/ai/v1/chat/completions`, + ), + { + method: "POST", + headers, + body: JSON.stringify({ + messages, + stream: true, + model: this.model, + ...this._convertArgs(options), + }), + }, + ); + + for await (const value of streamSse(resp)) { + console.log(value); + if (value.choices?.[0]?.delta?.content) { + yield value.choices[0].delta; + } + } + } + + protected async *_streamComplete( + prompt: string, + options: CompletionOptions, + ): AsyncGenerator { + for await (const chunk of this._streamChat( + [{ role: "user", content: prompt }], + options, + )) { + yield stripImages(chunk.content); + } + } +} diff --git a/core/llm/llms/index.ts b/core/llm/llms/index.ts index 33165263b..6cc675219 100644 --- a/core/llm/llms/index.ts +++ b/core/llm/llms/index.ts @@ -29,6 +29,7 @@ import Replicate from "./Replicate.js"; import TextGenWebUI from "./TextGenWebUI.js"; import Together from "./Together.js"; import ContinueProxy from "./stubs/ContinueProxy.js"; +import Cloudflare from "./Cloudflare"; function convertToLetter(num: number): string { let result = ""; @@ -99,6 +100,7 @@ const LLMs = [ Groq, Fireworks, ContinueProxy, + Cloudflare, ]; export async function llmFromDescription( diff --git a/docs/docs/reference/Model Providers/cloudflare.md b/docs/docs/reference/Model Providers/cloudflare.md new file mode 100644 index 000000000..749472a45 --- /dev/null +++ b/docs/docs/reference/Model Providers/cloudflare.md @@ -0,0 +1,46 @@ +# Cloudflare Workers AI + +Cloudflare Workers AI can be used for both chat and tab autocompletion in Continue. To setup Cloudflare Workers AI, add the following to your `config.json` file: + +```json title="~/.continue/config.json" +{ + "models": [ + { + "accountId": "YOUR CLOUDFLARE ACCOUNT ID", + "apiKey": "YOUR CLOUDFLARE API KEY", + "contextLength": 2400, + "completionOptions": { + "maxTokens": 500 + }, + "model": "@cf/meta/llama-3-8b-instruct", // This can be the name of any model supported by Workers AI + "provider": "cloudflare", + "title": "Llama 3 8B" + }, + { + "accountId": "YOUR CLOUDFLARE ACCOUNT ID", + "apiKey": "YOUR CLOUDFLARE API KEY", + "contextLength": 2400, + "completionOptions": { + "maxTokens": 500 + }, + "model": "@hf/thebloke/deepseek-coder-6.7b-instruct-awq", + "provider": "cloudflare", + "title": "DeepSeek Coder 6.7b Instruct" + } + ... + "tabAutocompleteModel": { + "accountId": "YOUR CLOUDFLARE ACCOUNT ID", + "apiKey": "YOUR CLOUDFLARE API KEY", + "model": "@hf/thebloke/deepseek-coder-6.7b-base-awq", + "provider": "cloudflare", + "title": "DeepSeek 7b" + }, + ] +} +``` + +Visit the [Cloudflare dashboard](https://dash.cloudflare.com/) to [create an API key](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/). + +Review [available models](https://developers.cloudflare.com/workers-ai/models/) on Workers AI + +[View the source](https://github.com/continuedev/continue/blob/main/core/llm/llms/Cloudflare.ts) diff --git a/docs/static/schemas/config.json b/docs/static/schemas/config.json index 58e74819b..9900455a9 100644 --- a/docs/static/schemas/config.json +++ b/docs/static/schemas/config.json @@ -149,7 +149,8 @@ "deepinfra", "flowise", "groq", - "continue-proxy" + "continue-proxy", + "cloudflare" ], "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)", @@ -168,7 +169,8 @@ "### 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/)", "### DeepInfra\n\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/deepinfra)", - "### Continue Proxy\n\nContinue Enterprise users can use the Continue Proxy as a single point of access to models." + "### Continue Proxy\n\nContinue Enterprise users can use the Continue Proxy as a single point of access to models.", + "### Cloudflare Workers AI\n\n[Reference](https://developers.cloudflare.com/workers-ai/)" ], "type": "string" }, @@ -312,7 +314,8 @@ "gemini", "huggingface-inference-api", "replicate", - "together" + "together", + "cloudflare" ] } }, @@ -358,6 +361,64 @@ } } }, + { + "if": { + "properties": { + "provider": { + "enum": ["cloudflare"] + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "accountId": { + "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": { diff --git a/extensions/intellij/src/main/resources/config_schema.json b/extensions/intellij/src/main/resources/config_schema.json index 58e74819b..9900455a9 100644 --- a/extensions/intellij/src/main/resources/config_schema.json +++ b/extensions/intellij/src/main/resources/config_schema.json @@ -149,7 +149,8 @@ "deepinfra", "flowise", "groq", - "continue-proxy" + "continue-proxy", + "cloudflare" ], "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)", @@ -168,7 +169,8 @@ "### 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/)", "### DeepInfra\n\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/deepinfra)", - "### Continue Proxy\n\nContinue Enterprise users can use the Continue Proxy as a single point of access to models." + "### Continue Proxy\n\nContinue Enterprise users can use the Continue Proxy as a single point of access to models.", + "### Cloudflare Workers AI\n\n[Reference](https://developers.cloudflare.com/workers-ai/)" ], "type": "string" }, @@ -312,7 +314,8 @@ "gemini", "huggingface-inference-api", "replicate", - "together" + "together", + "cloudflare" ] } }, @@ -358,6 +361,64 @@ } } }, + { + "if": { + "properties": { + "provider": { + "enum": ["cloudflare"] + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "accountId": { + "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": { diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index e28d50a30..e96ae148d 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -150,7 +150,8 @@ "flowise", "groq", "fireworks", - "continue-proxy" + "continue-proxy", + "cloudflare" ], "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)", @@ -169,7 +170,8 @@ "### 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/)", "### DeepInfra\n\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/deepinfra)", - "### Continue Proxy\n\nContinue Enterprise users can use the Continue Proxy as a single point of access to models." + "### Continue Proxy\n\nContinue Enterprise users can use the Continue Proxy as a single point of access to models.", + "### Cloudflare Workers AI\n\n[Reference](https://developers.cloudflare.com/workers-ai/)" ], "type": "string" }, @@ -313,7 +315,8 @@ "gemini", "huggingface-inference-api", "replicate", - "together" + "together", + "cloudflare" ] } }, @@ -359,6 +362,64 @@ } } }, + { + "if": { + "properties": { + "provider": { + "enum": ["cloudflare"] + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "accountId": { + "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": { diff --git a/extensions/vscode/continue_rc_schema.json b/extensions/vscode/continue_rc_schema.json index d9dd6bbb9..9021ca69b 100644 --- a/extensions/vscode/continue_rc_schema.json +++ b/extensions/vscode/continue_rc_schema.json @@ -149,7 +149,8 @@ "deepinfra", "flowise", "groq", - "continue-proxy" + "continue-proxy", + "cloudflare" ], "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)", @@ -168,7 +169,8 @@ "### 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/)", "### DeepInfra\n\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/deepinfra)", - "### Continue Proxy\n\nContinue Enterprise users can use the Continue Proxy as a single point of access to models." + "### Continue Proxy\n\nContinue Enterprise users can use the Continue Proxy as a single point of access to models.", + "### Cloudflare Workers AI\n\n[Reference](https://developers.cloudflare.com/workers-ai/)" ], "type": "string" }, @@ -267,10 +269,7 @@ "apiType": { "title": "Api Type", "markdownDescription": "OpenAI API type, either `openai` or `azure`", - "enum": [ - "openai", - "azure" - ] + "enum": ["openai", "azure"] }, "apiVersion": { "title": "Api Version", @@ -283,11 +282,7 @@ "type": "string" } }, - "required": [ - "title", - "provider", - "model" - ], + "required": ["title", "provider", "model"], "allOf": [ { "if": { @@ -297,9 +292,7 @@ } }, "not": { - "required": [ - "provider" - ] + "required": ["provider"] } }, "then": { @@ -321,52 +314,38 @@ "gemini", "huggingface-inference-api", "replicate", - "together" + "together", + "cloudflare" ] } }, - "required": [ - "provider" - ] + "required": ["provider"] }, "then": { - "required": [ - "apiKey" - ] + "required": ["apiKey"] } }, { "if": { "properties": { "provider": { - "enum": [ - "huggingface-tgi", - "huggingface-inference-api" - ] + "enum": ["huggingface-tgi", "huggingface-inference-api"] } } }, "then": { - "required": [ - "apiBase" - ] + "required": ["apiBase"] }, - "required": [ - "provider" - ] + "required": ["provider"] }, { "if": { "properties": { "provider": { - "enum": [ - "openai" - ] + "enum": ["openai"] } }, - "required": [ - "provider" - ] + "required": ["provider"] }, "then": { "properties": { @@ -386,14 +365,68 @@ "if": { "properties": { "provider": { - "enum": [ - "openai" - ] + "enum": ["cloudflare"] } }, - "required": [ - "provider" - ] + "required": ["provider"] + }, + "then": { + "properties": { + "accountId": { + "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": { @@ -424,14 +457,10 @@ "if": { "properties": { "provider": { - "enum": [ - "replicate" - ] + "enum": ["replicate"] } }, - "required": [ - "provider" - ] + "required": ["provider"] }, "then": { "properties": { @@ -461,14 +490,10 @@ "if": { "properties": { "provider": { - "enum": [ - "free-trial" - ] + "enum": ["free-trial"] } }, - "required": [ - "provider" - ] + "required": ["provider"] }, "then": { "properties": { @@ -493,9 +518,7 @@ "if": { "properties": { "provider": { - "enum": [ - "openai" - ] + "enum": ["openai"] }, "apiType": { "not": { @@ -503,9 +526,7 @@ } } }, - "required": [ - "provider" - ] + "required": ["provider"] }, "then": { "properties": { @@ -563,14 +584,10 @@ "if": { "properties": { "provider": { - "enum": [ - "anthropic" - ] + "enum": ["anthropic"] } }, - "required": [ - "provider" - ] + "required": ["provider"] }, "then": { "properties": { @@ -598,22 +615,15 @@ "if": { "properties": { "provider": { - "enum": [ - "cohere" - ] + "enum": ["cohere"] } }, - "required": [ - "provider" - ] + "required": ["provider"] }, "then": { "properties": { "model": { - "enum": [ - "command-r", - "command-r-plus" - ] + "enum": ["command-r", "command-r-plus"] } } } @@ -622,14 +632,10 @@ "if": { "properties": { "provider": { - "enum": [ - "bedrock" - ] + "enum": ["bedrock"] } }, - "required": [ - "provider" - ] + "required": ["provider"] }, "then": { "properties": { @@ -654,14 +660,10 @@ "if": { "properties": { "provider": { - "enum": [ - "gemini" - ] + "enum": ["gemini"] } }, - "required": [ - "provider" - ] + "required": ["provider"] }, "then": { "properties": { @@ -680,14 +682,10 @@ "if": { "properties": { "provider": { - "enum": [ - "together" - ] + "enum": ["together"] } }, - "required": [ - "provider" - ] + "required": ["provider"] }, "then": { "properties": { @@ -721,14 +719,10 @@ "if": { "properties": { "provider": { - "enum": [ - "deepinfra" - ] + "enum": ["deepinfra"] } }, - "required": [ - "provider" - ] + "required": ["provider"] }, "then": { "properties": { @@ -751,9 +745,7 @@ ] } }, - "required": [ - "provider" - ] + "required": ["provider"] }, "then": { "properties": { @@ -799,14 +791,10 @@ "if": { "properties": { "provider": { - "enum": [ - "ollama" - ] + "enum": ["ollama"] } }, - "required": [ - "provider" - ] + "required": ["provider"] }, "then": { "properties": { @@ -854,14 +842,10 @@ "if": { "properties": { "provider": { - "enum": [ - "mistral" - ] + "enum": ["mistral"] } }, - "required": [ - "provider" - ] + "required": ["provider"] }, "then": { "properties": { @@ -882,14 +866,10 @@ "if": { "properties": { "provider": { - "enum": [ - "groq" - ] + "enum": ["groq"] } }, - "required": [ - "provider" - ] + "required": ["provider"] }, "then": { "properties": { @@ -913,30 +893,20 @@ "const": "azure" } }, - "required": [ - "apiType" - ] + "required": ["apiType"] }, "then": { - "required": [ - "engine", - "apiVersion", - "apiBase" - ] + "required": ["engine", "apiVersion", "apiBase"] } }, { "if": { "properties": { "provider": { - "enum": [ - "openai" - ] + "enum": ["openai"] } }, - "required": [ - "provider" - ] + "required": ["provider"] }, "then": { "properties": { @@ -953,9 +923,7 @@ "const": "llamafile" } }, - "required": [ - "provider" - ] + "required": ["provider"] }, "then": { "properties": { @@ -969,14 +937,10 @@ "if": { "properties": { "provider": { - "enum": [ - "text-gen-webui" - ] + "enum": ["text-gen-webui"] } }, - "required": [ - "provider" - ] + "required": ["provider"] }, "then": { "properties": { @@ -990,14 +954,10 @@ "if": { "properties": { "provider": { - "enum": [ - "flowise" - ] + "enum": ["flowise"] } }, - "required": [ - "provider" - ] + "required": ["provider"] }, "then": { "properties": { @@ -1024,10 +984,7 @@ "type": "string" } }, - "required": [ - "key", - "value" - ] + "required": ["key", "value"] } }, "additionalFlowiseConfiguration": { @@ -1046,10 +1003,7 @@ "description": "Configuration Property value" } }, - "required": [ - "key", - "value" - ] + "required": ["key", "value"] } }, "model": { @@ -1139,9 +1093,7 @@ "type": "string" } }, - "required": [ - "default" - ] + "required": ["default"] }, "SlashCommand": { "title": "SlashCommand", @@ -1200,9 +1152,7 @@ "if": { "properties": { "name": { - "enum": [ - "issue" - ] + "enum": ["issue"] } } }, @@ -1215,23 +1165,17 @@ "description": "Enter the URL of the GitHub repository for which you want to generate the issue." } }, - "required": [ - "repositoryUrl" - ] + "required": ["repositoryUrl"] } }, - "required": [ - "params" - ] + "required": ["params"] } }, { "if": { "properties": { "name": { - "enum": [ - "edit" - ] + "enum": ["edit"] } } }, @@ -1256,9 +1200,7 @@ "if": { "properties": { "name": { - "enum": [ - "share" - ] + "enum": ["share"] } } }, @@ -1276,10 +1218,7 @@ } } ], - "required": [ - "name", - "description" - ] + "required": ["name", "description"] }, "CustomCommand": { "title": "CustomCommand", @@ -1298,11 +1237,7 @@ "type": "string" } }, - "required": [ - "name", - "prompt", - "description" - ] + "required": ["name", "prompt", "description"] }, "ContextProviderWithParams": { "title": "ContextProviderWithParams", @@ -1375,9 +1310,7 @@ "if": { "properties": { "name": { - "enum": [ - "google" - ] + "enum": ["google"] } } }, @@ -1390,23 +1323,17 @@ "description": "Your API key for https://serper.dev in order to get Google search results" } }, - "required": [ - "serperApiKey" - ] + "required": ["serperApiKey"] } }, - "required": [ - "params" - ] + "required": ["params"] } }, { "if": { "properties": { "name": { - "enum": [ - "open" - ] + "enum": ["open"] } } }, @@ -1428,9 +1355,7 @@ "if": { "properties": { "name": { - "enum": [ - "issue" - ] + "enum": ["issue"] } } }, @@ -1459,37 +1384,24 @@ "type": { "type": "string", "description": "The type of issues to search for", - "enum": [ - "open", - "closed", - "all" - ] + "enum": ["open", "closed", "all"] } }, - "required": [ - "owner", - "repo" - ] + "required": ["owner", "repo"] } } }, - "required": [ - "repos" - ] + "required": ["repos"] } }, - "required": [ - "params" - ] + "required": ["params"] } }, { "if": { "properties": { "name": { - "enum": [ - "database" - ] + "enum": ["database"] } } }, @@ -1507,11 +1419,7 @@ "connection_type": { "type": "string", "description": "The type of database (e.g., 'postgres', 'mysql')", - "enum": [ - "postgres", - "mysql", - "sqlite" - ] + "enum": ["postgres", "mysql", "sqlite"] }, "connection": { "type": "object", @@ -1544,25 +1452,17 @@ "required": [] } }, - "required": [ - "name", - "type", - "connection" - ] + "required": ["name", "type", "connection"] } }, - "required": [ - "connections" - ] + "required": ["connections"] } }, { "if": { "properties": { "name": { - "enum": [ - "gitlab-mr" - ] + "enum": ["gitlab-mr"] } } }, @@ -1583,23 +1483,17 @@ "description": "If you have code selected, filters out comments that aren't related to the selection." } }, - "required": [ - "token" - ] + "required": ["token"] } }, - "required": [ - "params" - ] + "required": ["params"] } }, { "if": { "properties": { "name": { - "enum": [ - "jira" - ] + "enum": ["jira"] } } }, @@ -1645,24 +1539,17 @@ ] } }, - "required": [ - "domain", - "token" - ] + "required": ["domain", "token"] } }, - "required": [ - "params" - ] + "required": ["params"] } }, { "if": { "properties": { "name": { - "enum": [ - "http" - ] + "enum": ["http"] } } }, @@ -1675,24 +1562,17 @@ "description": "The HTTP endpoint of your context provider server." } }, - "required": [ - "url" - ] + "required": ["url"] } }, - "required": [ - "params" - ] + "required": ["params"] } }, { "if": { "properties": { "name": { - "enum": [ - "codebase", - "folder" - ] + "enum": ["codebase", "folder"] } } }, @@ -1727,9 +1607,7 @@ "if": { "properties": { "name": { - "enum": [ - "postgres" - ] + "enum": ["postgres"] } } }, @@ -1781,19 +1659,11 @@ } } }, - "required": [ - "host", - "port", - "user", - "password", - "database" - ] + "required": ["host", "port", "user", "password", "database"] } } ], - "required": [ - "name" - ] + "required": ["name"] }, "SerializedContinueConfig": { "title": "config.json", @@ -1944,46 +1814,32 @@ "$ref": "#/definitions/RequestOptions" } }, - "required": [ - "provider" - ], + "required": ["provider"], "allOf": [ { "if": { "properties": { "provider": { - "enum": [ - "ollama" - ] + "enum": ["ollama"] } }, - "required": [ - "provider" - ] + "required": ["provider"] }, "then": { - "required": [ - "model" - ] + "required": ["model"] } }, { "if": { "properties": { "provider": { - "enum": [ - "cohere" - ] + "enum": ["cohere"] } }, - "required": [ - "provider" - ] + "required": ["provider"] }, "then": { - "required": [ - "apiKey" - ] + "required": ["apiKey"] } } ] @@ -1994,33 +1850,22 @@ "type": "object", "properties": { "name": { - "enum": [ - "cohere", - "voyage", - "llm", - "free-trial" - ] + "enum": ["cohere", "voyage", "llm", "free-trial"] }, "params": { "type": "object" } }, - "required": [ - "name" - ], + "required": ["name"], "allOf": [ { "if": { "properties": { "name": { - "enum": [ - "cohere" - ] + "enum": ["cohere"] } }, - "required": [ - "name" - ] + "required": ["name"] }, "then": { "properties": { @@ -2042,9 +1887,7 @@ "type": "string" } }, - "required": [ - "apiKey" - ] + "required": ["apiKey"] } } } @@ -2053,14 +1896,10 @@ "if": { "properties": { "name": { - "enum": [ - "llm" - ] + "enum": ["llm"] } }, - "required": [ - "name" - ] + "required": ["name"] }, "then": { "properties": { @@ -2071,9 +1910,7 @@ "type": "string" } }, - "required": [ - "modelTitle" - ] + "required": ["modelTitle"] } } } @@ -2082,14 +1919,10 @@ "if": { "properties": { "name": { - "enum": [ - "voyage" - ] + "enum": ["voyage"] } }, - "required": [ - "name" - ] + "required": ["name"] }, "then": { "properties": { @@ -2100,14 +1933,10 @@ "type": "string" }, "model": { - "enum": [ - "rerank-lite-1" - ] + "enum": ["rerank-lite-1"] } }, - "required": [ - "apiKey" - ] + "required": ["apiKey"] } } } @@ -2163,11 +1992,7 @@ "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" - ], + "enum": ["always", "never", "auto"], "description": "If set to true, Continue will only complete a single line at a time." }, "useCache": { @@ -2196,10 +2021,7 @@ "type": "object", "properties": { "codeBlockToolbarPosition": { - "enum": [ - "top", - "bottom" - ], + "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." }, @@ -2216,9 +2038,7 @@ "defaultContext": { "type": "array", "items": { - "enum": [ - "activeFile" - ] + "enum": ["activeFile"] } }, "modelRoles": { @@ -2258,10 +2078,7 @@ }, "mergeBehavior": { "type": "string", - "enum": [ - "merge", - "overwrite" - ], + "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." @@ -2269,4 +2086,4 @@ } } } -} \ No newline at end of file +} diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index 2628faf2e..f6a494148 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.9.140", + "version": "0.9.141", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "0.9.140", + "version": "0.9.141", "license": "Apache-2.0", "dependencies": { "@electron/rebuild": "^3.2.10", @@ -88,7 +88,7 @@ }, "../../core": { "name": "@continuedev/core", - "version": "1.0.12", + "version": "1.0.13", "license": "Apache-2.0", "dependencies": { "@aws-sdk/client-bedrock-runtime": "^3.574.0", diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index edf8d597a..02d7a767a 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -1,7 +1,7 @@ { "name": "continue", "icon": "media/icon.png", - "version": "0.9.140", + "version": "0.9.141", "repository": { "type": "git", "url": "https://github.com/continuedev/continue" diff --git a/gui/package-lock.json b/gui/package-lock.json index b38ef9e7a..72f480b9f 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -80,7 +80,7 @@ }, "../core": { "name": "@continuedev/core", - "version": "1.0.12", + "version": "1.0.13", "license": "Apache-2.0", "dependencies": { "@aws-sdk/client-bedrock-runtime": "^3.574.0",