mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-04-20 17:46:47 +00:00
Formatting
This commit is contained in:
parent
ea35bd1354
commit
1389e1211e
7 changed files with 38442 additions and 25847 deletions
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
|
@ -1,7 +1,5 @@
|
|||
|
||||
# Summary | Résumé
|
||||
|
||||
|
||||
> 1-3 sentence description of the changed you're proposing, including a link to
|
||||
> a GitHub Issue # or Trello card if applicable.
|
||||
|
||||
|
|
30583
dist/index.js
vendored
30583
dist/index.js
vendored
File diff suppressed because one or more lines are too long
2352
dist/sourcemap-register.js
vendored
2352
dist/sourcemap-register.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,4 @@
|
|||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"local>cds-snc/renovate-config"
|
||||
]
|
||||
}
|
||||
"extends": ["local>cds-snc/renovate-config"]
|
||||
}
|
||||
|
|
16
src/main.ts
16
src/main.ts
|
@ -16,12 +16,12 @@ const OPENAI_BASE_URL: string = core.getInput("OPENAI_BASE_URL"); // Keep the de
|
|||
const debugHttp: string | undefined = process.env.DEBUG_HTTP;
|
||||
if (debugHttp) {
|
||||
// Intercept all HTTP requests
|
||||
const nock = require('nock');
|
||||
const nock = require("nock");
|
||||
nock.recorder.rec({
|
||||
output_objects: true,
|
||||
logging: (content: any) => {
|
||||
console.log('HTTP Request:', content);
|
||||
}
|
||||
console.log("HTTP Request:", content);
|
||||
},
|
||||
});
|
||||
console.log("HTTP calls interception enabled");
|
||||
}
|
||||
|
@ -107,7 +107,8 @@ function createPrompt(file: File, chunk: Chunk, prDetails: PRDetails): string {
|
|||
- Use the given description only for the overall context and only comment the code.
|
||||
- IMPORTANT: NEVER suggest adding comments to the code.
|
||||
|
||||
Review the following code diff in the file "${file.to
|
||||
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}
|
||||
|
@ -146,7 +147,8 @@ async function getAIResponse(prompt: string): Promise<Array<{
|
|||
const response = await openai.chat.completions.create({
|
||||
...queryConfig,
|
||||
// return JSON if the model supports it:
|
||||
...(OPENAI_API_MODEL === "gpt-4-1106-preview" || OPENAI_API_MODEL === "gpt-4o"
|
||||
...(OPENAI_API_MODEL === "gpt-4-1106-preview" ||
|
||||
OPENAI_API_MODEL === "gpt-4o"
|
||||
? { response_format: { type: "json_object" } }
|
||||
: {}),
|
||||
messages: [
|
||||
|
@ -229,7 +231,9 @@ async function main() {
|
|||
|
||||
diff = String(response.data);
|
||||
} else {
|
||||
console.log(`Unsupported event: action=${eventData.action}, process.env.GITHUB_EVENT_NAME=${process.env.GITHUB_EVENT_NAME}`);
|
||||
console.log(
|
||||
`Unsupported event: action=${eventData.action}, process.env.GITHUB_EVENT_NAME=${process.env.GITHUB_EVENT_NAME}`
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue