raix 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5413df57139a529bf573642931910e4109cd260beae531c3fdce54fdc3961485
4
- data.tar.gz: 1feb3f57924489378b7029981bc9a5ad42b131848b6a378c7a1860b1456c4fc5
3
+ metadata.gz: 9ae2cafb0dfef15674cc95ed9067309f158d88c24a2ea23581f6331f20a49063
4
+ data.tar.gz: 214e5257dc699b26f4fa529278b367cf9fa30f6b27e81de8225b3eecfb33a297
5
5
  SHA512:
6
- metadata.gz: 7988de746caf67aafc4e21c1f9da3d1129c3b595723a28d41383dd4208bd7c84414d973c7530275920ff7c0732951e1cddc650aeb4eecfc99f28e3c32c86126a
7
- data.tar.gz: b7cff4d03a83f584b4d0b414850b9eb25db02277e1b17e5a22c2415398e01135edd190f7ee249658616921d4ff93a25bb57dbab736b2936cf886763e4d975030
6
+ metadata.gz: d6f319bb682d8ad3134aee647e1052dd63c46e5a899d370b6a25f846b02ca52de5b03008e006dcc9e9496788a68c3e19a3c05676715c9f5324b3a47e8faf11e6
7
+ data.tar.gz: e00be61584c497bcdef12ac42df9b21a10d724e2a50031490db225450d7cb0dc41818b21c50fc4718854e5f461aada2ee030b087819dec789f70e4abfa89c891
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## [1.0.2] - 2025-07-16
2
+ ### Added
3
+ - Added method to check for API client availability in Configuration
4
+
5
+ ### Changed
6
+ - Updated ruby-openai dependency to ~> 8.1
7
+
8
+ ### Fixed
9
+ - Fixed gemspec file reference
10
+
1
11
  ## [1.0.1] - 2025-06-04
2
12
  ### Fixed
3
13
  - Fixed PromptDeclarations module namespace - now properly namespaced under Raix
data/Gemfile CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- # Specify your gem's dependencies in raix-rails.gemspec
5
+ # Specify your gem's dependencies in raix.gemspec
6
6
  gemspec
7
7
 
8
8
  group :development do
data/Gemfile.lock CHANGED
@@ -1,12 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- raix (1.0.1)
4
+ raix (1.0.2)
5
5
  activesupport (>= 6.0)
6
6
  faraday-retry (~> 2.0)
7
7
  open_router (~> 0.2)
8
8
  ostruct
9
- ruby-openai (~> 7)
9
+ ruby-openai (~> 8.1)
10
10
 
11
11
  GEM
12
12
  remote: https://rubygems.org/
@@ -148,7 +148,7 @@ GEM
148
148
  unicode-display_width (>= 2.4.0, < 3.0)
149
149
  rubocop-ast (1.31.2)
150
150
  parser (>= 3.3.0.4)
151
- ruby-openai (7.1.0)
151
+ ruby-openai (8.1.0)
152
152
  event_stream_parser (>= 0.3.0, < 2.0.0)
153
153
  faraday (>= 1)
154
154
  faraday-multipart (>= 1)
data/README.md CHANGED
@@ -713,12 +713,27 @@ If bundler is not being used to manage dependencies, install the gem by executin
713
713
 
714
714
  If you are using the default OpenRouter API, Raix expects `Raix.configuration.openrouter_client` to initialized with the OpenRouter API client instance.
715
715
 
716
- You can add an initializer to your application's `config/initializers` directory:
716
+ You can add an initializer to your application's `config/initializers` directory that looks like this example (setting up both providers, OpenRouter and OpenAI):
717
717
 
