mirror of
https://github.com/Z3Prover/z3
synced 2025-10-10 09:48:05 +00:00
add retry, rename to optibot
This commit is contained in:
parent
6b9ce8638f
commit
0cf2b5f515
2 changed files with 76 additions and 24 deletions
20
genaisrc/optibot.genai.mts
Normal file
20
genaisrc/optibot.genai.mts
Normal file
|
@ -0,0 +1,20 @@
|
|||
|
||||
script({
|
||||
title: "optimize functions in a file",
|
||||
files: "src/muz/spacer/spacer_qe_project.cpp"
|
||||
})
|
||||
|
||||
import { splitFunctions, invokeLLMOpt, mergeFunctionsFromList, mergeCompileFunction} from "./myai.genai.mts";
|
||||
|
||||
const inputFile = env.files[0];
|
||||
let funs = await splitFunctions(inputFile);
|
||||
let new_code = inputFile.content;
|
||||
for (const fun of funs) {
|
||||
if (fun.code.length < 200) // don't sweat the small stuff
|
||||
continue;
|
||||
let answer = await invokeLLMOpt(fun.code);
|
||||
if (answer)
|
||||
new_code = await mergeCompileFunction(inputFile, new_code, funs, answer);
|
||||
}
|
||||
|
||||
await workspace.writeText(inputFile.filename + ".opt.cpp", new_code);
|
Loading…
Add table
Add a link
Reference in a new issue