From 823dc87f8d685f59314095207d243075aa58d32a Mon Sep 17 00:00:00 2001 From: tabbi89 Date: Thu, 4 Jul 2024 08:37:06 +0200 Subject: [PATCH] chore(core): added max tokens --- action.yml | 4 ++++ src/main.ts | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) 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