Skip to content

Commit 744bb9b

Browse files
authored
Feat: Update OCO_MODEL to Latest Version and Remove Legacy GPT-3.5 Turbo Models (#299)
* fix(config.ts): improve code formatting for better readability feat(config.ts): add additional supported models for OCO_MODEL configuration feat(config.ts): update default OCO_MODEL value to 'gpt-3.5-turbo' for better compatibility * docs(README.md): update OCO_MODEL options to include new GPT-4 models and remove mention of 'gpt-3.5-turbo-16k' model docs(README.md): update default OCO_MODEL to 'gpt-3.5-turbo' and provide instructions for switching to GPT-4 models, specifically 'gpt-4-0125-preview' and 'gpt-4-turbo-preview' docs(README.md): update OCO_MODEL configuration in CI/CD pipeline to 'gpt-3.5-turbo' docs(README.md): update cost information related to default and GPT-4 models in OpenCommit
1 parent 401be04 commit 744bb9b

2 files changed

Lines changed: 19 additions & 12 deletions

File tree

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,18 @@ AI_PROVIDER='ollama' opencommit
7272
```
7373

7474
### Flags
75+
7576
There are multiple optional flags that can be used with the `oco` command:
7677

7778
#### Use Full GitMoji Specification
79+
7880
This flag can only be used if the `OCO_EMOJI` configuration item is set to `true`. This flag allows users to use all emojis in the GitMoji specification, By default, the GitMoji full specification is set to `false`, which only includes 10 emojis (🐛✨📝🚀✅♻️⬆️🔧🌐💡).
7981
This is due to limit the number of tokens sent in each request. However, if you would like to use the full GitMoji specification, you can use the `--fgm` flag.
8082

8183
```
8284
oco --fgm
8385
```
84-
86+
8587
## Configuration
8688

8789
### Local per repo configuration
@@ -95,7 +97,7 @@ OCO_TOKENS_MAX_OUTPUT=<max response tokens (default: 500)>
9597
OCO_OPENAI_BASE_PATH=<may be used to set proxy path to OpenAI api>
9698
OCO_DESCRIPTION=<postface a message with ~3 sentences description of the changes>
9799
OCO_EMOJI=<boolean, add GitMoji>
98-
OCO_MODEL=<either 'gpt-4', 'gpt-3.5-turbo-16k' (default), 'gpt-3.5-turbo-0613' or 'gpt-3.5-turbo'>
100+
OCO_MODEL=<either 'gpt-4', 'gpt-3.5-turbo' (default), 'gpt-3.5-turbo-0125', 'gpt-4-1106-preview', 'gpt-4-turbo-preview' or 'gpt-4-0125-preview'>
99101
OCO_LANGUAGE=<locale, scroll to the bottom to see options>
100102
OCO_MESSAGE_TEMPLATE_PLACEHOLDER=<message template placeholder, default: '$msg'>
101103
OCO_PROMPT_MODULE=<either conventional-commit or @commitlint, default: conventional-commit>
@@ -125,7 +127,7 @@ oco config set OCO_EMOJI=false
125127

126128
### Switch to GPT-4 or other models
127129

128-
By default, OpenCommit uses `gpt-3.5-turbo-16k` model.
130+
By default, OpenCommit uses `gpt-3.5-turbo` model.
129131

130132
You may switch to GPT-4 which performs better, but costs ~x15 times more 🤠
131133

@@ -142,7 +144,7 @@ oco config set OCO_MODEL=gpt-3.5-turbo
142144
or for GPT-4 Turbo (Preview) which is more capable, has knowledge of world events up to April 2023, a 128k context window and 2-3x cheaper vs GPT-4:
143145

144146
```sh
145-
oco config set OCO_MODEL=gpt-4-1106-preview
147+
oco config set OCO_MODEL=gpt-4-0125-preview
146148
```
147149

148150
Make sure that you spell it `gpt-4` (lowercase) and that you have API access to the 4th model. Even if you have ChatGPT+, that doesn't necessarily mean that you have API access to GPT-4.
@@ -348,7 +350,7 @@ jobs:
348350
OCO_OPENAI_BASE_PATH: ''
349351
OCO_DESCRIPTION: false
350352
OCO_EMOJI: false
351-
OCO_MODEL: gpt-3.5-turbo-16k
353+
OCO_MODEL: gpt-3.5-turbo
352354
OCO_LANGUAGE: en
353355
OCO_PROMPT_MODULE: conventional-commit
354356
```
@@ -365,6 +367,6 @@ You pay for your requests to OpenAI API on your own.
365367

366368
OpenCommit stores your key locally.
367369

368-
OpenCommit by default uses 3.5-turbo-16k model, it should not exceed $0.10 per casual working day.
370+
OpenCommit by default uses 3.5-turbo model, it should not exceed $0.10 per casual working day.
369371

370372
You may switch to gpt-4, it's better, but more expensive.

src/commands/config.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ const validateConfig = (
5454
export const configValidators = {
5555
[CONFIG_KEYS.OCO_OPENAI_API_KEY](value: any, config: any = {}) {
5656
//need api key unless running locally with ollama
57-
validateConfig('API_KEY', value || config.OCO_AI_PROVIDER == 'ollama', 'You need to provide an API key');
57+
validateConfig(
58+
'API_KEY',
59+
value || config.OCO_AI_PROVIDER == 'ollama',
60+
'You need to provide an API key'
61+
);
5862
validateConfig(
5963
CONFIG_KEYS.OCO_OPENAI_API_KEY,
6064
value.startsWith('sk-'),
@@ -150,12 +154,13 @@ export const configValidators = {
150154
CONFIG_KEYS.OCO_MODEL,
151155
[
152156
'gpt-3.5-turbo',
157+
'gpt-3.5-turbo-0125',
153158
'gpt-4',
154-
'gpt-3.5-turbo-16k',
155-
'gpt-3.5-turbo-0613',
156-
'gpt-4-1106-preview'
159+
'gpt-4-1106-preview',
160+
'gpt-4-turbo-preview',
161+
'gpt-4-0125-preview'
157162
].includes(value),
158-
`${value} is not supported yet, use 'gpt-4', 'gpt-3.5-turbo-16k' (default), 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo' or 'gpt-4-1106-preview'`
163+
`${value} is not supported yet, use 'gpt-4', 'gpt-3.5-turbo' (default), 'gpt-3.5-turbo-0125', 'gpt-4-1106-preview', 'gpt-4-turbo-preview' or 'gpt-4-0125-preview'`
159164
);
160165
return value;
161166
},
@@ -210,7 +215,7 @@ export const getConfig = (): ConfigType | null => {
210215
OCO_OPENAI_BASE_PATH: process.env.OCO_OPENAI_BASE_PATH,
211216
OCO_DESCRIPTION: process.env.OCO_DESCRIPTION === 'true' ? true : false,
212217
OCO_EMOJI: process.env.OCO_EMOJI === 'true' ? true : false,
213-
OCO_MODEL: process.env.OCO_MODEL || 'gpt-3.5-turbo-16k',
218+
OCO_MODEL: process.env.OCO_MODEL || 'gpt-3.5-turbo',
214219
OCO_LANGUAGE: process.env.OCO_LANGUAGE || 'en',
215220
OCO_MESSAGE_TEMPLATE_PLACEHOLDER:
216221
process.env.OCO_MESSAGE_TEMPLATE_PLACEHOLDER || '$msg',

0 commit comments

Comments
 (0)