commit_ai 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/commit_ai +5 -0
- data/lib/commit_ai/version.rb +1 -1
- data/lib/commit_ai.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3bb64bbcabd9361061a9237413b2c37988f36c329e38bf393d7625ebfa3f807e
|
4
|
+
data.tar.gz: 237c8b7a7c55e220736de318526c09b88be1796b43bf5dad88d5e7c14526171b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e6039b3cc10882fa785c1ab18889d214ccff0ed815cf91a52aadee91aca9a95961a4404dd25cfed045b70b4f947b88240f9046493546a6a2a7b03a217978c60
|
7
|
+
data.tar.gz: 12b1e41db6c9f7b91f4e5dd070135eb04d063ff35b5167883b49ad71673a3c71ed6e6a8555a20a36696127e0352f511e4be9d135873f81d76b3dc72ef8898f21
|
data/exe/commit_ai
CHANGED
@@ -5,5 +5,10 @@ $LOAD_PATH.unshift(File.expand_path('../lib', __dir__))
|
|
5
5
|
|
6
6
|
require 'commit_ai'
|
7
7
|
|
8
|
+
if ENV['OPENAI_ACCESS_TOKEN'].nil?
|
9
|
+
puts "OPENAI_ACCESS_TOKEN is not set. Please set it in your environment variables."
|
10
|
+
exit
|
11
|
+
end
|
12
|
+
|
8
13
|
commit_ai = CommitAI.new
|
9
14
|
commit_ai.execute
|
data/lib/commit_ai/version.rb
CHANGED
data/lib/commit_ai.rb
CHANGED
@@ -2,7 +2,7 @@ require 'openai'
|
|
2
2
|
|
3
3
|
class CommitAI
|
4
4
|
def initialize
|
5
|
-
@client = OpenAI::Client.new(access_token: ENV['
|
5
|
+
@client = OpenAI::Client.new(access_token: ENV['OPENAI_ACCESS_TOKEN'])
|
6
6
|
end
|
7
7
|
|
8
8
|
def analyze_codebase
|
@@ -48,7 +48,7 @@ class CommitAI
|
|
48
48
|
parameters: {
|
49
49
|
model: "gpt-3.5-turbo",
|
50
50
|
messages: [
|
51
|
-
{ role: "system", content: "You are a
|
51
|
+
{ role: "system", content: "You are a Git commit message generator." },
|
52
52
|
{ role: "user", content: prompt }
|
53
53
|
],
|
54
54
|
max_tokens: 50,
|