open_router_enhanced 1.0.0 → 1.2.0
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 +36 -0
- data/Gemfile.lock +45 -47
- data/README.md +151 -1228
- data/docs/observability.md +3 -0
- data/docs/plugins.md +183 -0
- data/docs/responses_api.md +298 -0
- data/docs/streaming.md +18 -3
- data/docs/structured_outputs.md +466 -146
- data/lib/open_router/client.rb +122 -5
- data/lib/open_router/responses_response.rb +192 -0
- data/lib/open_router/responses_tool_call.rb +95 -0
- data/lib/open_router/tool_call.rb +13 -59
- data/lib/open_router/tool_call_base.rb +69 -0
- data/lib/open_router/version.rb +1 -1
- data/lib/open_router.rb +9 -0
- metadata +7 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1e39d5924a6388355a4ecae7a76933bf429546a3a5da1975d5dd020804735d24
|
|
4
|
+
data.tar.gz: 220e9504b58ad511e971a8c4a13939edef2c390f0ffeb031e21dfdb30ce78941
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 61f753aedc0057758a7cb8310ba06b5751da07ca17ed6bd433473e8ce36184286a37060cd32b2595ac9a8b5e9c798cd2db078ae5c7ddf2232c4b6c271d44623a
|
|
7
|
+
data.tar.gz: bb9f8c9122ddc7fc1c850b34a76ee9e209ca14ff95ff4fe2dbd68b8fccdf10021f78111cd994c0e0f3a163ee61512434b39410227ec818cbf52a1cf22aac5ff6
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [1.2.0] - 2025-12-24
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- **Responses API**: Full support for OpenRouter's Responses API Beta (`/api/v1/responses`)
|
|
7
|
+
- Simple string or structured array input
|
|
8
|
+
- Reasoning with configurable effort levels (`minimal`, `low`, `medium`, `high`)
|
|
9
|
+
- `ResponsesResponse` wrapper with convenient accessors
|
|
10
|
+
- **Responses API Tool Calling**: Complete function calling support for Responses API
|
|
11
|
+
- `ResponsesToolCall` and `ResponsesToolResult` classes
|
|
12
|
+
- `execute_tool_calls` for easy tool execution with blocks
|
|
13
|
+
- `build_follow_up_input` for multi-turn tool conversations
|
|
14
|
+
- `tool_choice` parameter (`auto`, `required`, `none`)
|
|
15
|
+
- Automatic format conversion from Chat Completions tool format
|
|
16
|
+
- **Shared Tool Call Infrastructure**: Extracted `ToolCallBase` and `ToolResultBase` modules
|
|
17
|
+
- DRY shared behavior for argument parsing and execution
|
|
18
|
+
- Consistent interface across Chat Completions and Responses APIs
|
|
19
|
+
|
|
20
|
+
### Documentation
|
|
21
|
+
- New `docs/responses_api.md` with comprehensive Responses API guide
|
|
22
|
+
- Tool calling examples with Tool DSL and hash formats
|
|
23
|
+
|
|
24
|
+
## [1.1.0] - 2025-12-24
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
- **Native Response Healing Plugin**: Automatic server-side JSON healing for structured outputs via OpenRouter's `response-healing` plugin (free, <1ms latency)
|
|
28
|
+
- **Plugins Parameter**: Support for OpenRouter plugins (`web-search`, `pdf-inputs`, `response-healing`) via new `plugins:` parameter
|
|
29
|
+
- **Prediction Parameter**: Latency optimization via `prediction:` parameter for predictable outputs
|
|
30
|
+
- **Auto Native Healing**: Automatically enables `response-healing` plugin when using structured outputs (configurable via `auto_native_healing` setting)
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
- Enhanced structured output workflow: native healing catches syntax errors server-side, client-side healing handles schema validation
|
|
34
|
+
|
|
35
|
+
### Configuration
|
|
36
|
+
- New `auto_native_healing` config option (default: `true`)
|
|
37
|
+
- Environment variable: `OPENROUTER_AUTO_NATIVE_HEALING`
|
|
38
|
+
|
|
3
39
|
## [1.0.0] - 2025-10-07
|
|
4
40
|
|
|
5
41
|
### Major Features
|
data/Gemfile.lock
CHANGED
|
@@ -1,94 +1,94 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
open_router_enhanced (1.
|
|
5
|
-
activesupport (>= 6.0)
|
|
6
|
-
dotenv (>= 2)
|
|
7
|
-
faraday (>= 1)
|
|
8
|
-
faraday-multipart (>= 1)
|
|
4
|
+
open_router_enhanced (1.2.0)
|
|
5
|
+
activesupport (>= 6.0, < 9.0)
|
|
6
|
+
dotenv (>= 2.0, < 4.0)
|
|
7
|
+
faraday (>= 1.0, < 3.0)
|
|
8
|
+
faraday-multipart (>= 1.0, < 2.0)
|
|
9
9
|
json-schema (~> 4.0)
|
|
10
10
|
|
|
11
11
|
GEM
|
|
12
12
|
remote: https://rubygems.org/
|
|
13
13
|
specs:
|
|
14
|
-
activesupport (8.
|
|
14
|
+
activesupport (8.1.1)
|
|
15
15
|
base64
|
|
16
|
-
benchmark (>= 0.3)
|
|
17
16
|
bigdecimal
|
|
18
17
|
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
19
18
|
connection_pool (>= 2.2.5)
|
|
20
19
|
drb
|
|
21
20
|
i18n (>= 1.6, < 2)
|
|
21
|
+
json
|
|
22
22
|
logger (>= 1.4.2)
|
|
23
23
|
minitest (>= 5.1)
|
|
24
24
|
securerandom (>= 0.3)
|
|
25
25
|
tzinfo (~> 2.0, >= 2.0.5)
|
|
26
26
|
uri (>= 0.13.1)
|
|
27
|
-
addressable (2.8.
|
|
28
|
-
public_suffix (>= 2.0.2, <
|
|
27
|
+
addressable (2.8.8)
|
|
28
|
+
public_suffix (>= 2.0.2, < 8.0)
|
|
29
29
|
ast (2.4.3)
|
|
30
30
|
base64 (0.3.0)
|
|
31
|
-
|
|
32
|
-
bigdecimal (3.2.2)
|
|
31
|
+
bigdecimal (4.0.1)
|
|
33
32
|
coderay (1.1.3)
|
|
34
|
-
concurrent-ruby (1.3.
|
|
35
|
-
connection_pool (
|
|
36
|
-
crack (1.0.
|
|
33
|
+
concurrent-ruby (1.3.6)
|
|
34
|
+
connection_pool (3.0.2)
|
|
35
|
+
crack (1.0.1)
|
|
37
36
|
bigdecimal
|
|
38
37
|
rexml
|
|
39
38
|
diff-lcs (1.6.2)
|
|
40
|
-
dotenv (3.
|
|
39
|
+
dotenv (3.2.0)
|
|
41
40
|
drb (2.2.3)
|
|
42
|
-
faraday (2.
|
|
41
|
+
faraday (2.14.0)
|
|
43
42
|
faraday-net_http (>= 2.0, < 3.5)
|
|
44
43
|
json
|
|
45
44
|
logger
|
|
46
45
|
faraday-multipart (1.1.1)
|
|
47
46
|
multipart-post (~> 2.0)
|
|
48
|
-
faraday-net_http (3.4.
|
|
49
|
-
net-http (
|
|
50
|
-
hashdiff (1.2.
|
|
51
|
-
i18n (1.14.
|
|
47
|
+
faraday-net_http (3.4.2)
|
|
48
|
+
net-http (~> 0.5)
|
|
49
|
+
hashdiff (1.2.1)
|
|
50
|
+
i18n (1.14.8)
|
|
52
51
|
concurrent-ruby (~> 1.0)
|
|
53
|
-
json (2.
|
|
52
|
+
json (2.18.0)
|
|
54
53
|
json-schema (4.3.1)
|
|
55
54
|
addressable (>= 2.8)
|
|
56
55
|
language_server-protocol (3.17.0.5)
|
|
57
56
|
lint_roller (1.1.0)
|
|
58
57
|
logger (1.7.0)
|
|
59
58
|
method_source (1.1.0)
|
|
60
|
-
minitest (
|
|
59
|
+
minitest (6.0.0)
|
|
60
|
+
prism (~> 1.5)
|
|
61
61
|
multipart-post (2.4.1)
|
|
62
|
-
net-http (0.
|
|
63
|
-
uri
|
|
62
|
+
net-http (0.9.1)
|
|
63
|
+
uri (>= 0.11.1)
|
|
64
64
|
parallel (1.27.0)
|
|
65
|
-
parser (3.3.
|
|
65
|
+
parser (3.3.10.0)
|
|
66
66
|
ast (~> 2.4.1)
|
|
67
67
|
racc
|
|
68
|
-
prism (1.
|
|
68
|
+
prism (1.7.0)
|
|
69
69
|
pry (0.15.2)
|
|
70
70
|
coderay (~> 1.1)
|
|
71
71
|
method_source (~> 1.0)
|
|
72
|
-
public_suffix (
|
|
72
|
+
public_suffix (7.0.0)
|
|
73
73
|
racc (1.8.1)
|
|
74
74
|
rainbow (3.1.1)
|
|
75
|
-
rake (13.3.
|
|
76
|
-
regexp_parser (2.11.
|
|
77
|
-
rexml (3.4.
|
|
78
|
-
rspec (3.13.
|
|
75
|
+
rake (13.3.1)
|
|
76
|
+
regexp_parser (2.11.3)
|
|
77
|
+
rexml (3.4.4)
|
|
78
|
+
rspec (3.13.2)
|
|
79
79
|
rspec-core (~> 3.13.0)
|
|
80
80
|
rspec-expectations (~> 3.13.0)
|
|
81
81
|
rspec-mocks (~> 3.13.0)
|
|
82
|
-
rspec-core (3.13.
|
|
82
|
+
rspec-core (3.13.6)
|
|
83
83
|
rspec-support (~> 3.13.0)
|
|
84
84
|
rspec-expectations (3.13.5)
|
|
85
85
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
86
86
|
rspec-support (~> 3.13.0)
|
|
87
|
-
rspec-mocks (3.13.
|
|
87
|
+
rspec-mocks (3.13.7)
|
|
88
88
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
89
89
|
rspec-support (~> 3.13.0)
|
|
90
|
-
rspec-support (3.13.
|
|
91
|
-
rubocop (1.
|
|
90
|
+
rspec-support (3.13.6)
|
|
91
|
+
rubocop (1.82.1)
|
|
92
92
|
json (~> 2.3)
|
|
93
93
|
language_server-protocol (~> 3.17.0.2)
|
|
94
94
|
lint_roller (~> 1.1.0)
|
|
@@ -96,31 +96,29 @@ GEM
|
|
|
96
96
|
parser (>= 3.3.0.2)
|
|
97
97
|
rainbow (>= 2.2.2, < 4.0)
|
|
98
98
|
regexp_parser (>= 2.9.3, < 3.0)
|
|
99
|
-
rubocop-ast (>= 1.
|
|
99
|
+
rubocop-ast (>= 1.48.0, < 2.0)
|
|
100
100
|
ruby-progressbar (~> 1.7)
|
|
101
101
|
unicode-display_width (>= 2.4.0, < 4.0)
|
|
102
|
-
rubocop-ast (1.
|
|
102
|
+
rubocop-ast (1.48.0)
|
|
103
103
|
parser (>= 3.3.7.2)
|
|
104
104
|
prism (~> 1.4)
|
|
105
105
|
ruby-progressbar (1.13.0)
|
|
106
106
|
securerandom (0.4.1)
|
|
107
107
|
tzinfo (2.0.6)
|
|
108
108
|
concurrent-ruby (~> 1.0)
|
|
109
|
-
unicode-display_width (3.
|
|
110
|
-
unicode-emoji (~> 4.
|
|
111
|
-
unicode-emoji (4.0
|
|
112
|
-
uri (1.
|
|
113
|
-
vcr (6.
|
|
114
|
-
|
|
115
|
-
webmock (3.25.1)
|
|
109
|
+
unicode-display_width (3.2.0)
|
|
110
|
+
unicode-emoji (~> 4.1)
|
|
111
|
+
unicode-emoji (4.2.0)
|
|
112
|
+
uri (1.1.1)
|
|
113
|
+
vcr (6.4.0)
|
|
114
|
+
webmock (3.26.1)
|
|
116
115
|
addressable (>= 2.8.0)
|
|
117
116
|
crack (>= 0.3.2)
|
|
118
117
|
hashdiff (>= 0.4.0, < 2.0.0)
|
|
119
118
|
|
|
120
119
|
PLATFORMS
|
|
121
|
-
arm64-darwin-21
|
|
122
120
|
arm64-darwin-24
|
|
123
|
-
|
|
121
|
+
ruby
|
|
124
122
|
|
|
125
123
|
DEPENDENCIES
|
|
126
124
|
activesupport (>= 6.0)
|
|
@@ -135,4 +133,4 @@ DEPENDENCIES
|
|
|
135
133
|
webmock (~> 3.19)
|
|
136
134
|
|
|
137
135
|
BUNDLED WITH
|
|
138
|
-
2.
|
|
136
|
+
2.6.7
|