718
718
  ```ruby
719
719
  # config/initializers/raix.rb
720
+ OpenRouter.configure do |config|
721
+ config.faraday do |f|
722
+ f.request :retry, retry_options
723
+ f.response :logger, Logger.new($stdout), { headers: true, bodies: true, errors: true } do |logger|
724
+ logger.filter(/(Bearer) (\S+)/, '\1[REDACTED]')
725
+ end
726
+ end
727
+ end
728
+
720
729
  Raix.configure do |config|
721
- config.openrouter_client = OpenRouter::Client.new
730
+ config.openrouter_client = OpenRouter::Client.new(access_token: ENV.fetch("OR_ACCESS_TOKEN", nil))
731
+ config.openai_client = OpenAI::Client.new(access_token: ENV.fetch("OAI_ACCESS_TOKEN", nil)) do |f|
732
+ f.request :retry, retry_options
733
+ f.response :logger, Logger.new($stdout), { headers: true, bodies: true, errors: true } do |logger|
734
+ logger.filter(/(Bearer) (\S+)/, '\1[REDACTED]')
735
+ end
736
+ end
722
737
  end
723
738
  ```
724
739
 
@@ -56,6 +56,10 @@ module Raix
56
56
  self.fallback = fallback
57
57
  end
58
58
 
59
+ def client?
60
+ !!(openrouter_client || openai_client)
61
+ end
62
+
59
63
  private
60
64
 
61
65
  attr_accessor :fallback
data/lib/raix/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Raix
4
- VERSION = "1.0.1"
4
+ VERSION = "1.0.2"
5
5
  end
data/raix.gemspec ADDED
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/raix/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "raix"
7
+ spec.version = Raix::VERSION
8
+ spec.authors = ["Obie Fernandez"]
9
+ spec.email = ["obiefernandez@gmail.com"]
10
+
11
+ spec.summary = "Ruby AI eXtensions"
12
+ spec.homepage = "https://github.com/OlympiaAI/raix"
13
+ spec.license = "MIT"
14
+ spec.required_ruby_version = ">= 3.2.2"
15
+
16
+ spec.metadata["homepage_uri"] = spec.homepage
17
+ spec.metadata["source_code_uri"] = "https://github.com/OlympiaAI/raix"
18
+ spec.metadata["changelog_uri"] = "https://github.com/OlympiaAI/raix/blob/main/CHANGELOG.md"
19
+
20
+ # Specify which files should be added to the gem when it is released.
21
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
+ spec.files = Dir.chdir(__dir__) do
23
+ `git ls-files -z`.split("\x0").reject do |f|
24
+ (File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor])
25
+ end
26
+ end
27
+ spec.bindir = "exe"
28
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
29
+ spec.require_paths = ["lib"]
30
+
31
+ spec.add_dependency "activesupport", ">= 6.0"
32
+ spec.add_dependency "faraday-retry", "~> 2.0"
33
+ spec.add_dependency "open_router", "~> 0.2"
34
+ spec.add_dependency "ostruct"
35
+ spec.add_dependency "ruby-openai", "~> 8.1"
36
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raix
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Obie Fernandez
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
10
+ date: 2025-07-16 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: activesupport
@@ -71,14 +71,14 @@ dependencies:
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: '7'
74
+ version: '8.1'
75
75
  type: :runtime
76
76
  prerelease: false
77
77
  version_requirements: !ruby/object:Gem::Requirement
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '7'
81
+ version: '8.1'
82
82
  email:
83
83
  - obiefernandez@gmail.com
84
84
  executables: []
@@ -111,6 +111,7 @@ files:
111
111
  - lib/raix/prompt_declarations.rb
112
112
  - lib/raix/response_format.rb
113
113
  - lib/raix/version.rb
114
+ - raix.gemspec
114
115
  - sig/raix.rbs
115
116
  homepage: https://github.com/OlympiaAI/raix
116
117
  licenses:
@@ -133,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
134
  - !ruby/object:Gem::Version
134
135
  version: '0'
135
136
  requirements: []
136
- rubygems_version: 3.6.8
137
+ rubygems_version: 3.6.2
137
138
  specification_version: 4
138
139
  summary: Ruby AI eXtensions
139
140
  test_files: []