Module: Bristow

Defined in:
lib/bristow/helpers/sgetter.rb,
lib/bristow.rb,
lib/bristow/agent.rb,
lib/bristow/agency.rb,
lib/bristow/version.rb,
lib/bristow/function.rb,
lib/bristow/configuration.rb,
lib/bristow/providers/base.rb,
lib/bristow/helpers/delegate.rb,
lib/bristow/providers/google.rb,
lib/bristow/providers/openai.rb,
lib/bristow/agencies/workflow.rb,
lib/bristow/agents/supervisor.rb,
lib/bristow/functions/delegate.rb,
lib/bristow/agencies/supervisor.rb,
lib/bristow/providers/anthropic.rb,
lib/bristow/terminations/timeout.rb,
lib/bristow/terminations/max_messages.rb,
lib/bristow/terminations/can_not_stop_will_not_stop.rb

Overview

A helper to define a getter/setter method This will let you define a class level getter/setter method with an instance reader

Example: class Agent

include Bristow::Sgetter
sgetter :agent_name
sgetter :model, default: -> { Bristow.configuration.model }

end

class Sydney < Agent

agent_name 'Sydney'

end

sydney = Sydney.new sydney.agent_name # => ‘Sydney’

Defined Under Namespace

Modules: Agencies, Agents, Delegate, Functions, Providers, Sgetter, Terminations Classes: Agency, Agent, Configuration, Error, Function, Termination

Constant Summary collapse

VERSION =
"1.0.0"

Class Method Summary collapse

Class Method Details

.configurationObject



73
74
75
# File 'lib/bristow/configuration.rb', line 73

def self.configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



77
78
79
# File 'lib/bristow/configuration.rb', line 77

def self.configure
  yield(configuration)
end

.reset_configuration!Object



81
82
83
# File 'lib/bristow/configuration.rb', line 81

def self.reset_configuration!
  @configuration = Configuration.new
end