if input not templated, render it at the end of slash command
This commit is contained in:
parent
c745378efb
commit
a187ff7dfe
1 changed files with 10 additions and 5 deletions
|
|
@ -20,11 +20,16 @@ export function slashFromCustomCommand(
|
|||
}
|
||||
|
||||
// Render prompt template
|
||||
const promptUserInput = await renderTemplatedString(
|
||||
customCommand.prompt,
|
||||
ide.readFile.bind(ide),
|
||||
{ input: userInput },
|
||||
);
|
||||
let promptUserInput: string;
|
||||
if (customCommand.prompt.includes("{{{ input }}}")) {
|
||||
promptUserInput = await renderTemplatedString(
|
||||
customCommand.prompt,
|
||||
ide.readFile.bind(ide),
|
||||
{ input: userInput },
|
||||
);
|
||||
} else {
|
||||
promptUserInput = customCommand.prompt + "\n\n" + userInput;
|
||||
}
|
||||
|
||||
const messages = [...history];
|
||||
// Find the last chat message with this slash command and replace it with the user input
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue