raix 0.9.1 → 0.9.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 +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +3 -1
- data/lib/mcp/sse_client.rb +3 -1
- data/lib/mcp/stdio_client.rb +3 -1
- data/lib/raix/chat_completion.rb +2 -2
- data/lib/raix/configuration.rb +1 -1
- data/lib/raix/mcp.rb +3 -3
- data/lib/raix/version.rb +1 -1
- metadata +15 -2
- data/raix.gemspec +0 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5464c46a401957877b024ec9a1140b6f2624add3f21c172253663988c74baa49
|
4
|
+
data.tar.gz: a556464db7a06866cf6ecd27530b7ddcbbc372fa8e4f96f7ba84f0c6467de3b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c99d540f8f8c7c0c35a57628d322ff0eef31803c0bee7244476633bd092320bd7040ceebb4b20126b55529bfe0fb373fee01e4977871a3eedf1e135331e9b4e2
|
7
|
+
data.tar.gz: 53e124ebdf99b0b176fb0c30d15c40e9a3156e210686d705237aa43fc02e2ca0e71a63e5efd75deffaf1f5565a34837ccd6d7f1b1dd6f2cbf6b6d9d5c3f137d2
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## [0.9.2] - 2025-06-03
|
2
|
+
### Fixed
|
3
|
+
- Fixed OpenAI chat completion compatibility
|
4
|
+
- Fixed SHA256 hexdigest generation for MCP tool names
|
5
|
+
- Added ostruct as explicit dependency to prevent warnings
|
6
|
+
- Fixed rubocop lint error for alphabetized gemspec dependencies
|
7
|
+
- Updated default OpenRouter model
|
8
|
+
|
1
9
|
## [0.9.1] - 2025-05-30
|
2
10
|
### Added
|
3
11
|
- **MCP Type Coercion** - Automatic type conversion for MCP tool arguments based on JSON schema
|
data/Gemfile.lock
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
raix (0.9.
|
4
|
+
raix (0.9.2)
|
5
5
|
activesupport (>= 6.0)
|
6
6
|
faraday-retry (~> 2.0)
|
7
7
|
open_router (~> 0.2)
|
8
|
+
ostruct
|
8
9
|
ruby-openai (~> 7)
|
9
10
|
|
10
11
|
GEM
|
@@ -97,6 +98,7 @@ GEM
|
|
97
98
|
dotenv (>= 2)
|
98
99
|
faraday (>= 1)
|
99
100
|
faraday-multipart (>= 1)
|
101
|
+
ostruct (0.6.1)
|
100
102
|
parallel (1.24.0)
|
101
103
|
parser (3.3.0.5)
|
102
104
|
ast (~> 2.4.1)
|
data/lib/mcp/sse_client.rb
CHANGED
@@ -3,6 +3,7 @@ require "json"
|
|
3
3
|
require "securerandom"
|
4
4
|
require "faraday"
|
5
5
|
require "uri"
|
6
|
+
require "digest"
|
6
7
|
|
7
8
|
module Raix
|
8
9
|
module MCP
|
@@ -84,7 +85,8 @@ module Raix
|
|
84
85
|
end
|
85
86
|
|
86
87
|
def unique_key
|
87
|
-
@url.parameterize.underscore.gsub("https_", "")
|
88
|
+
parametrized_url = @url.parameterize.underscore.gsub("https_", "")
|
89
|
+
Digest::SHA256.hexdigest(parametrized_url)[0..2]
|
88
90
|
end
|
89
91
|
|
90
92
|
private
|
data/lib/mcp/stdio_client.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require_relative "tool"
|
2
2
|
require "json"
|
3
3
|
require "securerandom"
|
4
|
+
require "digest"
|
4
5
|
|
5
6
|
module Raix
|
6
7
|
module MCP
|
@@ -57,7 +58,8 @@ module Raix
|
|
57
58
|
end
|
58
59
|
|
59
60
|
def unique_key
|
60
|
-
@args.join(" ").parameterize.underscore
|
61
|
+
parametrized_args = @args.join(" ").parameterize.underscore
|
62
|
+
Digest::SHA256.hexdigest(parametrized_args)[0..2]
|
61
63
|
end
|
62
64
|
|
63
65
|
private
|
data/lib/raix/chat_completion.rb
CHANGED
@@ -60,12 +60,12 @@ module Raix
|
|
60
60
|
# @param params [Hash] The parameters for chat completion.
|
61
61
|
# @option loop [Boolean] :loop (false) Whether to loop the chat completion after function calls.
|
62
62
|
# @option params [Boolean] :json (false) Whether to return the parse the response as a JSON object. Will search for <json> tags in the response first, then fall back to the default JSON parsing of the entire response.
|
63
|
-
# @option params [
|
63
|
+
# @option params [String] :openai (nil) If non-nil, use OpenAI with the model specified in this param.
|
64
64
|
# @option params [Boolean] :raw (false) Whether to return the raw response or dig the text content.
|
65
65
|
# @option params [Array] :messages (nil) An array of messages to use instead of the transcript.
|
66
66
|
# @option tools [Array|false] :available_tools (nil) Tools to pass to the LLM. Ignored if nil (default). If false, no tools are passed. If an array, only declared tools in the array are passed.
|
67
67
|
# @return [String|Hash] The completed chat response.
|
68
|
-
def chat_completion(params: {}, loop: false, json: false, raw: false, openai:
|
68
|
+
def chat_completion(params: {}, loop: false, json: false, raw: false, openai: nil, save_response: true, messages: nil, available_tools: nil)
|
69
69
|
# set params to default values if not provided
|
70
70
|
params[:cache_at] ||= cache_at.presence
|
71
71
|
params[:frequency_penalty] ||= frequency_penalty.presence
|
data/lib/raix/configuration.rb
CHANGED
@@ -38,7 +38,7 @@ module Raix
|
|
38
38
|
|
39
39
|
DEFAULT_MAX_TOKENS = 1000
|
40
40
|
DEFAULT_MAX_COMPLETION_TOKENS = 16_384
|
41
|
-
DEFAULT_MODEL = "meta-llama/llama-3-8b-instruct:free"
|
41
|
+
DEFAULT_MODEL = "meta-llama/llama-3.3-8b-instruct:free"
|
42
42
|
DEFAULT_TEMPERATURE = 0.0
|
43
43
|
|
44
44
|
# Initializes a new instance of the Configuration class with default values.
|
data/lib/raix/mcp.rb
CHANGED
@@ -102,7 +102,7 @@ module Raix
|
|
102
102
|
filtered_tools.each do |tool|
|
103
103
|
remote_name = tool.name
|
104
104
|
# TODO: Revisit later whether this much context is needed in the function name
|
105
|
-
local_name = "#{
|
105
|
+
local_name = "#{remote_name}_#{client.unique_key}".to_sym
|
106
106
|
|
107
107
|
description = tool.description
|
108
108
|
input_schema = tool.input_schema || {}
|
@@ -140,7 +140,7 @@ module Raix
|
|
140
140
|
id: call_id,
|
141
141
|
type: "function",
|
142
142
|
function: {
|
143
|
-
name:
|
143
|
+
name: local_name.to_s,
|
144
144
|
arguments: arguments.to_json
|
145
145
|
}
|
146
146
|
}
|
@@ -149,7 +149,7 @@ module Raix
|
|
149
149
|
{
|
150
150
|
role: "tool",
|
151
151
|
tool_call_id: call_id,
|
152
|
-
name:
|
152
|
+
name: local_name.to_s,
|
153
153
|
content: content_text
|
154
154
|
}
|
155
155
|
]
|
data/lib/raix/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: raix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Obie Fernandez
|
@@ -51,6 +51,20 @@ dependencies:
|
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '0.2'
|
54
|
+
- !ruby/object:Gem::Dependency
|
55
|
+
name: ostruct
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
type: :runtime
|
62
|
+
prerelease: false
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
54
68
|
- !ruby/object:Gem::Dependency
|
55
69
|
name: ruby-openai
|
56
70
|
requirement: !ruby/object:Gem::Requirement
|
@@ -96,7 +110,6 @@ files:
|
|
96
110
|
- lib/raix/prompt_declarations.rb
|
97
111
|
- lib/raix/response_format.rb
|
98
112
|
- lib/raix/version.rb
|
99
|
-
- raix.gemspec
|
100
113
|
- sig/raix.rbs
|
101
114
|
homepage: https://github.com/OlympiaAI/raix
|
102
115
|
licenses:
|
data/raix.gemspec
DELETED
@@ -1,35 +0,0 @@
|
|
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 "ruby-openai", "~> 7"
|
35
|
-
end
|