mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2024-11-26 22:19:03 +00:00
Merge pull request #13 from lfsevergnini/chore/add-model-version-parameter
add customizable OpenAI API model parameter
This commit is contained in:
commit
d3abad1bc9
@ -42,6 +42,7 @@ jobs:
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
OPENAI_API_MODEL: "gpt-4" # Optional: defaults to "gpt-4"
|
||||
exclude: "**/*.json, **/*.md" # Optional: exclude patterns separated by commas
|
||||
```
|
||||
|
||||
|
@ -7,6 +7,10 @@ inputs:
|
||||
OPENAI_API_KEY:
|
||||
description: "OpenAI API key for GPT."
|
||||
required: true
|
||||
OPENAI_API_MODEL:
|
||||
description: "OpenAI API model."
|
||||
required: false
|
||||
default: "gpt-4"
|
||||
exclude:
|
||||
description: "Glob patterns to exclude files from the diff analysis"
|
||||
required: false
|
||||
|
3023
dist/index.js
vendored
3023
dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
@ -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_API_MODEL: string = core.getInput("OPENAI_API_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_API_MODEL,
|
||||
temperature: 0.2,
|
||||
max_tokens: 700,
|
||||
top_p: 1,
|
||||
|
Loading…
Reference in New Issue
Block a user