Class: Riffer::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/riffer/config.rb

Overview

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"

Defined Under Namespace

Classes: AmazonBedrock, Anthropic, AzureOpenAI, Evals, Gemini, OpenAI, Skills

Constant Summary collapse

VALID_MESSAGE_ID_STRATEGIES =
%i[none uuid uuidv7].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

– : () -> void



144
145
146
147
148
149
150
151
152
153
154
# File 'lib/riffer/config.rb', line 144

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
  @skills = Skills.new
  @message_id_strategy = :none
end

Instance Attribute Details

#amazon_bedrockObject (readonly)

Amazon Bedrock configuration (Struct with api_token and region).



79
80
81
# File 'lib/riffer/config.rb', line 79

def amazon_bedrock
  @amazon_bedrock
end

#anthropicObject (readonly)

Anthropic configuration (Struct with api_key).



82
83
84
# File 'lib/riffer/config.rb', line 82

def anthropic
  @anthropic
end

#azure_openaiObject (readonly)

Azure OpenAI configuration (Struct with api_key and endpoint).



85
86
87
# File 'lib/riffer/config.rb', line 85

def azure_openai
  @azure_openai
end

#evalsObject (readonly)

Evals configuration (Struct with judge_model).



94
95
96
# File 'lib/riffer/config.rb', line 94

def evals
  @evals
end

#geminiObject (readonly)

Google Gemini configuration (Struct with api_key, open_timeout, and read_timeout).



88
89
90
# File 'lib/riffer/config.rb', line 88

def gemini
  @gemini
end

#message_id_strategyObject

Strategy for auto-generating message ids. One of :none (default, no id), :uuid (UUIDv4), or :uuidv7 (time-ordered UUIDv7).

When set to anything other than :none, each Riffer::Messages::Base instance gets an id populated at construction time, and seeded messages passed to Riffer::Agent#generate must carry their own :id.



125
126
127
# File 'lib/riffer/config.rb', line 125

def message_id_strategy
  @message_id_strategy
end

#openaiObject (readonly)

OpenAI configuration (Struct with api_key).



91
92
93
# File 'lib/riffer/config.rb', line 91

def openai
  @openai
end

#skillsObject (readonly)

Skills-related global configuration. Returns a Riffer::Config::Skills object — see Riffer.config.skills.default_activate_tool.



117
118
119
# File 'lib/riffer/config.rb', line 117

def skills
  @skills
end

#tool_runtimeObject

Global tool runtime configuration (experimental).

Accepts a Riffer::ToolRuntime subclass, a Riffer::ToolRuntime instance, or a Proc. Defaults to Riffer::ToolRuntime::Inline.new.



100
101
102
# File 'lib/riffer/config.rb', line 100

def tool_runtime
  @tool_runtime
end