diff --git a/.rubocop.yml b/.rubocop.yml index 761dd23..3147301 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,9 +4,24 @@ AllCops: Layout/LineLength: Enabled: false +Metrics/AbcSize: + Enabled: false + Metrics/BlockLength: Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false + +Metrics/MethodLength: + Enabled: false + +Metrics/ParameterLists: + Enabled: false + +Metrics/PerceivedComplexity: + Enabled: false + Style/Documentation: Enabled: false diff --git a/README.md b/README.md index 983678f..45175e6 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ puts response["choices"][0]["message"]["content"] Pass an array to the `model` parameter to enable [explicit model routing](https://openrouter.ai/docs#model-routing). ```ruby -OpenRouter::Client.new.chat_completion( +OpenRouter::Client.new.complete( [ { role: "system", content: SYSTEM_PROMPT }, { role: "user", content: "Provide analysis of the data formatted as JSON:" } diff --git a/lib/open_router/client.rb b/lib/open_router/client.rb index ea0eb38..781b82d 100644 --- a/lib/open_router/client.rb +++ b/lib/open_router/client.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative 'http' +require_relative "http" module OpenRouter class ServerError < StandardError; end @@ -21,7 +21,7 @@ def initialize # @param extras [Hash] Optional hash of model-specific parameters to send to the OpenRouter API # @param stream [Proc, nil] Optional callable object for streaming # @return [Hash] The completion response. - def chat_completion(messages, model: 'openrouter/auto', providers: [], transforms: [], extras: {}, stream: nil) + def complete(messages, model: "openrouter/auto", providers: [], transforms: [], extras: {}, stream: nil) parameters = { messages: } if model.is_a?(String) parameters[:model] = model diff --git a/lib/open_router/version.rb b/lib/open_router/version.rb index 9d0e693..3df29c2 100644 --- a/lib/open_router/version.rb +++ b/lib/open_router/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module OpenRouter - VERSION = "0.1.0" + VERSION = "0.2.1" end