Skip to content

Commit a979ba0

Browse files
authored
3.0.19 (#384)
* fix(config.ts): move 'gpt-4o-mini' in MODEL_LIST * docs(config.ts): update API key validation message with detailed instructions * refactor(config.ts): simplify model validation logic to check for string type instead of MODEL_LIST * 3.0.19
1 parent f3371ac commit a979ba0

File tree

5 files changed

+14
-29
lines changed

5 files changed

+14
-29
lines changed

out/cli.cjs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28111,7 +28111,7 @@ function G3(t2, e3) {
2811128111
// package.json
2811228112
var package_default = {
2811328113
name: "opencommit",
28114-
version: "3.0.18",
28114+
version: "3.0.19",
2811528115
description: "Auto-generate impressive commits in 1 second. Killing lame commits with AI \u{1F92F}\u{1F52B}",
2811628116
keywords: [
2811728117
"git",
@@ -30663,6 +30663,7 @@ var TestAi = class {
3066330663
// src/commands/config.ts
3066430664
var MODEL_LIST = {
3066530665
openai: [
30666+
"gpt-4o-mini",
3066630667
"gpt-3.5-turbo",
3066730668
"gpt-3.5-turbo-instruct",
3066830669
"gpt-3.5-turbo-0613",
@@ -30687,7 +30688,6 @@ var MODEL_LIST = {
3068730688
"gpt-4-32k-0613",
3068830689
"gpt-4o",
3068930690
"gpt-4o-2024-05-13",
30690-
"gpt-4o-mini",
3069130691
"gpt-4o-mini-2024-07-18"
3069230692
],
3069330693
anthropic: [
@@ -30731,7 +30731,7 @@ var configValidators = {
3073130731
validateConfig(
3073230732
"OpenAI API_KEY",
3073330733
value || config12.OCO_ANTHROPIC_API_KEY || config12.OCO_AI_PROVIDER.startsWith("ollama") || config12.OCO_AZURE_API_KEY || config12.OCO_AI_PROVIDER == "test" || config12.OCO_AI_PROVIDER == "flowise",
30734-
"You need to provide an OpenAI/Anthropic/Azure API key"
30734+
"You need to provide an OpenAI/Anthropic/Azure or other provider API key via `oco config set OCO_OPENAI_API_KEY=your_key`, for help refer to docs https://github.com/di-sukharev/opencommit"
3073530735
);
3073630736
validateConfig(
3073730737
"OCO_OPENAI_API_KEY" /* OCO_OPENAI_API_KEY */,
@@ -30841,11 +30841,7 @@ var configValidators = {
3084130841
["OCO_MODEL" /* OCO_MODEL */](value, config12 = {}) {
3084230842
validateConfig(
3084330843
"OCO_MODEL" /* OCO_MODEL */,
30844-
[
30845-
...MODEL_LIST.openai,
30846-
...MODEL_LIST.anthropic,
30847-
...MODEL_LIST.gemini
30848-
].includes(value) || config12.OCO_AI_PROVIDER == "ollama" || config12.OCO_AI_PROVIDER == "azure" || config12.OCO_AI_PROVIDER == "test" || config12.OCO_AI_PROVIDER == "flowise",
30844+
typeof value === "string",
3084930845
`${value} is not supported yet, use:
3085030846

3085130847
${[

out/github-action.cjs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49470,6 +49470,7 @@ var TestAi = class {
4947049470
// src/commands/config.ts
4947149471
var MODEL_LIST = {
4947249472
openai: [
49473+
"gpt-4o-mini",
4947349474
"gpt-3.5-turbo",
4947449475
"gpt-3.5-turbo-instruct",
4947549476
"gpt-3.5-turbo-0613",
@@ -49494,7 +49495,6 @@ var MODEL_LIST = {
4949449495
"gpt-4-32k-0613",
4949549496
"gpt-4o",
4949649497
"gpt-4o-2024-05-13",
49497-
"gpt-4o-mini",
4949849498
"gpt-4o-mini-2024-07-18"
4949949499
],
4950049500
anthropic: [
@@ -49538,7 +49538,7 @@ var configValidators = {
4953849538
validateConfig(
4953949539
"OpenAI API_KEY",
4954049540
value || config11.OCO_ANTHROPIC_API_KEY || config11.OCO_AI_PROVIDER.startsWith("ollama") || config11.OCO_AZURE_API_KEY || config11.OCO_AI_PROVIDER == "test" || config11.OCO_AI_PROVIDER == "flowise",
49541-
"You need to provide an OpenAI/Anthropic/Azure API key"
49541+
"You need to provide an OpenAI/Anthropic/Azure or other provider API key via `oco config set OCO_OPENAI_API_KEY=your_key`, for help refer to docs https://github.com/di-sukharev/opencommit"
4954249542
);
4954349543
validateConfig(
4954449544
"OCO_OPENAI_API_KEY" /* OCO_OPENAI_API_KEY */,
@@ -49648,11 +49648,7 @@ var configValidators = {
4964849648
["OCO_MODEL" /* OCO_MODEL */](value, config11 = {}) {
4964949649
validateConfig(
4965049650
"OCO_MODEL" /* OCO_MODEL */,
49651-
[
49652-
...MODEL_LIST.openai,
49653-
...MODEL_LIST.anthropic,
49654-
...MODEL_LIST.gemini
49655-
].includes(value) || config11.OCO_AI_PROVIDER == "ollama" || config11.OCO_AI_PROVIDER == "azure" || config11.OCO_AI_PROVIDER == "test" || config11.OCO_AI_PROVIDER == "flowise",
49651+
typeof value === "string",
4965649652
`${value} is not supported yet, use:
4965749653

4965849654
${[

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "opencommit",
3-
"version": "3.0.18",
3+
"version": "3.0.19",
44
"description": "Auto-generate impressive commits in 1 second. Killing lame commits with AI 🤯🔫",
55
"keywords": [
66
"git",

src/commands/config.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export enum CONFIG_MODES {
4545

4646
export const MODEL_LIST = {
4747
openai: [
48+
'gpt-4o-mini',
4849
'gpt-3.5-turbo',
4950
'gpt-3.5-turbo-instruct',
5051
'gpt-3.5-turbo-0613',
@@ -69,7 +70,6 @@ export const MODEL_LIST = {
6970
'gpt-4-32k-0613',
7071
'gpt-4o',
7172
'gpt-4o-2024-05-13',
72-
'gpt-4o-mini',
7373
'gpt-4o-mini-2024-07-18'
7474
],
7575

@@ -134,7 +134,7 @@ export const configValidators = {
134134
config.OCO_AZURE_API_KEY ||
135135
config.OCO_AI_PROVIDER == 'test' ||
136136
config.OCO_AI_PROVIDER == 'flowise',
137-
'You need to provide an OpenAI/Anthropic/Azure API key'
137+
'You need to provide an OpenAI/Anthropic/Azure or other provider API key via `oco config set OCO_OPENAI_API_KEY=your_key`, for help refer to docs https://github.com/di-sukharev/opencommit'
138138
);
139139
validateConfig(
140140
CONFIG_KEYS.OCO_OPENAI_API_KEY,
@@ -276,15 +276,7 @@ export const configValidators = {
276276
[CONFIG_KEYS.OCO_MODEL](value: any, config: any = {}) {
277277
validateConfig(
278278
CONFIG_KEYS.OCO_MODEL,
279-
[
280-
...MODEL_LIST.openai,
281-
...MODEL_LIST.anthropic,
282-
...MODEL_LIST.gemini
283-
].includes(value) ||
284-
config.OCO_AI_PROVIDER == 'ollama' ||
285-
config.OCO_AI_PROVIDER == 'azure' ||
286-
config.OCO_AI_PROVIDER == 'test' ||
287-
config.OCO_AI_PROVIDER == 'flowise',
279+
typeof value === 'string',
288280
`${value} is not supported yet, use:\n\n ${[
289281
...MODEL_LIST.openai,
290282
...MODEL_LIST.anthropic,
@@ -459,6 +451,7 @@ export const getConfig = ({
459451
outro(
460452
`Manually fix the '.env' file or global '~/.opencommit' config file.`
461453
);
454+
462455
process.exit(1);
463456
}
464457
}

0 commit comments

Comments
 (0)