Module: Senior
- Defined in:
- lib/senior.rb,
lib/senior/agent.rb,
lib/senior/errors.rb,
lib/senior/version.rb,
lib/senior/brains/open_ai.rb,
lib/senior/configuration/main.rb,
lib/senior/configuration/open_ai.rb
Overview
Encapsulates all the gem’s logic
Defined Under Namespace
Modules: Brains, Configuration Classes: Agent, ConfigurationError, Error
Constant Summary collapse
- VERSION =
'0.3.0'
Class Method Summary collapse
-
.agent ⇒ Agent
private
Returns an instance of the agent.
-
.auto_debug(broken_method, args, broken_method_source = nil) ⇒ Object
Calls the given method continuously, using AI to attempt to fix it until it is no longer raises exceptions.
-
.configuration ⇒ Senior::Configuration::Main
private
Returns the configuration object for the Senior gem.
-
.configure {|configuration| ... } ⇒ void
Provides a way to configure the Senior gem.
-
.suggest_fix(broken_method, args) ⇒ String
Suggests a fix for a broken method.
Class Method Details
.agent ⇒ Agent
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns an instance of the agent
58 59 60 |
# File 'lib/senior.rb', line 58 def self.agent @agent ||= Agent.new end |
.auto_debug(broken_method, args, broken_method_source = nil) ⇒ Object
Calls the given method continuously, using AI to attempt to fix it until it is no longer raises exceptions
29 30 31 |
# File 'lib/senior.rb', line 29 def self.auto_debug(broken_method, args, broken_method_source = nil) agent.auto_debug(broken_method, args, broken_method_source) end |
.configuration ⇒ Senior::Configuration::Main
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the configuration object for the Senior gem
68 69 70 |
# File 'lib/senior.rb', line 68 def self.configuration @configuration ||= Configuration::Main.new end |
.configure {|configuration| ... } ⇒ void
This method returns an undefined value.
Provides a way to configure the Senior gem
86 87 88 |
# File 'lib/senior.rb', line 86 def self.configure yield(configuration) end |
.suggest_fix(broken_method, args) ⇒ String
Suggests a fix for a broken method
48 49 50 |
# File 'lib/senior.rb', line 48 def self.suggest_fix(broken_method, args) agent.suggest_fix(broken_method, args) end |