return the full result from the model
This commit is contained in:
parent
6ae1fb578e
commit
3d359476e9
1 changed files with 5 additions and 10 deletions
|
|
@ -18,9 +18,7 @@ import {
|
|||
AutocompleteInput,
|
||||
AutocompleteOutcome,
|
||||
} from "../autocomplete/util/types.js";
|
||||
import { myersDiff } from "../diff/myers.js";
|
||||
import { replaceEscapedCharacters } from "../util/text.js";
|
||||
import { getRenderableDiff } from "./diff/diff.js";
|
||||
import {
|
||||
Prompt,
|
||||
renderDefaultSystemPrompt,
|
||||
|
|
@ -301,19 +299,16 @@ export class NextEditProvider {
|
|||
const msg: ChatMessage = await llm.chat(prompts, token);
|
||||
if (typeof msg.content === "string") {
|
||||
const nextCompletion = replaceEscapedCharacters(
|
||||
msg.content
|
||||
.split("<|editable_region_start|>\n")[1]
|
||||
.slice(1)
|
||||
.slice(0, -2),
|
||||
msg.content.split("<|editable_region_start|>\n")[1],
|
||||
);
|
||||
|
||||
const diffLines = myersDiff(helper.fileContents, nextCompletion);
|
||||
// const diffLines = myersDiff(helper.fileContents, nextCompletion);
|
||||
|
||||
const diff = getRenderableDiff(diffLines);
|
||||
// const diff = getRenderableDiff(diffLines);
|
||||
|
||||
const outcomeNext: AutocompleteOutcome = {
|
||||
time: Date.now() - startTime,
|
||||
completion: diff,
|
||||
completion: nextCompletion,
|
||||
prefix: "",
|
||||
suffix: "",
|
||||
prompt: "",
|
||||
|
|
@ -322,7 +317,7 @@ export class NextEditProvider {
|
|||
completionOptions: null,
|
||||
cacheHit: false,
|
||||
filepath: helper.filepath,
|
||||
numLines: diff.split("\n").length,
|
||||
numLines: nextCompletion.split("\n").length,
|
||||
completionId: helper.input.completionId,
|
||||
gitRepo: await this.ide.getRepoName(helper.filepath),
|
||||
uniqueId: await this.ide.getUniqueId(),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue