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, OpenAI, OpenRouter, 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



136
137
138
139
140
141
142
143
144
145
146
147
148
149
# 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

Instance Attribute Details

#amazon_bedrockObject (readonly)

Amazon Bedrock configuration.



55
56
57
# File 'lib/riffer/config.rb', line 55

def amazon_bedrock
  @amazon_bedrock
end

#anthropicObject (readonly)

Anthropic configuration.



58
59
60
# File 'lib/riffer/config.rb', line 58

def anthropic
  @anthropic
end

#azure_openaiObject (readonly)

Azure OpenAI configuration.



61
62
63
# File 'lib/riffer/config.rb', line 61

def azure_openai
  @azure_openai
end

#evalsObject (readonly)

Evals configuration.



73
74
75
# File 'lib/riffer/config.rb', line 73

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.



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

def experimental_history_healing
  @experimental_history_healing
end

#geminiObject (readonly)

Google Gemini configuration.



64
65
66
# File 'lib/riffer/config.rb', line 64

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.



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

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.



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

def message_id_strategy
  @message_id_strategy
end

#openaiObject (readonly)

OpenAI configuration.



67
68
69
# File 'lib/riffer/config.rb', line 67

def openai
  @openai
end

#openrouterObject (readonly)

OpenRouter configuration.



70
71
72
# File 'lib/riffer/config.rb', line 70

def openrouter
  @openrouter
end

#skillsObject (readonly)

Skills-related global configuration.



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

def skills
  @skills
end

#tool_runtimeObject

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



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

def tool_runtime
  @tool_runtime
end