Class: ActiveAgent::Providers::OpenRouterProvider

Inherits:
ActiveAgent::Providers::OpenAI::ChatProvider show all
Defined in:
lib/active_agent/providers/open_router_provider.rb

Overview

Provides access to OpenRouter’s multi-model API.

Extends OpenAI provider to work with OpenRouter’s OpenAI-compatible API, enabling access to multiple AI models through a single interface with model fallbacks, cost tracking, and provider metadata.

Class Method Summary collapse

Methods included from ToolChoiceClearing

#prepare_prompt_request_tools

Methods inherited from ActiveAgent::Providers::OpenAI::Base

#client

Methods inherited from BaseProvider

#embed, embed_request_type, #initialize, namespace, #preview, #prompt, tag_name

Methods included from Previewable

#preview_prompt

Methods included from Instrumentation

#instrumentation_prompt_payload

Methods included from ExceptionHandler

#configure_exception_handler, #rescue_with_handler, #with_exception_handling

Constructor Details

This class inherits a constructor from ActiveAgent::Providers::BaseProvider

Class Method Details

.options_klassClass

Returns:

  • (Class)


25
26
27
# File 'lib/active_agent/providers/open_router_provider.rb', line 25

def self.options_klass
  namespace::Options
end

.prompt_request_typeActiveModel::Type::Value

Returns:

  • (ActiveModel::Type::Value)


30
31
32
# File 'lib/active_agent/providers/open_router_provider.rb', line 30

def self.prompt_request_type
  namespace::RequestType.new
end

.service_nameString

Returns:

  • (String)


20
21
22
# File 'lib/active_agent/providers/open_router_provider.rb', line 20

def self.service_name
  "OpenRouter"
end