feat: split diff
This commit is contained in:
parent
db88b285fe
commit
b7defc8d91
3 changed files with 3 additions and 3 deletions
|
|
@ -13,7 +13,7 @@ const CommitMessageCommand: SlashCommand = {
|
|||
return;
|
||||
}
|
||||
|
||||
const prompt = `${diff}\n\nGenerate a commit message for the above set of changes. First, give a single sentence, no more than 80 characters. Then, after 2 line breaks, give a list of no more than 5 short bullet points, each no more than 40 characters. Output nothing except for the commit message, and don't surround it in quotes.`;
|
||||
const prompt = `${diff.joing("\n")}\n\nGenerate a commit message for the above set of changes. First, give a single sentence, no more than 80 characters. Then, after 2 line breaks, give a list of no more than 5 short bullet points, each no more than 40 characters. Output nothing except for the commit message, and don't surround it in quotes.`;
|
||||
for await (const chunk of llm.streamChat(
|
||||
[{ role: "user", content: prompt }],
|
||||
new AbortController().signal,
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class DiffContextProvider extends BaseContextProvider {
|
|||
content:
|
||||
diff.length === 0
|
||||
? "Git shows no current changes."
|
||||
: `\`\`\`git diff\n${diff}\n\`\`\``,
|
||||
: `\`\`\`git diff\n${diff.join("\n")}\n\`\`\``,
|
||||
name: "Git Diff",
|
||||
},
|
||||
];
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ describe("IDE Utils", () => {
|
|||
|
||||
test("noDiff", async () => {
|
||||
const noDiff = await utils.getDiff(false);
|
||||
assert(noDiff === "");
|
||||
assert(noDiff.length === 0);
|
||||
});
|
||||
|
||||
test.skip("getBranch", async () => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue