Class: AiGitCommit::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/ai_git_commit/config.rb

Overview

Configuration class for AiGitCommit

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Initializes configuration with default values



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/ai_git_commit/config.rb', line 10

def initialize
  @openai_api_key = ENV.fetch("OPENAI_API_KEY", nil)
  @model = "gpt-3.5-turbo"
  @program_language = "Ruby"
  @max_tokens = 300
  @temperature = 0.7
  @system_role_message = <<~MESSAGE
    You are a senior #{@program_language} developer. Your task is to write a concise, clear commit
    message and a detailed description based on the provided code changes. The message
    should be in the imperative mood. The body should be wrapped at 72 characters.
  MESSAGE
end

Instance Attribute Details

#max_tokensObject

Returns the value of attribute max_tokens.



6
7
8
# File 'lib/ai_git_commit/config.rb', line 6

def max_tokens
  @max_tokens
end

#modelObject

Returns the value of attribute model.



6
7
8
# File 'lib/ai_git_commit/config.rb', line 6

def model
  @model
end

#openai_api_keyObject

Returns the value of attribute openai_api_key.



6
7
8
# File 'lib/ai_git_commit/config.rb', line 6

def openai_api_key
  @openai_api_key
end

#program_languageObject

Returns the value of attribute program_language.



6
7
8
# File 'lib/ai_git_commit/config.rb', line 6

def program_language
  @program_language
end

#system_role_messageObject

Returns the value of attribute system_role_message.



6
7
8
# File 'lib/ai_git_commit/config.rb', line 6

def system_role_message
  @system_role_message
end

#temperatureObject

Returns the value of attribute temperature.



6
7
8
# File 'lib/ai_git_commit/config.rb', line 6

def temperature
  @temperature
end