🔊 log completion options in ~/.continue/sessions
This commit is contained in:
parent
c3971a472e
commit
4160ca6b50
11 changed files with 416 additions and 135 deletions
|
|
@ -42,7 +42,7 @@ export class Core {
|
|||
this.configHandler = new ConfigHandler(
|
||||
this.ide,
|
||||
ideSettingsPromise,
|
||||
(text: string) => {},
|
||||
async (text: string) => {},
|
||||
(() => this.messenger.send("configUpdate", undefined)).bind(this),
|
||||
);
|
||||
this.codebaseIndexer = new CodebaseIndexer(
|
||||
|
|
@ -197,7 +197,14 @@ export class Core {
|
|||
while (!next.done) {
|
||||
if (abortedMessageIds.has(msg.messageId)) {
|
||||
abortedMessageIds.delete(msg.messageId);
|
||||
next = await gen.return({ completion: "", prompt: "" });
|
||||
next = await gen.return({
|
||||
completion: "",
|
||||
prompt: "",
|
||||
completionOptions: {
|
||||
...msg.data.completionOptions,
|
||||
model: model.model,
|
||||
},
|
||||
});
|
||||
break;
|
||||
}
|
||||
yield { content: next.value.content };
|
||||
|
|
@ -226,7 +233,14 @@ export class Core {
|
|||
while (!next.done) {
|
||||
if (abortedMessageIds.has(msg.messageId)) {
|
||||
abortedMessageIds.delete(msg.messageId);
|
||||
next = await gen.return({ completion: "", prompt: "" });
|
||||
next = await gen.return({
|
||||
completion: "",
|
||||
prompt: "",
|
||||
completionOptions: {
|
||||
...msg.data.completionOptions,
|
||||
model: model.model,
|
||||
},
|
||||
});
|
||||
break;
|
||||
}
|
||||
yield { content: next.value };
|
||||
|
|
|
|||
17
core/index.d.ts
vendored
17
core/index.d.ts
vendored
|
|
@ -39,11 +39,6 @@ export interface IndexingProgressUpdate {
|
|||
desc: string;
|
||||
}
|
||||
|
||||
export interface LLMReturnValue {
|
||||
prompt: string;
|
||||
completion: string;
|
||||
}
|
||||
|
||||
export type PromptTemplate =
|
||||
| string
|
||||
| ((
|
||||
|
|
@ -80,12 +75,12 @@ export interface ILLM extends LLMOptions {
|
|||
streamComplete(
|
||||
prompt: string,
|
||||
options?: LLMFullCompletionOptions,
|
||||
): AsyncGenerator<string, LLMReturnValue>;
|
||||
): AsyncGenerator<string, PromptLog>;
|
||||
|
||||
streamChat(
|
||||
messages: ChatMessage[],
|
||||
options?: LLMFullCompletionOptions,
|
||||
): AsyncGenerator<ChatMessage, LLMReturnValue>;
|
||||
): AsyncGenerator<ChatMessage, PromptLog>;
|
||||
|
||||
chat(
|
||||
messages: ChatMessage[],
|
||||
|
|
@ -258,12 +253,18 @@ export interface InputModifiers {
|
|||
noContext: boolean;
|
||||
}
|
||||
|
||||
export interface PromptLog {
|
||||
completionOptions: CompletionOptions;
|
||||
prompt: string;
|
||||
completion: string;
|
||||
}
|
||||
|
||||
export interface ChatHistoryItem {
|
||||
message: ChatMessage;
|
||||
editorState?: any;
|
||||
modifiers?: InputModifiers;
|
||||
contextItems: ContextItemWithId[];
|
||||
promptLogs?: [string, string][]; // [prompt, completion]
|
||||
promptLogs?: PromptLog[];
|
||||
}
|
||||
|
||||
export type ChatHistory = ChatHistoryItem[];
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ import {
|
|||
ILLM,
|
||||
LLMFullCompletionOptions,
|
||||
LLMOptions,
|
||||
LLMReturnValue,
|
||||
ModelName,
|
||||
ModelProvider,
|
||||
PromptLog,
|
||||
PromptTemplate,
|
||||
RequestOptions,
|
||||
TemplateType,
|
||||
|
|
@ -340,7 +340,7 @@ ${prompt}`;
|
|||
await this.writeLog(`Completion:\n\n${completion}\n\n`);
|
||||
}
|
||||
|
||||
return { prompt, completion };
|
||||
return { prompt, completion, completionOptions };
|
||||
}
|
||||
|
||||
async complete(prompt: string, options: LLMFullCompletionOptions = {}) {
|
||||
|
|
@ -388,7 +388,7 @@ ${prompt}`;
|
|||
async *streamChat(
|
||||
messages: ChatMessage[],
|
||||
options: LLMFullCompletionOptions = {},
|
||||
): AsyncGenerator<ChatMessage, LLMReturnValue> {
|
||||
): AsyncGenerator<ChatMessage, PromptLog> {
|
||||
const { completionOptions, log, raw } =
|
||||
this._parseCompletionOptions(options);
|
||||
|
||||
|
|
@ -436,7 +436,11 @@ ${prompt}`;
|
|||
await this.writeLog(`Completion:\n\n${completion}\n\n`);
|
||||
}
|
||||
|
||||
return { prompt, completion };
|
||||
return {
|
||||
prompt,
|
||||
completion,
|
||||
completionOptions,
|
||||
};
|
||||
}
|
||||
|
||||
protected async *_streamComplete(
|
||||
|
|
|
|||
|
|
@ -265,7 +265,10 @@
|
|||
"apiType": {
|
||||
"title": "Api Type",
|
||||
"markdownDescription": "OpenAI API type, either `openai` or `azure`",
|
||||
"enum": ["openai", "azure"]
|
||||
"enum": [
|
||||
"openai",
|
||||
"azure"
|
||||
]
|
||||
},
|
||||
"apiVersion": {
|
||||
"title": "Api Version",
|
||||
|
|
@ -278,7 +281,11 @@
|
|||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["title", "provider", "model"],
|
||||
"required": [
|
||||
"title",
|
||||
"provider",
|
||||
"model"
|
||||
],
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
|
|
@ -288,7 +295,9 @@
|
|||
}
|
||||
},
|
||||
"not": {
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
|
|
@ -314,33 +323,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": {
|
||||
|
|
@ -360,10 +384,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["openai"]
|
||||
"enum": [
|
||||
"openai"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -393,10 +421,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["replicate"]
|
||||
"enum": [
|
||||
"replicate"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -426,10 +458,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["free-trial"]
|
||||
"enum": [
|
||||
"free-trial"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -456,7 +492,9 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["openai"]
|
||||
"enum": [
|
||||
"openai"
|
||||
]
|
||||
},
|
||||
"apiType": {
|
||||
"not": {
|
||||
|
|
@ -464,7 +502,9 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -521,10 +561,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["anthropic"]
|
||||
"enum": [
|
||||
"anthropic"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -552,15 +596,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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -569,10 +620,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["bedrock"]
|
||||
"enum": [
|
||||
"bedrock"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -597,10 +652,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["gemini"]
|
||||
"enum": [
|
||||
"gemini"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -618,10 +677,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["together"]
|
||||
"enum": [
|
||||
"together"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -655,10 +718,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["deepinfra"]
|
||||
"enum": [
|
||||
"deepinfra"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -681,7 +748,9 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -727,10 +796,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["ollama"]
|
||||
"enum": [
|
||||
"ollama"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -778,10 +851,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["mistral"]
|
||||
"enum": [
|
||||
"mistral"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -802,10 +879,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["groq"]
|
||||
"enum": [
|
||||
"groq"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -829,20 +910,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": {
|
||||
|
|
@ -859,7 +950,9 @@
|
|||
"const": "llamafile"
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -873,10 +966,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["text-gen-webui"]
|
||||
"enum": [
|
||||
"text-gen-webui"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -890,10 +987,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"enum": ["flowise"]
|
||||
"enum": [
|
||||
"flowise"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
"required": [
|
||||
"provider"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -920,7 +1021,10 @@
|
|||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["key", "value"]
|
||||
"required": [
|
||||
"key",
|
||||
"value"
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalFlowiseConfiguration": {
|
||||
|
|
@ -939,7 +1043,10 @@
|
|||
"description": "Configuration Property value"
|
||||
}
|
||||
},
|
||||
"required": ["key", "value"]
|
||||
"required": [
|
||||
"key",
|
||||
"value"
|
||||
]
|
||||
}
|
||||
},
|
||||
"model": {
|
||||
|
|
@ -1027,7 +1134,9 @@
|
|||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["default"]
|
||||
"required": [
|
||||
"default"
|
||||
]
|
||||
},
|
||||
"SlashCommand": {
|
||||
"title": "SlashCommand",
|
||||
|
|
@ -1086,7 +1195,9 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": ["issue"]
|
||||
"enum": [
|
||||
"issue"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -1099,17 +1210,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"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -1134,7 +1251,9 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": ["share"]
|
||||
"enum": [
|
||||
"share"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -1152,7 +1271,10 @@
|
|||
}
|
||||
}
|
||||
],
|
||||
"required": ["name", "description"]
|
||||
"required": [
|
||||
"name",
|
||||
"description"
|
||||
]
|
||||
},
|
||||
"CustomCommand": {
|
||||
"title": "CustomCommand",
|
||||
|
|
@ -1171,7 +1293,11 @@
|
|||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["name", "prompt", "description"]
|
||||
"required": [
|
||||
"name",
|
||||
"prompt",
|
||||
"description"
|
||||
]
|
||||
},
|
||||
"ContextProviderWithParams": {
|
||||
"title": "ContextProviderWithParams",
|
||||
|
|
@ -1244,7 +1370,9 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": ["google"]
|
||||
"enum": [
|
||||
"google"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -1257,17 +1385,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"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -1289,7 +1423,9 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": ["issue"]
|
||||
"enum": [
|
||||
"issue"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -1318,24 +1454,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"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -1353,7 +1502,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",
|
||||
|
|
@ -1386,17 +1539,25 @@
|
|||
"required": []
|
||||
}
|
||||
},
|
||||
"required": ["name", "type", "connection"]
|
||||
"required": [
|
||||
"name",
|
||||
"type",
|
||||
"connection"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["connections"]
|
||||
"required": [
|
||||
"connections"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": ["gitlab-mr"]
|
||||
"enum": [
|
||||
"gitlab-mr"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -1417,17 +1578,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"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -1473,17 +1640,24 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"required": ["domain", "token"]
|
||||
"required": [
|
||||
"domain",
|
||||
"token"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["params"]
|
||||
"required": [
|
||||
"params"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": ["http"]
|
||||
"enum": [
|
||||
"http"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -1496,17 +1670,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"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -1541,7 +1722,9 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": ["postgres"]
|
||||
"enum": [
|
||||
"postgres"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -1593,11 +1776,19 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"required": ["host", "port", "user", "password", "database"]
|
||||
"required": [
|
||||
"host",
|
||||
"port",
|
||||
"user",
|
||||
"password",
|
||||
"database"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"required": ["name"]
|
||||
"required": [
|
||||
"name"
|
||||
]
|
||||
},
|
||||
"SerializedContinueConfig": {
|
||||
"title": "config.json",
|
||||
|
|
@ -1748,32 +1939,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"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -1784,22 +1989,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": {
|
||||
|
|
@ -1821,7 +2037,9 @@
|
|||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["apiKey"]
|
||||
"required": [
|
||||
"apiKey"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1830,10 +2048,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": ["llm"]
|
||||
"enum": [
|
||||
"llm"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["name"]
|
||||
"required": [
|
||||
"name"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -1844,7 +2066,9 @@
|
|||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["modelTitle"]
|
||||
"required": [
|
||||
"modelTitle"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1853,10 +2077,14 @@
|
|||
"if": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"enum": ["voyage"]
|
||||
"enum": [
|
||||
"voyage"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["name"]
|
||||
"required": [
|
||||
"name"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
|
|
@ -1867,10 +2095,14 @@
|
|||
"type": "string"
|
||||
},
|
||||
"model": {
|
||||
"enum": ["rerank-lite-1"]
|
||||
"enum": [
|
||||
"rerank-lite-1"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["apiKey"]
|
||||
"required": [
|
||||
"apiKey"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1926,7 +2158,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": {
|
||||
|
|
@ -1955,7 +2191,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."
|
||||
}
|
||||
|
|
@ -2003,7 +2242,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."
|
||||
|
|
@ -2011,4 +2253,4 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
2
extensions/vscode/package-lock.json
generated
2
extensions/vscode/package-lock.json
generated
|
|
@ -116,7 +116,7 @@
|
|||
"ollama": "^0.4.6",
|
||||
"openai": "^4.20.1",
|
||||
"pg": "^8.11.3",
|
||||
"posthog-node": "^3.6.2",
|
||||
"posthog-node": "^3.6.3",
|
||||
"replicate": "^0.26.0",
|
||||
"request": "^2.88.2",
|
||||
"socket.io-client": "^4.7.3",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { Chunk, IDE } from "core";
|
||||
import { languageForFilepath } from "core/autocomplete/constructPrompt";
|
||||
import { DEFAULT_IGNORE_DIRS } from "core/indexing/ignore";
|
||||
import { deduplicateArray } from "core/util";
|
||||
import { getParserForFile } from "core/util/treeSitter";
|
||||
|
|
@ -49,7 +50,12 @@ export async function expandSnippet(
|
|||
let callExpressionDefinitions = (
|
||||
await Promise.all(
|
||||
callExpressions.map(async (node) => {
|
||||
return getDefinitionsForNode(filepath, node);
|
||||
return getDefinitionsForNode(
|
||||
filepath,
|
||||
node,
|
||||
ide,
|
||||
languageForFilepath(filepath),
|
||||
);
|
||||
}),
|
||||
)
|
||||
).flat();
|
||||
|
|
|
|||
|
|
@ -365,7 +365,14 @@ export class VsCodeWebviewProtocol {
|
|||
while (!next.done) {
|
||||
if (protocol.abortedMessageIds.has(msg.messageId)) {
|
||||
protocol.abortedMessageIds.delete(msg.messageId);
|
||||
next = await gen.return({ completion: "", prompt: "" });
|
||||
next = await gen.return({
|
||||
completion: "",
|
||||
prompt: "",
|
||||
completionOptions: {
|
||||
...msg.data.completionOptions,
|
||||
model: model.model,
|
||||
},
|
||||
});
|
||||
break;
|
||||
}
|
||||
yield { content: next.value };
|
||||
|
|
@ -389,7 +396,14 @@ export class VsCodeWebviewProtocol {
|
|||
while (!next.done) {
|
||||
if (protocol.abortedMessageIds.has(msg.messageId)) {
|
||||
protocol.abortedMessageIds.delete(msg.messageId);
|
||||
next = await gen.return({ completion: "", prompt: "" });
|
||||
next = await gen.return({
|
||||
completion: "",
|
||||
prompt: "",
|
||||
completionOptions: {
|
||||
...msg.data.completionOptions,
|
||||
model: model.model,
|
||||
},
|
||||
});
|
||||
break;
|
||||
}
|
||||
yield { content: next.value.content };
|
||||
|
|
|
|||
|
|
@ -73,10 +73,10 @@ function StepContainer(props: StepContainerProps) {
|
|||
const sendFeedback = (feedback: boolean) => {
|
||||
setFeedback(feedback);
|
||||
if (props.item.promptLogs?.length) {
|
||||
for (const [prompt, completion] of props.item.promptLogs) {
|
||||
for (const promptLog of props.item.promptLogs) {
|
||||
postToIde("devdata/log", {
|
||||
tableName: "chat",
|
||||
data: { prompt, completion, feedback },
|
||||
data: { ...promptLog, feedback },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ import {
|
|||
ChatHistoryItem,
|
||||
ChatMessage,
|
||||
InputModifiers,
|
||||
LLMReturnValue,
|
||||
MessageContent,
|
||||
PromptLog,
|
||||
RangeInFile,
|
||||
SlashCommandDescription,
|
||||
} from "core";
|
||||
|
|
@ -71,11 +71,9 @@ function useChatHandler(dispatch: Dispatch) {
|
|||
next = await gen.next();
|
||||
}
|
||||
|
||||
let returnVal = next.value as LLMReturnValue;
|
||||
let returnVal = next.value as PromptLog;
|
||||
if (returnVal) {
|
||||
dispatch(
|
||||
addPromptCompletionPair([[returnVal?.prompt, returnVal?.completion]]),
|
||||
);
|
||||
dispatch(addPromptCompletionPair([returnVal]));
|
||||
}
|
||||
} catch (e) {
|
||||
// If there's an error, we should clear the response so there aren't two input boxes
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import {
|
|||
ContextItemId,
|
||||
ContextItemWithId,
|
||||
PersistedSessionInfo,
|
||||
PromptLog,
|
||||
} from "core";
|
||||
import { BrowserSerializedContinueConfig } from "core/config/load";
|
||||
import { stripImages } from "core/llm/countTokens";
|
||||
|
|
@ -142,7 +143,7 @@ export const stateSlice = createSlice({
|
|||
},
|
||||
addPromptCompletionPair: (
|
||||
state,
|
||||
{ payload }: PayloadAction<[string, string][]>,
|
||||
{ payload }: PayloadAction<PromptLog[]>,
|
||||
) => {
|
||||
if (!state.history.length) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { ChatMessage, LLMFullCompletionOptions, LLMReturnValue } from "core";
|
||||
import { ChatMessage, LLMFullCompletionOptions, PromptLog } from "core";
|
||||
import { Message } from "core/util/messenger";
|
||||
import {
|
||||
ReverseWebviewProtocol,
|
||||
|
|
@ -155,7 +155,7 @@ export async function* llmStreamChat(
|
|||
cancelToken: AbortSignal | undefined,
|
||||
messages: ChatMessage[],
|
||||
options: LLMFullCompletionOptions = {},
|
||||
): AsyncGenerator<ChatMessage, LLMReturnValue> {
|
||||
): AsyncGenerator<ChatMessage, PromptLog> {
|
||||
const gen = ideStreamRequest(
|
||||
"llm/streamChat",
|
||||
{
|
||||
|
|
@ -179,6 +179,7 @@ export async function* llmStreamChat(
|
|||
return {
|
||||
prompt: next.value.content?.prompt,
|
||||
completion: next.value.content?.completion,
|
||||
completionOptions: next.value.content?.completionOptions,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue