Class: Riffer::Config

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

Overview

Configuration for the Riffer framework.

Defined Under Namespace

Classes: AmazonBedrock, Anthropic, AzureOpenAI, Evals, Gemini, Mcp, Metrics, OpenAI, OpenRouter, Pricing, Skills, Tracing

Constant Summary collapse

VALID_MESSAGE_ID_STRATEGIES =
%i[none uuid uuidv7].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

– : () -> void



349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
# File 'lib/riffer/config.rb', line 349

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
  @tracing = Tracing.new
  @metrics = Metrics.new
  @pricing = Pricing.new
  @message_id_strategy = :none
  @experimental_history_healing = false
end

Instance Attribute Details

#amazon_bedrockObject (readonly)

Amazon Bedrock configuration.



265
266
267
# File 'lib/riffer/config.rb', line 265

def amazon_bedrock
  @amazon_bedrock
end

#anthropicObject (readonly)

Anthropic configuration.



268
269
270
# File 'lib/riffer/config.rb', line 268

def anthropic
  @anthropic
end

#azure_openaiObject (readonly)

Azure OpenAI configuration.



271
272
273
# File 'lib/riffer/config.rb', line 271

def azure_openai
  @azure_openai
end

#evalsObject (readonly)

Evals configuration.



283
284
285
# File 'lib/riffer/config.rb', line 283

def evals
  @evals
end

#experimental_history_healingObject

Experimental: when true, riffer maintains the tool_usetool_result invariant itself — stripping orphaned exchanges and filling interrupted ones. Defaults to false; the surface may change without notice.



336
337
338
# File 'lib/riffer/config.rb', line 336

def experimental_history_healing
  @experimental_history_healing
end

#geminiObject (readonly)

Google Gemini configuration.



274
275
276
# File 'lib/riffer/config.rb', line 274

def gemini
  @gemini
end

#mcpObject (readonly)

MCP configuration. credentials is an optional Proc returning per-run tools/call headers (or nil to deny); discovery_runner runs tool discovery.



288
289
290
# File 'lib/riffer/config.rb', line 288

def mcp
  @mcp
end

#message_id_strategyObject

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.



319
320
321
# File 'lib/riffer/config.rb', line 319

def message_id_strategy
  @message_id_strategy
end

#metricsObject (readonly)

Metrics-related global configuration.



311
312
313
# File 'lib/riffer/config.rb', line 311

def metrics
  @metrics
end

#openaiObject (readonly)

OpenAI configuration.



277
278
279
# File 'lib/riffer/config.rb', line 277

def openai
  @openai
end

#openrouterObject (readonly)

OpenRouter configuration.



280
281
282
# File 'lib/riffer/config.rb', line 280

def openrouter
  @openrouter
end

#pricingObject (readonly)

Consumer-configured per-model token pricing.



314
315
316
# File 'lib/riffer/config.rb', line 314

def pricing
  @pricing
end

#skillsObject (readonly)

Skills-related global configuration.



305
306
307
# File 'lib/riffer/config.rb', line 305

def skills
  @skills
end

#tool_runtimeObject

Global tool runtime configuration (experimental); defaults to Riffer::Tools::Runtime::Inline.new.



292
293
294
# File 'lib/riffer/config.rb', line 292

def tool_runtime
  @tool_runtime
end

#tracingObject (readonly)

Tracing-related global configuration.



308
309
310
# File 'lib/riffer/config.rb', line 308

def tracing
  @tracing
end