class Riffer::Config
Configuration for the Riffer framework.
Provides configuration options for AI providers and other settings.
Riffer.config.openai.api_key = "sk-..." Riffer.config.amazon_bedrock.region = "us-east-1" Riffer.config.amazon_bedrock.api_token = "..." Riffer.config.anthropic.api_key = "sk-ant-..." Riffer.config.evals.judge_model = "anthropic/claude-sonnet-4-20250514"
Constants
- AmazonBedrock
- Anthropic
- AzureOpenAI
- Evals
- Gemini
- OpenAI
Attributes
Amazon Bedrock configuration (Struct with api_token and region).
Anthropic configuration (Struct with api_key).
Azure OpenAI configuration (Struct with api_key and endpoint).
Google Gemini configuration (Struct with api_key, open_timeout, and read_timeout).
OpenAI configuration (Struct with api_key).
Global tool runtime configuration (experimental).
Accepts a Riffer::ToolRuntime subclass, a Riffer::ToolRuntime instance, or a Proc. Defaults to Riffer::ToolRuntime::Inline.new.
Public Class Methods
Source
# File lib/riffer/config.rb, line 64 def initialize @amazon_bedrock = AmazonBedrock.new @anthropic = Anthropic.new @azure_openai = AzureOpenAI.new @gemini = Gemini.new @openai = OpenAI.new @evals = Evals.new @tool_runtime = Riffer::ToolRuntime::Inline.new end
Public Instance Methods
Source
# File lib/riffer/config.rb, line 56 def tool_runtime=(value) valid = (value.is_a?(Class) && value < Riffer::ToolRuntime) || value.is_a?(Riffer::ToolRuntime) || value.is_a?(Proc) raise Riffer::ArgumentError, "tool_runtime must be a Riffer::ToolRuntime subclass, instance, or a Proc" unless valid @tool_runtime = value end
Sets the global tool runtime.
Raises Riffer::ArgumentError if the value is not a valid runtime (ToolRuntime subclass, ToolRuntime instance, or Proc).