commit_ai 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2be7cd22495b103070f0928bb08fbca747f912b68e7a74b35bae7ce7605ea8bb
4
- data.tar.gz: 71f79a96dd55d7f63da8b35034aa7f965947cf5440782d95913f234ea98df6d4
3
+ metadata.gz: 3bb64bbcabd9361061a9237413b2c37988f36c329e38bf393d7625ebfa3f807e
4
+ data.tar.gz: 237c8b7a7c55e220736de318526c09b88be1796b43bf5dad88d5e7c14526171b
5
5
  SHA512:
6
- metadata.gz: 5b0ca833ff8aa5db719ee97368bc8f767d6fb809e3b46f48a36016f12e6fa0bc7897d581dc2105295539f79251c6f3de99024e1aa426c8cf71c2e659333939e6
7
- data.tar.gz: aa8f7e86731b12988eae20a2eb6d0df61e6be365217af53f8c060fadcd9808aeb3febb7c1267039def8311d8dbb2ed3db0e752e601a32b7f617857a32cacbc2a
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CommitAi
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.3"
5
5
  end
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['OPENAI_API_KEY'])
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 helpful assistant." },
51
+ { role: "system", content: "You are a Git commit message generator." },
52
52
  { role: "user", content: prompt }
53
53
  ],
54
54
  max_tokens: 50,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: commit_ai
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Vitug