From cc6ffd8e44164930d307dcd1f494dbbbe999c198 Mon Sep 17 00:00:00 2001 From: Luke Hollenback <8144622+lukehollenback@users.noreply.github.com> Date: Tue, 2 Apr 2024 15:19:39 -0600 Subject: [PATCH 1/3] Added debug output. --- src/main.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.ts b/src/main.ts index 13677ae..d855723 100644 --- a/src/main.ts +++ b/src/main.ts @@ -138,7 +138,12 @@ async function getAIResponse(prompt: string): Promise Date: Tue, 2 Apr 2024 15:30:32 -0600 Subject: [PATCH 2/3] Got rid of useless debug message. --- src/main.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main.ts b/src/main.ts index d855723..bb9c0d4 100644 --- a/src/main.ts +++ b/src/main.ts @@ -138,11 +138,9 @@ async function getAIResponse(prompt: string): Promise Date: Tue, 2 Apr 2024 15:38:11 -0600 Subject: [PATCH 3/3] Allowed max response tokens to be configured. --- action.yml | 4 ++++ src/main.ts | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 976aed7..d2e112e 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: "700" exclude: description: "Glob patterns to exclude files from the diff analysis" required: false diff --git a/src/main.ts b/src/main.ts index bb9c0d4..5356877 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 }); @@ -117,7 +118,7 @@ async function getAIResponse(prompt: string): Promise