autoheal
Version:
GPT Test driven development. Automatically fix tests and guide GPT to write and fix code using your tests.
29 lines (28 loc) • 1.44 kB
JavaScript
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
import { prompt } from "./prompt.js";
export function explainTestResults(testDetails, model) {
return __awaiter(this, void 0, void 0, function* () {
const explanation = yield prompt([
{
role: "system",
content: "You are a programming assisstant ",
},
{
role: "user",
content: "Test run results:\n```" +
testDetails.slice(model === "gpt-4" ? -2000 : -1200) +
"\n```\n" +
"Respond very briefly describing the possible issues with the tests. Be extremely clear and brief. Use lists and bullet points symbols (not stars)",
},
], model);
return explanation;
});
}