class Riffer::Config
rbs_inline: enabled
Constants
- VALID_MESSAGE_ID_STRATEGIES
Attributes
@rbs @catalog: Riffer::Catalog?
When not :none, seeded messages passed to +Riffer::Agent#generate+ must carry their own id.
@deprecated Use catalog_files.
Public Class Methods
Source
# File lib/riffer/config.rb, line 116 def initialize @amazon_bedrock = AmazonBedrock.new @anthropic = Anthropic.new @azure_openai = AzureOpenAI.new @gemini = Gemini.new @google_cloud = GoogleCloud.new @openai = OpenAI.new @openrouter = OpenRouter.new @evals = Evals.new @mcp = Mcp.new @tool_runtime = Riffer::Tools::Runtime::Inline.new @skills = Skills.new @tracing = Tracing.new @files = Files.new @future = Future.new @pricing = Pricing.new no_files = [] #: Array[String] @catalog_files = no_files.freeze @message_id_strategy = :none @deprecations = :warn end
Public Instance Methods
Source
# File lib/riffer/config.rb, line 78 def catalog @catalog ||= Riffer::Catalog.load(@catalog_files) end
Source
# File lib/riffer/config.rb, line 68 def catalog_files=(paths) valid = paths.is_a?(Array) && paths.all? { |path| path.is_a?(String) || path.respond_to?(:to_path) } raise Riffer::ArgumentError, "catalog_files must be an Array of file paths" unless valid @catalog_files = paths.map(&:to_s).freeze @catalog = nil end
Source
# File lib/riffer/config.rb, line 106 def deprecations=(value) unless Riffer::Deprecation::MODES.include?(value) || value.respond_to?(:call) raise Riffer::ArgumentError, "deprecations must be one of #{Riffer::Deprecation::MODES.inspect} or a callable, got #{value.inspect}" end @deprecations = value end
Source
# File lib/riffer/config.rb, line 27 def evals Riffer::Deprecation.warn( id: :config_evals, message: "config.evals is deprecated and will move out of riffer into the riffer-evals gem " \ "(see docs/EVALS.md).", ) @evals end
Source
# File lib/riffer/config.rb, line 94 def message_id_strategy=(value) unless VALID_MESSAGE_ID_STRATEGIES.include?(value) raise Riffer::ArgumentError, "message_id_strategy must be one of #{VALID_MESSAGE_ID_STRATEGIES.inspect}, got #{value.inspect}" end @message_id_strategy = value end
Source
# File lib/riffer/config.rb, line 84 def reload_catalog @catalog = Riffer::Catalog.load(@catalog_files) end
Source
# File lib/riffer/config.rb, line 42 def tool_runtime=(value) valid = (value.is_a?(Class) && value < Riffer::Tools::Runtime) || value.is_a?(Riffer::Tools::Runtime) || value.is_a?(Proc) unless valid raise Riffer::ArgumentError, "tool_runtime must be a Riffer::Tools::Runtime subclass, instance, or a Proc" end @tool_runtime = value end