class Riffer::Config
Configuration for the Riffer framework.
Constants
- AmazonBedrock
- Anthropic
- AzureOpenAI
- Evals
- Gemini
- Mcp
- OpenAI
- OpenRouter
- VALID_MESSAGE_ID_STRATEGIES
Attributes
Amazon Bedrock configuration.
Anthropic configuration.
Azure OpenAI configuration.
Experimental: when true, riffer maintains the tool_use โ tool_result invariant itself โ stripping orphaned exchanges and filling interrupted ones. Defaults to false; the surface may change without notice.
Google Gemini configuration.
MCP configuration. credentials is an optional Proc returning per-run tools/call headers (or nil to deny); discovery_runner runs tool discovery.
Strategy for auto-generating message ids: :none (default), :uuid, or :uuidv7. When not :none, messages get an id at construction, and seeded messages passed to +Riffer::Agent#generate+ must carry their own.
OpenAI configuration.
OpenRouter configuration.
Skills-related global configuration.
Global tool runtime configuration (experimental); defaults to Riffer::Tools::Runtime::Inline.new.
Public Class Methods
Source
# File lib/riffer/config.rb, line 136 def initialize @amazon_bedrock = AmazonBedrock.new @anthropic = Anthropic.new @azure_openai = AzureOpenAI.new @gemini = Gemini.new @openai = OpenAI.new @openrouter = OpenRouter.new @evals = Evals.new @mcp = Mcp.new(credentials: nil, discovery_runner: Riffer::Runner::Sequential.new) @tool_runtime = Riffer::Tools::Runtime::Inline.new @skills = Skills.new @message_id_strategy = :none @experimental_history_healing = false end
Public Instance Methods
Source
# File lib/riffer/config.rb, line 124 def experimental_history_healing=(value) @experimental_history_healing = case value when true, "true", 1, "1" then true when false, "false", 0, "0", nil then false else raise Riffer::ArgumentError, "experimental_history_healing must be a boolean (or 'true'/'false'/'1'/'0'/1/0), got #{value.inspect}" end end
Sets the experimental_history_healing flag, coercing boolean-ish values so an env-var +โfalseโ+ (truthy in Ruby) doesnโt silently enable healing. Raises Riffer::ArgumentError on an unrecognized value.
Source
# File lib/riffer/config.rb, line 106 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
Sets the message id strategy. Raises Riffer::ArgumentError unless the value is :none, :uuid, or :uuidv7.
Source
# File lib/riffer/config.rb, line 88 def tool_runtime=(value) valid = (value.is_a?(Class) && value < Riffer::Tools::Runtime) || value.is_a?(Riffer::Tools::Runtime) || value.is_a?(Proc) raise Riffer::ArgumentError, "tool_runtime must be a Riffer::Tools::Runtime subclass, instance, or a Proc" unless valid @tool_runtime = value end
Sets the global tool runtime. Raises Riffer::ArgumentError on an invalid value.