⚡️ improved autocomplete stopping
This commit is contained in:
parent
53b61288ec
commit
e007efbd63
6 changed files with 367 additions and 209 deletions
|
|
@ -51,6 +51,15 @@ function isBracketEnding(line: string): boolean {
|
|||
.split("")
|
||||
.some((char) => bracketEnding.includes(char));
|
||||
}
|
||||
|
||||
function commonPrefixLength(a: string, b: string): number {
|
||||
let i = 0;
|
||||
while (i < a.length && i < b.length && a[i] === b[i]) {
|
||||
i++;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
export async function* stopAtSimilarLine(
|
||||
stream: LineStream,
|
||||
line: string,
|
||||
|
|
@ -64,7 +73,11 @@ export async function* stopAtSimilarLine(
|
|||
}
|
||||
|
||||
let lineQualifies = nextLine.length > 4 && line.length > 4;
|
||||
if (lineQualifies && distance(nextLine.trim(), line) / line.length < 0.1) {
|
||||
if (
|
||||
lineQualifies &&
|
||||
(commonPrefixLength(nextLine.trim(), line.trim()) > 8 ||
|
||||
distance(nextLine.trim(), line) / line.length < 0.1)
|
||||
) {
|
||||
break;
|
||||
}
|
||||
yield nextLine;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ class FreeTrial extends BaseLLM {
|
|||
private async _getHeaders() {
|
||||
return {
|
||||
uniqueId: this.uniqueId || "None",
|
||||
extensionVersion: Telemetry.extensionVersion ?? "Unknown",
|
||||
extensionVersion: Telemetry.extensionVersion ?? "0.0.0",
|
||||
os: Telemetry.os ?? "Unknown",
|
||||
"Content-Type": "application/json",
|
||||
...(await getHeaders()),
|
||||
|
|
|
|||
|
|
@ -1,98 +0,0 @@
|
|||
import { ChatMessage, CompletionOptions, ModelProvider } from "../../index.js";
|
||||
import { BaseLLM } from "../index.js";
|
||||
import { streamResponse } from "../stream.js";
|
||||
|
||||
// const SERVER_URL = "http://localhost:8080";
|
||||
const SERVER_URL = "https://proxy-server-l6vsfbzhba-uw.a.run.app";
|
||||
|
||||
class OpenAIFreeTrial extends BaseLLM {
|
||||
static providerName: ModelProvider = "openai-free-trial" as ModelProvider;
|
||||
|
||||
private _getHeaders() {
|
||||
return {
|
||||
uniqueId: this.uniqueId || "None",
|
||||
"Content-Type": "application/json",
|
||||
};
|
||||
}
|
||||
|
||||
protected async _complete(
|
||||
prompt: string,
|
||||
options: CompletionOptions,
|
||||
): Promise<string> {
|
||||
const args = this.collectArgs(options);
|
||||
|
||||
const response = await this.fetch(`${SERVER_URL}/complete`, {
|
||||
method: "POST",
|
||||
headers: this._getHeaders(),
|
||||
body: JSON.stringify({
|
||||
messages: [{ role: "user", content: prompt }],
|
||||
...args,
|
||||
}),
|
||||
});
|
||||
|
||||
return await response.json();
|
||||
}
|
||||
|
||||
protected async *_streamComplete(
|
||||
prompt: string,
|
||||
options: CompletionOptions,
|
||||
): AsyncGenerator<string> {
|
||||
const args = this.collectArgs(options);
|
||||
|
||||
const response = await this.fetch(`${SERVER_URL}/stream_complete`, {
|
||||
method: "POST",
|
||||
headers: this._getHeaders(),
|
||||
body: JSON.stringify({
|
||||
messages: [{ role: "user", content: prompt }],
|
||||
...args,
|
||||
}),
|
||||
});
|
||||
|
||||
for await (const value of streamResponse(response)) {
|
||||
yield value;
|
||||
}
|
||||
}
|
||||
|
||||
protected async *_streamChat(
|
||||
messages: ChatMessage[],
|
||||
options: CompletionOptions,
|
||||
): AsyncGenerator<ChatMessage> {
|
||||
const args = this.collectArgs(options);
|
||||
|
||||
const response = await this.fetch(`${SERVER_URL}/stream_chat`, {
|
||||
method: "POST",
|
||||
headers: this._getHeaders(),
|
||||
body: JSON.stringify({
|
||||
messages,
|
||||
...args,
|
||||
}),
|
||||
});
|
||||
|
||||
for await (const value of streamResponse(response)) {
|
||||
const chunks = value.split("\n");
|
||||
|
||||
for (const chunk of chunks) {
|
||||
if (chunk.trim() !== "") {
|
||||
const loadedChunk = JSON.parse(chunk);
|
||||
|
||||
yield {
|
||||
role: "assistant",
|
||||
content: loadedChunk.content || "",
|
||||
};
|
||||
|
||||
// if (this.model === "gpt-4") {
|
||||
// await delay(0.03);
|
||||
// } else {
|
||||
// await delay(0.01);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function delay(seconds: number) {
|
||||
return new Promise((resolve) => setTimeout(resolve, seconds * 1000));
|
||||
}
|
||||
|
||||
export default OpenAIFreeTrial;
|
||||
|
|
@ -24,7 +24,6 @@ import Llamafile from "./Llamafile.js";
|
|||
import Mistral from "./Mistral.js";
|
||||
import Ollama from "./Ollama.js";
|
||||
import OpenAI from "./OpenAI.js";
|
||||
import OpenAIFreeTrial from "./OpenAIFreeTrial.js";
|
||||
import Replicate from "./Replicate.js";
|
||||
import TextGenWebUI from "./TextGenWebUI.js";
|
||||
import Together from "./Together.js";
|
||||
|
|
@ -95,7 +94,6 @@ const LLMs = [
|
|||
Mistral,
|
||||
Bedrock,
|
||||
DeepInfra,
|
||||
OpenAIFreeTrial,
|
||||
Flowise,
|
||||
Groq,
|
||||
ContinueProxy,
|
||||
|
|
|
|||
|
|
@ -267,7 +267,10 @@
|
|||
"apiType": {
|
||||
"title": "Api Type",
|
||||
"markdownDescription": "OpenAI API type, either `openai` or `azure`",
|
||||
"enum": ["openai", "azure"]
|
||||
"enum": [
|
||||
"openai",
|
||||
"azure"
|
||||
]
|
||||
},
|
||||
"apiVersion": {
|
||||
"title": "Api Version",
|
||||
|
|
@ -280,7 +283,11 @@
|
|||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["title", "provider", "model"],
|
||||
"required": [
|
||||
"title",
|
||||
"provider",
|
||||
"model"
|
||||
],
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
|
|
@ -290,7 +297,9 @@
|
|||
}
|
||||
},
|
||||
"not": {
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
|
|
@ -316,33 +325,48 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"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": {
|
||||
|
|
@ -362,10 +386,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["openai"]
|
||||
"enum": [
|
||||
"openai"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -396,10 +424,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["replicate"]
|
||||
"enum": [
|
||||
"replicate"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -429,10 +461,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["free-trial"]
|
||||
"enum": [
|
||||
"free-trial"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -457,7 +493,9 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["openai"]
|
||||
"enum": [
|
||||
"openai"
|
||||
]
|
||||
},
|
||||
"apiType": {
|
||||
"not": {
|
||||
|
|
@ -465,7 +503,9 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -523,10 +563,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["anthropic"]
|
||||
"enum": [
|
||||
"anthropic"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -554,15 +598,22 @@
|
|||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -571,10 +622,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["bedrock"]
|
||||
"enum": [
|
||||
"bedrock"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -599,10 +654,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["gemini"]
|
||||
"enum": [
|
||||
"gemini"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -621,10 +680,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["together"]
|
||||
"enum": [
|
||||
"together"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -658,10 +721,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["deepinfra"]
|
||||
"enum": [
|
||||
"deepinfra"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -684,7 +751,9 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -730,10 +799,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["ollama"]
|
||||
"enum": [
|
||||
"ollama"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -781,10 +854,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["mistral"]
|
||||
"enum": [
|
||||
"mistral"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -805,10 +882,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["groq"]
|
||||
"enum": [
|
||||
"groq"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -832,20 +913,30 @@
|
|||
"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": {
|
||||
|
|
@ -862,7 +953,9 @@
|
|||
"const": "llamafile"
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -876,10 +969,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["text-gen-webui"]
|
||||
"enum": [
|
||||
"text-gen-webui"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -893,10 +990,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["flowise"]
|
||||
"enum": [
|
||||
"flowise"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -923,7 +1024,10 @@
|
|||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["key", "value"]
|
||||
"required": [
|
||||
"key",
|
||||
"value"
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalFlowiseConfiguration": {
|
||||
|
|
@ -942,7 +1046,10 @@
|
|||
"description": "Configuration Property value"
|
||||
}
|
||||
},
|
||||
"required": ["key", "value"]
|
||||
"required": [
|
||||
"key",
|
||||
"value"
|
||||
]
|
||||
}
|
||||
},
|
||||
"model": {
|
||||
|
|
@ -1032,7 +1139,9 @@
|
|||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["default"]
|
||||
"required": [
|
||||
"default"
|
||||
]
|
||||
},
|
||||
"SlashCommand": {
|
||||
"title": "SlashCommand",
|
||||
|
|
@ -1091,7 +1200,9 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": ["issue"]
|
||||
"enum": [
|
||||
"issue"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -1104,17 +1215,23 @@
|
|||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -1139,7 +1256,9 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": ["share"]
|
||||
"enum": [
|
||||
"share"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -1157,7 +1276,10 @@
|
|||
}
|
||||
}
|
||||
],
|
||||
"required": ["name", "description"]
|
||||
"required": [
|
||||
"name",
|
||||
"description"
|
||||
]
|
||||
},
|
||||
"CustomCommand": {
|
||||
"title": "CustomCommand",
|
||||
|
|
@ -1176,7 +1298,11 @@
|
|||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["name", "prompt", "description"]
|
||||
"required": [
|
||||
"name",
|
||||
"prompt",
|
||||
"description"
|
||||
]
|
||||
},
|
||||
"ContextProviderWithParams": {
|
||||
"title": "ContextProviderWithParams",
|
||||
|
|
@ -1249,7 +1375,9 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": ["google"]
|
||||
"enum": [
|
||||
"google"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -1262,17 +1390,23 @@
|
|||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -1294,7 +1428,9 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": ["issue"]
|
||||
"enum": [
|
||||
"issue"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -1323,24 +1459,37 @@
|
|||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -1358,7 +1507,11 @@
|
|||
"connection_type": {
|
||||
"type": "string",
|
||||
"description": "The type of database (e.g., 'postgres', 'mysql')",
|
||||
"enum": ["postgres", "mysql", "sqlite"]
|
||||
"enum": [
|
||||
"postgres",
|
||||
"mysql",
|
||||
"sqlite"
|
||||
]
|
||||
},
|
||||
"connection": {
|
||||
"type": "object",
|
||||
|
|
@ -1391,17 +1544,25 @@
|
|||
"required": []
|
||||
}
|
||||
},
|
||||
"required": ["name", "type", "connection"]
|
||||
"required": [
|
||||
"name",
|
||||
"type",
|
||||
"connection"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["connections"]
|
||||
"required": [
|
||||
"connections"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": ["gitlab-mr"]
|
||||
"enum": [
|
||||
"gitlab-mr"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -1422,17 +1583,23 @@
|
|||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -1478,17 +1645,24 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"required": ["domain", "token"]
|
||||
"required": [
|
||||
"domain",
|
||||
"token"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["params"]
|
||||
"required": [
|
||||
"params"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": ["http"]
|
||||
"enum": [
|
||||
"http"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -1501,17 +1675,24 @@
|
|||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -1546,7 +1727,9 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": ["postgres"]
|
||||
"enum": [
|
||||
"postgres"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -1598,11 +1781,19 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"required": ["host", "port", "user", "password", "database"]
|
||||
"required": [
|
||||
"host",
|
||||
"port",
|
||||
"user",
|
||||
"password",
|
||||
"database"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"required": ["name"]
|
||||
"required": [
|
||||
"name"
|
||||
]
|
||||
},
|
||||
"SerializedContinueConfig": {
|
||||
"title": "config.json",
|
||||
|
|
@ -1753,32 +1944,46 @@
|
|||
"$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"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -1789,22 +1994,33 @@
|
|||
"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": {
|
||||
|
|
@ -1826,7 +2042,9 @@
|
|||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["apiKey"]
|
||||
"required": [
|
||||
"apiKey"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1835,10 +2053,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": ["llm"]
|
||||
"enum": [
|
||||
"llm"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["name"]
|
||||
"required": [
|
||||
"name"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -1849,7 +2071,9 @@
|
|||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["modelTitle"]
|
||||
"required": [
|
||||
"modelTitle"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1858,10 +2082,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": ["voyage"]
|
||||
"enum": [
|
||||
"voyage"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["name"]
|
||||
"required": [
|
||||
"name"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -1872,10 +2100,14 @@
|
|||
"type": "string"
|
||||
},
|
||||
"model": {
|
||||
"enum": ["rerank-lite-1"]
|
||||
"enum": [
|
||||
"rerank-lite-1"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["apiKey"]
|
||||
"required": [
|
||||
"apiKey"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1931,7 +2163,11 @@
|
|||
"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": {
|
||||
|
|
@ -1960,7 +2196,10 @@
|
|||
"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."
|
||||
},
|
||||
|
|
@ -1977,7 +2216,9 @@
|
|||
"defaultContext": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"enum": ["activeFile"]
|
||||
"enum": [
|
||||
"activeFile"
|
||||
]
|
||||
}
|
||||
},
|
||||
"modelRoles": {
|
||||
|
|
@ -2017,7 +2258,10 @@
|
|||
},
|
||||
"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."
|
||||
|
|
@ -2025,4 +2269,4 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -138,6 +138,7 @@ export class VsCodeWebviewProtocol
|
|||
if (message.includes("exceeded")) {
|
||||
message +=
|
||||
" To keep using Continue, you can set up a local model or use your own API key.";
|
||||
} else if (message.includes("upgrade Continue")) {
|
||||
} else {
|
||||
message +=
|
||||
" To avoid rate limiting, you can set up a local model or use your own API key.";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue