Compare commits

..

1 Commits

Author SHA1 Message Date
Sukharev
78456c4431 Revert "Suggest adding 'Edit' option to the Yes/No confirmation #53 (#70)"
This reverts commit 70f048672c.
2023-04-28 14:23:59 +08:00
7 changed files with 7 additions and 31 deletions

View File

@@ -54,18 +54,6 @@ oc
## Features
### Switch to GPT-4
By default OpenCommit uses GPT-3.5-turbo (ChatGPT).
You may switch to GPT-4 which performs better, but costs ~x15 times more 🤠
```sh
oc config set model=gpt-4
```
Make sure you do lowercase `gpt-4`.
### Preface commits with emoji 🤠
[GitMoji](https://gitmoji.dev/) convention is used.

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "opencommit",
"version": "2.0.5",
"version": "2.0.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "opencommit",
"version": "2.0.5",
"version": "2.0.1",
"license": "MIT",
"dependencies": {
"@clack/prompts": "^0.6.1",

View File

@@ -1,6 +1,6 @@
{
"name": "opencommit",
"version": "2.0.5",
"version": "2.0.1",
"description": "GPT CLI to auto-generate impressive commits in 1 second. Killing lame commits with AI 🤯🔫",
"keywords": [
"git",

View File

@@ -29,8 +29,6 @@ if (!apiKey && command !== 'config' && mode !== CONFIG_MODES.set) {
process.exit(1);
}
const MODEL = config?.model || 'gpt-3.5-turbo';
class OpenAi {
private openAiApiConfiguration = new OpenAiApiConfiguration({
apiKey: apiKey
@@ -49,7 +47,7 @@ class OpenAi {
): Promise<string | undefined> => {
try {
const { data } = await this.openAI.createChatCompletion({
model: MODEL,
model: 'gpt-3.5-turbo',
messages,
temperature: 0,
top_p: 0.1,

View File

@@ -13,7 +13,6 @@ export enum CONFIG_KEYS {
OPENAI_BASE_PATH = 'OPENAI_BASE_PATH',
description = 'description',
emoji = 'emoji',
model = 'model',
language = 'language'
}
@@ -89,15 +88,6 @@ export const configValidators = {
`${value} is not supported yet`
);
return value;
},
[CONFIG_KEYS.model](value: any) {
validateConfig(
CONFIG_KEYS.OPENAI_BASE_PATH,
value === 'gpt-3.5-turbo' || value === 'gpt-4',
`${value} is not supported yet, use 'gpt-4' or 'gpt-3.5-turbo' (default)`
);
return value;
}
};

View File

@@ -15,7 +15,7 @@ const INIT_MESSAGES_PROMPT: Array<ChatCompletionRequestMessage> = [
{
role: ChatCompletionRequestMessageRoleEnum.System,
// prettier-ignore
content: `You are to act as the author of a commit message in git. Your mission is to create clean and comprehensive commit messages in the conventional commit convention and explain WHAT were the changes and WHY the changes were done. I'll send you an output of 'git diff --staged' command, and you convert it into a commit message.
content: `You are to act as the author of a commit message in git. Your mission is to create clean and comprehensive commit messages in the conventional commit convention and explain why a change was done. I'll send you an output of 'git diff --staged' command, and you convert it into a commit message.
${config?.emoji? 'Use GitMoji convention to preface the commit.': 'Do not preface the commit with anything.'}
${config?.description ? 'Add a short description of WHY the changes are done after the commit message. Don\'t start it with "This commit", just describe the changes.': "Don't add any descriptions to the commit, only commit message."}
Use the present tense. Lines must not be longer than 74 characters. Use ${translation.localLanguage} to answer.`

View File

@@ -1,6 +1,6 @@
{
"localLanguage": "english",
"commitFix": "fix(server.ts): change port variable case from lowercase port to uppercase PORT to improve semantics",
"commitFeat": "feat(server.ts): add support for process.env.PORT environment variable to be able to run app on a configurable port",
"commitFix": "fix(server.ts): change port variable case from lowercase port to uppercase PORT",
"commitFeat": "feat(server.ts): add support for process.env.PORT environment variable",
"commitDescription": "The port variable is now named PORT, which improves consistency with the naming conventions as PORT is a constant. Support for an environment variable allows the application to be more flexible as it can now run on any available port specified via the process.env.PORT environment variable."
}