3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-26 07:43:41 +00:00
z3/genaisrc/prd.genai.mts
Nikolaj Bjorner ad02d18e63
add prd (#7649)
* add prd

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* missing text

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* fix

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* fix #7647

* fix #7647 - with respect to scope level

---------

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-05-17 17:07:03 -07:00

37 lines
No EOL
1.2 KiB
TypeScript

script({
title: "Pull Request Descriptor",
description: "Generate a description for the current pull request",
systemSafety: true,
parameters: {
base: "",
},
})
const { dbg, vars } = env
const base = vars.base || (await git.defaultBranch())
const changes = await git.diff({
base,
llmify: true,
})
if (!changes) cancel("No changes found in the pull request")
dbg(`changes: %s`, changes)
const gitDiff = def("GIT_DIFF", changes, {
language: "diff",
maxTokens: 14000,
detectPromptInjection: "available",
})
$`## Task
You are an expert code reviewer with great English technical writing skills.
Your task is to generate a high level summary of the changes in ${gitDiff} for a pull request in a way that a software engineer will understand.
This description will be used as the pull request description.
## Instructions
- do NOT explain that GIT_DIFF displays changes in the codebase
- try to extract the intent of the changes, don't focus on the details
- use bullet points to list the changes
- use gitmojis to make the description more engaging
- focus on the most important changes
- do not try to fix issues, only describe the changes
- ignore comments about imports (like added, remove, changed, etc.)`