generated from ztimson/template
Added PR info as context to AI
This commit is contained in:
@@ -95,7 +95,16 @@ dotenv.config({path: '.env.local', override: true, quiet: true, debug: false});
|
|||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
|
|
||||||
const messages = await ai.language.ask(gitDiff);
|
const messages = await ai.language.ask(`Title: ${info.title}
|
||||||
|
Description:
|
||||||
|
\`\`\`md
|
||||||
|
${info.body}
|
||||||
|
\`\`\`
|
||||||
|
|
||||||
|
Git Diff:
|
||||||
|
\`\`\`
|
||||||
|
${gitDiff}
|
||||||
|
\`\`\``);
|
||||||
const summary = messages.pop().content;
|
const summary = messages.pop().content;
|
||||||
if(git) {
|
if(git) {
|
||||||
const res = await fetch(`${git}/api/v1/repos/${owner}/${repo}/pulls/${pr}/reviews`, {
|
const res = await fetch(`${git}/api/v1/repos/${owner}/${repo}/pulls/${pr}/reviews`, {
|
||||||
|
|||||||
Reference in New Issue
Block a user