mirror of
https://github.com/Z3Prover/z3
synced 2025-07-03 11:25:40 +00:00
add outputs
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
c46f7aeb4c
commit
253e44faf8
1 changed files with 7 additions and 6 deletions
|
@ -7,7 +7,7 @@ script({
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
|
||||||
const directoryPath = "code_slices";
|
|
||||||
|
|
||||||
async function invokeLLMCompletion(code, prefix) {
|
async function invokeLLMCompletion(code, prefix) {
|
||||||
|
|
||||||
|
@ -84,8 +84,9 @@ async function invokeLLMAnalyzer(code, inputFilename, funcName) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const input_directory = "code_slices";
|
||||||
const code_slice_files = fs.readdirSync(directoryPath);
|
const output_directory = "code_slices_analyzed";
|
||||||
|
const code_slice_files = fs.readdirSync(input_directory);
|
||||||
|
|
||||||
let count = 0;
|
let count = 0;
|
||||||
for (const file of code_slice_files) {
|
for (const file of code_slice_files) {
|
||||||
|
@ -102,13 +103,13 @@ for (const file of code_slice_files) {
|
||||||
const [_, prefix, fileName, funcName] = match;
|
const [_, prefix, fileName, funcName] = match;
|
||||||
|
|
||||||
|
|
||||||
const filePath = path.join(directoryPath, file);
|
const filePath = path.join(input_directory, file);
|
||||||
const content = await workspace.readText(filePath);
|
const content = await workspace.readText(filePath);
|
||||||
const answer1 = await invokeLLMCompletion(content.content, fileName);
|
const answer1 = await invokeLLMCompletion(content.content, fileName);
|
||||||
const answer2 = await invokeLLMAnalyzer(answer1, fileName, funcName);
|
const answer2 = await invokeLLMAnalyzer(answer1, fileName, funcName);
|
||||||
|
const outputFilePath = path.join(output_directory, fileName + "_" + funcName + ".md");
|
||||||
|
await workspace.writeText(outputFilePath, answer2);
|
||||||
++count;
|
++count;
|
||||||
if (count > 3)
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue