Skip to content

Commit 5ed79a7

Browse files
bump
1 parent 32260f0 commit 5ed79a7

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

index.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env node
2-
import { Configuration, OpenAIApi } from "openai";
2+
import OpenAI from "openai";
33
import { promisify } from 'util';
44
import path from "path";
55
import process from "process";
@@ -8,17 +8,15 @@ import prompts from "prompts";
88
import { program } from "commander";
99

1010
let openai;
11-
let model = "gpt-3.5-turbo-instruct"; // Default model
11+
let model = "gpt-4-0125-preview"; // Default model
1212

1313
export async function getGitSummary() {
1414
try {
1515
const dotenv = await import("dotenv");
1616
const envPath = path.join(process.cwd(), '.env');
1717
dotenv.config({ path: envPath });
18-
const configuration = new Configuration({
19-
apiKey: process.env.OPENAI_API_KEY
20-
});
21-
openai = new OpenAIApi(configuration);
18+
openai = new OpenAI({apiKey: process.env.OPENAI_API_KEY});
19+
2220

2321
const exec = promisify(originalExec);
2422
const { stdout } = await exec("git diff --cached -- . ':(exclude)*lock.json' ':(exclude)*lock.yaml'");
@@ -54,7 +52,7 @@ const gptCommit = async () => {
5452
stop: null,
5553
};
5654

57-
const response = await openai.createCompletion(parameters);
55+
const response = await openai.completions.create(parameters);
5856

5957
const message = response.data.choices[0].text.trim();
6058

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@laststance/git-gpt-commit",
3-
"version": "0.6.1",
3+
"version": "0.7.0-beta02",
44
"description": "An AI-powered Git extension that generates commit messages using OpenAI's GPT-3, streamlining the commit process and improving developer productivity.",
55
"main": "index.js",
66
"type": "module",

0 commit comments

Comments
 (0)