Skip to content

Commit

Permalink
Merge branch 'dev' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ozeliurs authored Aug 22, 2024
2 parents 182a03d + eb3be62 commit 890e1c0
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 22 deletions.
Empty file added example.txt
Empty file.
12 changes: 4 additions & 8 deletions out/cli.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -28111,7 +28111,7 @@ function G3(t2, e3) {
// package.json
var package_default = {
name: "opencommit",
version: "3.0.18",
version: "3.0.19",
description: "Auto-generate impressive commits in 1 second. Killing lame commits with AI \u{1F92F}\u{1F52B}",
keywords: [
"git",
Expand Down Expand Up @@ -30663,6 +30663,7 @@ var TestAi = class {
// src/commands/config.ts
var MODEL_LIST = {
openai: [
"gpt-4o-mini",
"gpt-3.5-turbo",
"gpt-3.5-turbo-instruct",
"gpt-3.5-turbo-0613",
Expand All @@ -30687,7 +30688,6 @@ var MODEL_LIST = {
"gpt-4-32k-0613",
"gpt-4o",
"gpt-4o-2024-05-13",
"gpt-4o-mini",
"gpt-4o-mini-2024-07-18"
],
anthropic: [
Expand Down Expand Up @@ -30731,7 +30731,7 @@ var configValidators = {
validateConfig(
"OpenAI API_KEY",
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",
"You need to provide an OpenAI/Anthropic/Azure API key"
"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"
);
validateConfig(
"OCO_OPENAI_API_KEY" /* OCO_OPENAI_API_KEY */,
Expand Down Expand Up @@ -30841,11 +30841,7 @@ var configValidators = {
["OCO_MODEL" /* OCO_MODEL */](value, config12 = {}) {
validateConfig(
"OCO_MODEL" /* OCO_MODEL */,
[
...MODEL_LIST.openai,
...MODEL_LIST.anthropic,
...MODEL_LIST.gemini
].includes(value) || config12.OCO_AI_PROVIDER == "ollama" || config12.OCO_AI_PROVIDER == "azure" || config12.OCO_AI_PROVIDER == "test" || config12.OCO_AI_PROVIDER == "flowise",
typeof value === "string",
`${value} is not supported yet, use:

${[
Expand Down
10 changes: 3 additions & 7 deletions out/github-action.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -49470,6 +49470,7 @@ var TestAi = class {
// src/commands/config.ts
var MODEL_LIST = {
openai: [
"gpt-4o-mini",
"gpt-3.5-turbo",
"gpt-3.5-turbo-instruct",
"gpt-3.5-turbo-0613",
Expand All @@ -49494,7 +49495,6 @@ var MODEL_LIST = {
"gpt-4-32k-0613",
"gpt-4o",
"gpt-4o-2024-05-13",
"gpt-4o-mini",
"gpt-4o-mini-2024-07-18"
],
anthropic: [
Expand Down Expand Up @@ -49538,7 +49538,7 @@ var configValidators = {
validateConfig(
"OpenAI API_KEY",
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",
"You need to provide an OpenAI/Anthropic/Azure API key"
"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"
);
validateConfig(
"OCO_OPENAI_API_KEY" /* OCO_OPENAI_API_KEY */,
Expand Down Expand Up @@ -49648,11 +49648,7 @@ var configValidators = {
["OCO_MODEL" /* OCO_MODEL */](value, config11 = {}) {
validateConfig(
"OCO_MODEL" /* OCO_MODEL */,
[
...MODEL_LIST.openai,
...MODEL_LIST.anthropic,
...MODEL_LIST.gemini
].includes(value) || config11.OCO_AI_PROVIDER == "ollama" || config11.OCO_AI_PROVIDER == "azure" || config11.OCO_AI_PROVIDER == "test" || config11.OCO_AI_PROVIDER == "flowise",
typeof value === "string",
`${value} is not supported yet, use:

${[
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opencommit",
"version": "3.0.18",
"version": "3.0.20",
"description": "Auto-generate impressive commits in 1 second. Killing lame commits with AI 🤯🔫",
"keywords": [
"git",
Expand Down
5 changes: 3 additions & 2 deletions src/commands/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export enum CONFIG_MODES {

export const MODEL_LIST = {
openai: [
'gpt-4o-mini',
'gpt-3.5-turbo',
'gpt-3.5-turbo-instruct',
'gpt-3.5-turbo-0613',
Expand All @@ -70,7 +71,6 @@ export const MODEL_LIST = {
'gpt-4-32k-0613',
'gpt-4o',
'gpt-4o-2024-05-13',
'gpt-4o-mini',
'gpt-4o-mini-2024-07-18'
],

Expand Down Expand Up @@ -147,7 +147,7 @@ export const configValidators = {
config.OCO_AZURE_API_KEY ||
config.OCO_AI_PROVIDER == 'test' ||
config.OCO_AI_PROVIDER == 'flowise',
'You need to provide an OpenAI/Anthropic/Azure API key'
'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'
);
validateConfig(
CONFIG_KEYS.OCO_OPENAI_API_KEY,
Expand Down Expand Up @@ -501,6 +501,7 @@ export const getConfig = ({
outro(
`Manually fix the '.env' file or global '~/.opencommit' config file.`
);

process.exit(1);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/engine/anthropic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ if (

const MODEL = config?.OCO_MODEL;
if (provider === 'anthropic' &&
MODEL.typeof !== 'string' &&
typeof MODEL !== 'string' &&
command !== 'config' &&
mode !== CONFIG_MODES.set) {
outro(
Expand Down
2 changes: 1 addition & 1 deletion src/engine/openAi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ if (

const MODEL = config?.OCO_MODEL || 'gpt-3.5-turbo';
if (provider === 'openai' &&
MODEL.typeof !== 'string' &&
typeof MODEL !== 'string' &&
command !== 'config' &&
mode !== CONFIG_MODES.set) {
outro(
Expand Down

0 comments on commit 890e1c0

Please sign in to comment.