feat: add filepath to apply prompt template vars
This commit is contained in:
parent
3a4c6c310d
commit
fc4828d010
1 changed files with 3 additions and 0 deletions
|
|
@ -13,6 +13,7 @@ import { VsCodeWebviewProtocol } from "../../webviewProtocol";
|
|||
import { ApplyAbortManager } from "core/edit/applyAbortManager";
|
||||
import { EDIT_MODE_STREAM_ID } from "core/edit/constants";
|
||||
import { stripImages } from "core/util/messageContent";
|
||||
import { getLastNPathParts } from "core/util/uri";
|
||||
import { editOutcomeTracker } from "../../extension/EditOutcomeTracker";
|
||||
import { VerticalDiffHandler, VerticalDiffHandlerOptions } from "./handler";
|
||||
|
||||
|
|
@ -432,9 +433,11 @@ export class VerticalDiffManager {
|
|||
|
||||
let overridePrompt: ChatMessage[] | undefined;
|
||||
if (llm.promptTemplates?.apply) {
|
||||
const filepath = getLastNPathParts(fileUri, 1);
|
||||
const rendered = llm.renderPromptTemplate(llm.promptTemplates.apply, [], {
|
||||
original_code: rangeContent,
|
||||
new_code: newCode ?? "",
|
||||
filepath,
|
||||
});
|
||||
overridePrompt =
|
||||
typeof rendered === "string"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue