Module: OpenRouter

Defined in:
lib/open_router.rb,
lib/open_router.rb,
lib/open_router/http.rb,
lib/open_router/tool.rb,
lib/open_router/client.rb,
lib/open_router/schema.rb,
lib/open_router/routing.rb,
lib/open_router/version.rb,
lib/open_router/response.rb,
lib/open_router/callbacks.rb,
lib/open_router/tool_call.rb,
lib/open_router/json_healer.rb,
lib/open_router/subagent_tool.rb,
lib/open_router/usage_tracker.rb,
lib/open_router/model_registry.rb,
lib/open_router/model_selector.rb,
lib/open_router/tool_call_base.rb,
lib/open_router/prompt_template.rb,
lib/open_router/request_handler.rb,
lib/open_router/tool_serializer.rb,
lib/open_router/response_parsing.rb,
lib/open_router/streaming_client.rb,
lib/open_router/parameter_builder.rb,
lib/open_router/completion_options.rb,
lib/open_router/responses_response.rb,
lib/open_router/responses_tool_call.rb,
sig/open_router.rbs

Defined Under Namespace

Modules: Callbacks, HTTP, ParameterBuilder, Prompt, RequestHandler, ResponseParsing, Routing, ToolCallBase, ToolResultBase, ToolSerializer Classes: CapabilityError, Client, CompletionOptions, Configuration, ConfigurationError, Error, JsonHealer, ModelRegistry, ModelRegistryError, ModelSelectionError, ModelSelector, PromptTemplate, Response, ResponseAccumulator, ResponsesResponse, ResponsesToolCall, ResponsesToolResult, Schema, SchemaValidationError, ServerError, StreamingClient, StructuredOutputError, SubagentTool, Tool, ToolCall, ToolCallError, ToolResult, UsageTracker

Constant Summary collapse

VERSION =
"2.2.0"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject



132
133
134
# File 'lib/open_router.rb', line 132

def self.configuration
  @configuration ||= OpenRouter::Configuration.new
end

Class Method Details

.configure {|configuration| ... } ⇒ Object

Yields:



136
137
138
# File 'lib/open_router.rb', line 136

def self.configure
  yield(configuration)
end

.log_warning(message) ⇒ Object



140
141
142
143
144
145
146
# File 'lib/open_router.rb', line 140

def self.log_warning(message)
  if configuration.logger
    configuration.logger.warn(message)
  else
    Kernel.warn(message)
  end
end