Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Test update readme #513

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Comment on lines +107 to +109
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

The addition of the OPENAI_API_BASE_URL environment variable is a good idea for flexibility, especially for users who might be using a custom OpenAI API server. However, it would be helpful to provide instructions on how and where to add this key (similar to the other keys). This will ensure consistency in the documentation and make it easier for users to understand how to use this new option.

- - `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_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`. Please add this key to your GitHub Action secrets if needed.

- `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.
Expand Down
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Comment on lines +155 to +159
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

The indentation for the default field under openai_heavy_model is incorrect. It should be aligned with the other fields like required and description. Also, there's a missing space before openai_model_temperature, it should be on a new line.

    default: 'pai-001-light'
   openai_heavy_model:
     required: false
     description: 'Model to use for complex tasks such as code reviews.'
    default: 'pai-001'
-   openai_model_temperature:
+160: 
+161:   openai_model_temperature:
    required: false
    description: 'Temperature for GPT model'

openai_model_temperature:
required: false
description: 'Temperature for GPT model'
Expand Down
2 changes: 1 addition & 1 deletion src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

The change from using a value from options to directly using an environment variable for apiBaseUrl could potentially limit the flexibility of your code. If you want to instantiate ChatGPTAPI with different base URLs in different parts of your application, this change would prevent that. Consider keeping the ability to pass in apiBaseUrl through options, and use the environment variable as a fallback.

- apiBaseUrl: process.env.OPENAI_API_BASE_URL,
+ apiBaseUrl: options.apiBaseUrl ?? process.env.OPENAI_API_BASE_URL,

systemMessage,
apiKey: process.env.OPENAI_API_KEY,
apiOrg: process.env.OPENAI_API_ORG ?? undefined,
Expand Down
4 changes: 2 additions & 2 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Comment on lines +35 to +36
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

The model names for openaiLightModel and openaiHeavyModel have been changed from 'gpt-3.5-turbo' to 'pai-001-light' and 'pai-001' respectively. Please ensure that these new models exist and are compatible with the rest of your codebase. If they don't exist or aren't compatible, you may encounter runtime errors or unexpected behavior.

-    openaiLightModel = 'gpt-3.5-turbo',
-    openaiHeavyModel = 'gpt-3.5-turbo',
+    openaiLightModel = 'pai-001-light',
+    openaiHeavyModel = 'pai-001',

openaiModelTemperature = '0.0',
openaiRetries = '3',
openaiTimeoutMS = '120000',
Expand Down
Loading