model param and make file

This commit is contained in:
sadath-12 2023-07-16 09:10:44 +05:30
parent 4509e8d5dc
commit 8a98b9b1ea
3 changed files with 6 additions and 6 deletions

4
dist/index.js vendored
View file

@ -16692,7 +16692,7 @@ function createPrompt(file, chunk, prDetails) {
- Write the comment in GitHub Markdown format. - Write the comment in GitHub Markdown format.
- Use the given description only for the overall context and only comment the code. - Use the given description only for the overall context and only comment the code.
- IMPORTANT: NEVER suggest adding comments to the code. - IMPORTANT: NEVER suggest adding comments to the code.
- If you don't have anything to say just say I dont have anything to say
Review the following code diff in the file "${file.to}" and take the pull request title and description into account when writing the response. Review the following code diff in the file "${file.to}" and take the pull request title and description into account when writing the response.
Pull request title: ${prDetails.title} Pull request title: ${prDetails.title}
@ -16731,7 +16731,7 @@ function getAIResponse(prompt) {
content: prompt, content: prompt,
}, },
] })); ] }));
const res = ((_b = (_a = response.data.choices[0].message) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.trim()) || "[]"; const res = ((_b = (_a = response.data.choices[0].message) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.trim()) || "nothing can be said";
return JSON.parse(res); return JSON.parse(res);
} }
catch (error) { catch (error) {

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View file

@ -104,7 +104,7 @@ function createPrompt(file: File, chunk: Chunk, prDetails: PRDetails): string {
- Write the comment in GitHub Markdown format. - Write the comment in GitHub Markdown format.
- Use the given description only for the overall context and only comment the code. - Use the given description only for the overall context and only comment the code.
- IMPORTANT: NEVER suggest adding comments to the code. - IMPORTANT: NEVER suggest adding comments to the code.
- If you don't have anything to say just say I dont have anything to say
Review the following code diff in the file "${ Review the following code diff in the file "${
file.to file.to
}" and take the pull request title and description into account when writing the response. }" and take the pull request title and description into account when writing the response.
@ -152,7 +152,7 @@ async function getAIResponse(prompt: string): Promise<Array<{
], ],
}); });
const res = response.data.choices[0].message?.content?.trim() || "[]"; const res = response.data.choices[0].message?.content?.trim() || "nothing can be said";
return JSON.parse(res); return JSON.parse(res);
} catch (error) { } catch (error) {
console.error("Error:", error); console.error("Error:", error);
@ -170,7 +170,7 @@ function createComment(
): Array<{ body: string; path: string; line: number }> { ): Array<{ body: string; path: string; line: number }> {
return aiResponses.flatMap((aiResponse) => { return aiResponses.flatMap((aiResponse) => {
if (!file.to) { if (!file.to) {
return []; return []
} }
return { return {
body: aiResponse.reviewComment, body: aiResponse.reviewComment,