Class: AiGitCommit::Config
- Inherits:
-
Object
- Object
- AiGitCommit::Config
- Defined in:
- lib/ai_git_commit/config.rb
Overview
Configuration class for AiGitCommit
Instance Attribute Summary collapse
-
#max_tokens ⇒ Object
Returns the value of attribute max_tokens.
-
#model ⇒ Object
Returns the value of attribute model.
-
#openai_api_key ⇒ Object
Returns the value of attribute openai_api_key.
-
#program_language ⇒ Object
Returns the value of attribute program_language.
-
#system_role_message ⇒ Object
Returns the value of attribute system_role_message.
-
#temperature ⇒ Object
Returns the value of attribute temperature.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
Initializes configuration with default values.
Constructor Details
#initialize ⇒ Config
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_tokens ⇒ Object
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 |
#model ⇒ Object
Returns the value of attribute model.
6 7 8 |
# File 'lib/ai_git_commit/config.rb', line 6 def model @model end |
#openai_api_key ⇒ Object
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_language ⇒ Object
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_message ⇒ Object
Returns the value of attribute system_role_message.
6 7 8 |
# File 'lib/ai_git_commit/config.rb', line 6 def @system_role_message end |
#temperature ⇒ Object
Returns the value of attribute temperature.
6 7 8 |
# File 'lib/ai_git_commit/config.rb', line 6 def temperature @temperature end |