diff --git a/action.yml b/action.yml index 976aed7..9a70c6f 100644 --- a/action.yml +++ b/action.yml @@ -11,6 +11,10 @@ inputs: description: "OpenAI API model." required: false default: "gpt-4" + max_tokens: + description: "Maximum number of tokens that can be generated per analysis." + required: false + default: "1000" exclude: description: "Glob patterns to exclude files from the diff analysis" required: false diff --git a/src/main.ts b/src/main.ts index 40d368e..b9551ce 100644 --- a/src/main.ts +++ b/src/main.ts @@ -8,6 +8,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 MAX_TOKENS: number = Number(core.getInput("max_tokens")); const octokit = new Octokit({ auth: GITHUB_TOKEN }); @@ -118,7 +119,7 @@ async function getAIResponse(prompt: string): Promise