Skip to content

Commit

Permalink
Fix build, upgrade to 0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
obie committed Mar 28, 2024
1 parent 07df084 commit 7c7c2ce
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
15 changes: 15 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:" }
Expand Down
4 changes: 2 additions & 2 deletions lib/open_router/client.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

require_relative 'http'
require_relative "http"

module OpenRouter
class ServerError < StandardError; end
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/open_router/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module OpenRouter
VERSION = "0.1.0"
VERSION = "0.2.1"
end

0 comments on commit 7c7c2ce

Please sign in to comment.