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



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

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.



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

def amazon_bedrock
  @amazon_bedrock
end

#anthropicObject (readonly)

Anthropic configuration.



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

def anthropic
  @anthropic
end

#azure_openaiObject (readonly)

Azure OpenAI configuration.



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

def azure_openai
  @azure_openai
end

#evalsObject (readonly)

Evals configuration.



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

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.



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

def experimental_history_healing
  @experimental_history_healing
end

#geminiObject (readonly)

Google Gemini configuration.



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

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.



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

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.



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

def message_id_strategy
  @message_id_strategy
end

#metricsObject (readonly)

Metrics-related global configuration.



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

def metrics
  @metrics
end

#openaiObject (readonly)

OpenAI configuration.



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

def openai
  @openai
end

#openrouterObject (readonly)

OpenRouter configuration.



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

def openrouter
  @openrouter
end

#pricingObject (readonly)

Consumer-configured per-model token pricing.



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

def pricing
  @pricing
end

#skillsObject (readonly)

Skills-related global configuration.



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

def skills
  @skills
end

#tool_runtimeObject

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



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

def tool_runtime
  @tool_runtime
end

#tracingObject (readonly)

Tracing-related global configuration.



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

def tracing
  @tracing
end