predicted completions for Edit and Apply
This commit is contained in:
parent
aca7a7a4f0
commit
0fac5aad1f
2 changed files with 11 additions and 9 deletions
|
|
@ -8,12 +8,7 @@ import {
|
|||
} from "../autocomplete/streamTransforms/lineStream.js";
|
||||
import { streamDiff } from "../diff/streamDiff.js";
|
||||
import { streamLines } from "../diff/util.js";
|
||||
import {
|
||||
ChatMessage,
|
||||
DiffLine,
|
||||
ILLM,
|
||||
LLMFullCompletionOptions,
|
||||
} from "../index.js";
|
||||
import { ChatMessage, DiffLine, ILLM, Prediction } from "../index.js";
|
||||
import { gptEditPrompt } from "../llm/templates/edit.js";
|
||||
import { Telemetry } from "../util/posthog.js";
|
||||
|
||||
|
|
@ -94,10 +89,17 @@ export async function* streamDiffLines(
|
|||
);
|
||||
const inept = modelIsInept(llm.model);
|
||||
|
||||
const prediction: Prediction = {
|
||||
type: "content",
|
||||
content: highlighted,
|
||||
};
|
||||
|
||||
const completion =
|
||||
typeof prompt === "string"
|
||||
? llm.streamComplete(prompt, { raw: true })
|
||||
: llm.streamChat(prompt);
|
||||
? llm.streamComplete(prompt, { raw: true, prediction })
|
||||
: llm.streamChat(prompt, {
|
||||
prediction,
|
||||
});
|
||||
|
||||
let lines = streamLines(completion);
|
||||
|
||||
|
|
|
|||
2
extensions/vscode/package-lock.json
generated
2
extensions/vscode/package-lock.json
generated
|
|
@ -12599,4 +12599,4 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue