Class: Riffer::Config
- Inherits:
-
Object
- Object
- Riffer::Config
- 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
Constant Summary collapse
- VALID_MESSAGE_ID_STRATEGIES =
%i[none uuid uuidv7].freeze
Instance Attribute Summary collapse
-
#amazon_bedrock ⇒ Object
readonly
Amazon Bedrock configuration (Struct with
api_tokenandregion). -
#anthropic ⇒ Object
readonly
Anthropic configuration (Struct with
api_key). -
#azure_openai ⇒ Object
readonly
Azure OpenAI configuration (Struct with
api_keyandendpoint). -
#evals ⇒ Object
readonly
Evals configuration (Struct with
judge_model). -
#gemini ⇒ Object
readonly
Google Gemini configuration (Struct with
api_key,open_timeout, andread_timeout). -
#message_id_strategy ⇒ Object
Strategy for auto-generating message ids.
-
#openai ⇒ Object
readonly
OpenAI configuration (Struct with
api_key). -
#tool_runtime ⇒ Object
Global tool runtime configuration (experimental).
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
– : () -> void.
Constructor Details
#initialize ⇒ Config
– : () -> void
89 90 91 92 93 94 95 96 97 98 |
# File 'lib/riffer/config.rb', line 89 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 @message_id_strategy = :none end |
Instance Attribute Details
#amazon_bedrock ⇒ Object (readonly)
Amazon Bedrock configuration (Struct with api_token and region).
28 29 30 |
# File 'lib/riffer/config.rb', line 28 def amazon_bedrock @amazon_bedrock end |
#anthropic ⇒ Object (readonly)
Anthropic configuration (Struct with api_key).
31 32 33 |
# File 'lib/riffer/config.rb', line 31 def anthropic @anthropic end |
#azure_openai ⇒ Object (readonly)
Azure OpenAI configuration (Struct with api_key and endpoint).
34 35 36 |
# File 'lib/riffer/config.rb', line 34 def azure_openai @azure_openai end |
#evals ⇒ Object (readonly)
Evals configuration (Struct with judge_model).
43 44 45 |
# File 'lib/riffer/config.rb', line 43 def evals @evals end |
#gemini ⇒ Object (readonly)
Google Gemini configuration (Struct with api_key, open_timeout, and read_timeout).
37 38 39 |
# File 'lib/riffer/config.rb', line 37 def gemini @gemini end |
#message_id_strategy ⇒ Object
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.
70 71 72 |
# File 'lib/riffer/config.rb', line 70 def @message_id_strategy end |
#openai ⇒ Object (readonly)
OpenAI configuration (Struct with api_key).
40 41 42 |
# File 'lib/riffer/config.rb', line 40 def openai @openai end |
#tool_runtime ⇒ Object
Global tool runtime configuration (experimental).
Accepts a Riffer::ToolRuntime subclass, a Riffer::ToolRuntime instance, or a Proc. Defaults to Riffer::ToolRuntime::Inline.new.
49 50 51 |
# File 'lib/riffer/config.rb', line 49 def tool_runtime @tool_runtime end |