Skip to content

Commit

Permalink
Update analyzeCompileError to better include files with compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
danielcampagnolitg committed Sep 19, 2024
1 parent abba3c2 commit c955b88
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/swe/analyzeCompileErrors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,19 @@ export async function analyzeCompileErrors(
}
const compileOutputXml = `<compiler_output>\n${compilerOutput}\n</compiler_output>`;

const currentFileList = `<current-files>\n${initialFileSelection.join('\n')}\n</current-files>`;

const instructions =
'The compile errors above need to be analyzed to determine next steps fixing them. You will respond with a JSON object in the format of the example.\n' +
'- Include a brief summary of the compile issues in the "compileIssuesSummary" property.\n' +
'- If addtional files are required to be added to the context to help fix the issues (for implementation details, interfaces, typings etc. or with compile errors to fix) then set an array of the filenames on the "additionalFiles" property.\n' +
'- If addtional files not in the <current-files> tag are required to be added to the context to help fix the issues (ie. have compile errors to fix in that file, or needed for implementation details, interfaces, typings etc) then set an array of the filenames on the "additionalFiles" property.\n' +
'- If you need to perform research to fix a compile issue (e.g. how to use a library/API, or fix an obscure compiler error) then set a natural language query to search on the "researchQuery" property.\n' +
'- If the compile errors indicate one or more missing packages/modules, then set an array with the missing packages, e.g. ["package1", "package2"], on the "installPackages" property.\n' +
'- If there appears to be an fatal error which can\'t be fixed (e.g. configuration issue, or stuck on the same error multiple times, or a dependant project needs to be updated) that requires human intervention, then set a message describing the problem in the "fatalError" property.\n' +
`Respond with your resoning following by the JSON object that MUST be in the format of this example:
<response_example>
- Analysis of the compile issues
- Reasoning if any additional files need to be added to the context
- Reasoning if any additional files need to be added to the available <file_contents> list which have compile errors or required implementation details
- Reasoning if any web research is required to fix issues
- Reasoning if there is a fatal error
<json>
Expand All @@ -62,7 +64,7 @@ export async function analyzeCompileErrors(
</response_example>`;

// ${fileList}\n
const prompt = `${fileContents}\n${compileErrorHistory}\n${compileOutputXml}\n${instructions}`;
const prompt = `${fileContents}\n${compileErrorHistory}\n${compileOutputXml}\n${currentFileList}\n${instructions}`;
const analysis: CompileErrorAnalysis = await llms().hard.generateJson(prompt, null, {
id: 'analyzeCompileErrors',
});
Expand Down
2 changes: 1 addition & 1 deletion src/swe/documentationBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ export async function getTopLevelSummary(): Promise<string> {

export async function getRepositoryOverview(): Promise<string> {
const repositoryOverview: string = await getTopLevelSummary();
return repositoryOverview ? '<repository-overview>\n${topLevelSummary}\n</repository-overview>\n' : '';
return repositoryOverview ? `<repository-overview>\n${repositoryOverview}\n</repository-overview>\n` : '';
}

async function getParentSummaries(folderPath: string): Promise<Summary[]> {
Expand Down

0 comments on commit c955b88

Please sign in to comment.