model param and make file

This commit is contained in:
sadath-12 2023-07-16 08:46:21 +05:30
parent 012d1cdc1a
commit 489f650419
7 changed files with 1883 additions and 1855 deletions

View file

@ -16,4 +16,5 @@ jobs:
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_MODEL: 'gpt-3.5-turbo' ## change the model if according to your requirements
exclude: "yarn.lock,dist/**"

6
Makefile Normal file
View file

@ -0,0 +1,6 @@
.PHONY: compile
compile:
ncc build src/main.ts -o dist
ncc build src/main.ts -o dist -s
ncc build src/main.ts -o dist --license license.txt

View file

@ -62,6 +62,26 @@ the OpenAI API. It then generates review comments based on the AI's response and
Contributions are welcome! Please feel free to submit issues or pull requests to improve the AI Code Reviewer GitHub
Action.
If you make any changes to the code, please follow these steps to compile the code before submitting your changes:
1. Install the required dependencies by running the following command:
```bash
yarn install
```
2. To compile the code, use the following command:
```bash
make compile
```
3. After compiling the code, test it thoroughly to ensure everything is working as expected.
4. Submit your changes as a pull request, providing a clear description of the changes made and the problem it solves
Thank you for your contributions!
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information.

1112
dist/index.js vendored

File diff suppressed because it is too large Load diff

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View file

@ -7,6 +7,7 @@ import minimatch from "minimatch";
const GITHUB_TOKEN: string = core.getInput("GITHUB_TOKEN");
const OPENAI_API_KEY: string = core.getInput("OPENAI_API_KEY");
const OPENAI_MODEL: string = core.getInput('OPENAI_MODEL')
const octokit = new Octokit({ auth: GITHUB_TOKEN });
@ -132,7 +133,7 @@ async function getAIResponse(prompt: string): Promise<Array<{
reviewComment: string;
}> | null> {
const queryConfig = {
model: "gpt-4",
model: OPENAI_MODEL,
temperature: 0.2,
max_tokens: 700,
top_p: 1,