Class: RubyCode::Adapters::Openrouter

Inherits:
Base
  • Object
show all
Defined in:
lib/rubycode/adapters/openrouter.rb

Overview

OpenRouter adapter for cloud LLM integration (OpenAI-compatible API) Provides access to multiple LLM providers through a unified API

Constant Summary collapse

API_ENDPOINT =
"https://openrouter.ai/api/v1/chat/completions"

Instance Attribute Summary

Attributes inherited from Base

#current_request_tokens, #last_request_time, #total_tokens_counter

Instance Method Summary collapse

Methods inherited from Base

#generate

Constructor Details

#initialize(config) ⇒ Openrouter

Returns a new instance of Openrouter.



13
14
15
16
# File 'lib/rubycode/adapters/openrouter.rb', line 13

def initialize(config)
  super
  validate_api_key!
end