From 37841b258b7b735443eb2397daf043d56d8fe733 Mon Sep 17 00:00:00 2001 From: TuanNM Date: Mon, 22 Jan 2024 23:15:07 +0700 Subject: [PATCH 1/3] feat: added open_api_base_url --- src/bot.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bot.ts b/src/bot.ts index 4a5a1e4b..f6b9403a 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -34,7 +34,7 @@ IMPORTANT: Entire response must be in the language with ISO code: ${options.lang ` this.api = new ChatGPTAPI({ - apiBaseUrl: options.apiBaseUrl, + apiBaseUrl: process.env.OPENAI_API_BASE_URL, systemMessage, apiKey: process.env.OPENAI_API_KEY, apiOrg: process.env.OPENAI_API_ORG ?? undefined, From c52adb28d05f1163d82d0cb6b8269d303cd2647b Mon Sep 17 00:00:00 2001 From: TuanNM Date: Mon, 22 Jan 2024 23:27:49 +0700 Subject: [PATCH 2/3] feat: change models --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 8c96b0ba..15992719 100644 --- a/action.yml +++ b/action.yml @@ -152,11 +152,11 @@ inputs: required: false description: 'Model to use for simple tasks like summarizing diff on a file.' - default: 'gpt-3.5-turbo' + default: 'pai-001-light' openai_heavy_model: required: false description: 'Model to use for complex tasks such as code reviews.' - default: 'gpt-4' + default: 'pai-001' openai_model_temperature: required: false description: 'Temperature for GPT model' From d99a2b6e2580d9585574af279255924fc61e29bd Mon Sep 17 00:00:00 2001 From: TuanNM Date: Mon, 22 Jan 2024 23:44:30 +0700 Subject: [PATCH 3/3] feat: change models --- README.md | 3 +++ src/options.ts | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4092086b..e4146d5f 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,9 @@ jobs: - `OPENAI_API_KEY`: use this to authenticate with OpenAI API. You can get one [here](https://platform.openai.com/account/api-keys). Please add this key to your GitHub Action secrets. +- `OPENAI_API_BASE_URL`: (optional) use this to use a custom OpenAI API base + URL. This is useful if you are using a custom OpenAI API server. Defaults to + `https://api.openai.com`. - `OPENAI_API_ORG`: (optional) use this to use the specified organization with OpenAI API if you have multiple. Please add this key to your GitHub Action secrets. diff --git a/src/options.ts b/src/options.ts index 02541975..f8e69fc4 100644 --- a/src/options.ts +++ b/src/options.ts @@ -32,8 +32,8 @@ export class Options { reviewCommentLGTM = false, pathFilters: string[] | null = null, systemMessage = '', - openaiLightModel = 'gpt-3.5-turbo', - openaiHeavyModel = 'gpt-3.5-turbo', + openaiLightModel = 'pai-001-light', + openaiHeavyModel = 'pai-001', openaiModelTemperature = '0.0', openaiRetries = '3', openaiTimeoutMS = '120000',