ruby_llm 1.8.0 → 1.8.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/README.md +15 -3
- data/lib/generators/ruby_llm/chat_ui/chat_ui_generator.rb +127 -67
- data/lib/generators/ruby_llm/chat_ui/templates/controllers/chats_controller.rb.tt +12 -12
- data/lib/generators/ruby_llm/chat_ui/templates/controllers/messages_controller.rb.tt +7 -7
- data/lib/generators/ruby_llm/chat_ui/templates/controllers/models_controller.rb.tt +4 -4
- data/lib/generators/ruby_llm/chat_ui/templates/jobs/chat_response_job.rb.tt +6 -6
- data/lib/generators/ruby_llm/chat_ui/templates/views/chats/_chat.html.erb.tt +4 -4
- data/lib/generators/ruby_llm/chat_ui/templates/views/chats/_form.html.erb.tt +5 -5
- data/lib/generators/ruby_llm/chat_ui/templates/views/chats/index.html.erb.tt +5 -5
- data/lib/generators/ruby_llm/chat_ui/templates/views/chats/new.html.erb.tt +4 -4
- data/lib/generators/ruby_llm/chat_ui/templates/views/chats/show.html.erb.tt +8 -8
- data/lib/generators/ruby_llm/chat_ui/templates/views/messages/_content.html.erb.tt +1 -0
- data/lib/generators/ruby_llm/chat_ui/templates/views/messages/_form.html.erb.tt +5 -5
- data/lib/generators/ruby_llm/chat_ui/templates/views/messages/_message.html.erb.tt +9 -6
- data/lib/generators/ruby_llm/chat_ui/templates/views/messages/_tool_calls.html.erb.tt +7 -0
- data/lib/generators/ruby_llm/chat_ui/templates/views/messages/create.turbo_stream.erb.tt +5 -5
- data/lib/generators/ruby_llm/chat_ui/templates/views/models/_model.html.erb.tt +9 -9
- data/lib/generators/ruby_llm/chat_ui/templates/views/models/index.html.erb.tt +4 -6
- data/lib/generators/ruby_llm/chat_ui/templates/views/models/show.html.erb.tt +11 -11
- data/lib/generators/ruby_llm/generator_helpers.rb +131 -87
- data/lib/generators/ruby_llm/install/install_generator.rb +75 -79
- data/lib/generators/ruby_llm/install/templates/initializer.rb.tt +1 -1
- data/lib/generators/ruby_llm/upgrade_to_v1_7/upgrade_to_v1_7_generator.rb +88 -85
- data/lib/ruby_llm/active_record/acts_as.rb +11 -2
- data/lib/ruby_llm/connection.rb +1 -1
- data/lib/ruby_llm/models.json +686 -840
- data/lib/ruby_llm/providers/openai/capabilities.rb +15 -7
- data/lib/ruby_llm/version.rb +1 -1
- metadata +4 -1
@@ -26,6 +26,9 @@ module RubyLLM
|
|
26
26
|
gpt4o_realtime: /^gpt-4o-realtime/,
|
27
27
|
gpt4o_search: /^gpt-4o-search/,
|
28
28
|
gpt4o_transcribe: /^gpt-4o-transcribe/,
|
29
|
+
gpt5: /^gpt-5/,
|
30
|
+
gpt5_mini: /^gpt-5-mini/,
|
31
|
+
gpt5_nano: /^gpt-5-nano/,
|
29
32
|
o1: /^o1(?!-(?:mini|pro))/,
|
30
33
|
o1_mini: /^o1-mini/,
|
31
34
|
o1_pro: /^o1-pro/,
|
@@ -44,7 +47,7 @@ module RubyLLM
|
|
44
47
|
def context_window_for(model_id)
|
45
48
|
case model_family(model_id)
|
46
49
|
when 'gpt41', 'gpt41_mini', 'gpt41_nano' then 1_047_576
|
47
|
-
when 'chatgpt4o', 'gpt4_turbo', 'gpt4o', 'gpt4o_audio', 'gpt4o_mini',
|
50
|
+
when 'gpt5', 'gpt5_mini', 'gpt5_nano', 'chatgpt4o', 'gpt4_turbo', 'gpt4o', 'gpt4o_audio', 'gpt4o_mini',
|
48
51
|
'gpt4o_mini_audio', 'gpt4o_mini_realtime', 'gpt4o_realtime',
|
49
52
|
'gpt4o_search', 'gpt4o_transcribe', 'gpt4o_mini_search', 'o1_mini' then 128_000
|
50
53
|
when 'gpt4' then 8_192
|
@@ -59,6 +62,7 @@ module RubyLLM
|
|
59
62
|
|
60
63
|
def max_tokens_for(model_id)
|
61
64
|
case model_family(model_id)
|
65
|
+
when 'gpt5', 'gpt5_mini', 'gpt5_nano' then 400_000
|
62
66
|
when 'gpt41', 'gpt41_mini', 'gpt41_nano' then 32_768
|
63
67
|
when 'chatgpt4o', 'gpt4o', 'gpt4o_mini', 'gpt4o_mini_search' then 16_384
|
64
68
|
when 'babbage', 'davinci' then 16_384 # rubocop:disable Lint/DuplicateBranch
|
@@ -76,16 +80,17 @@ module RubyLLM
|
|
76
80
|
|
77
81
|
def supports_vision?(model_id)
|
78
82
|
case model_family(model_id)
|
79
|
-
when '
|
80
|
-
'
|
83
|
+
when 'gpt5', 'gpt5_mini', 'gpt5_nano', 'gpt41', 'gpt41_mini', 'gpt41_nano', 'chatgpt4o', 'gpt4',
|
84
|
+
'gpt4_turbo', 'gpt4o', 'gpt4o_mini', 'o1', 'o1_pro', 'moderation', 'gpt4o_search',
|
85
|
+
'gpt4o_mini_search' then true
|
81
86
|
else false
|
82
87
|
end
|
83
88
|
end
|
84
89
|
|
85
90
|
def supports_functions?(model_id)
|
86
91
|
case model_family(model_id)
|
87
|
-
when '
|
88
|
-
'o3_mini' then true
|
92
|
+
when 'gpt5', 'gpt5_mini', 'gpt5_nano', 'gpt41', 'gpt41_mini', 'gpt41_nano', 'gpt4', 'gpt4_turbo', 'gpt4o',
|
93
|
+
'gpt4o_mini', 'o1', 'o1_pro', 'o3_mini' then true
|
89
94
|
when 'chatgpt4o', 'gpt35_turbo', 'o1_mini', 'gpt4o_mini_tts',
|
90
95
|
'gpt4o_transcribe', 'gpt4o_search', 'gpt4o_mini_search' then false
|
91
96
|
else false # rubocop:disable Lint/DuplicateBranch
|
@@ -94,8 +99,8 @@ module RubyLLM
|
|
94
99
|
|
95
100
|
def supports_structured_output?(model_id)
|
96
101
|
case model_family(model_id)
|
97
|
-
when '
|
98
|
-
'o3_mini' then true
|
102
|
+
when 'gpt5', 'gpt5_mini', 'gpt5_nano', 'gpt41', 'gpt41_mini', 'gpt41_nano', 'chatgpt4o', 'gpt4o',
|
103
|
+
'gpt4o_mini', 'o1', 'o1_pro', 'o3_mini' then true
|
99
104
|
else false
|
100
105
|
end
|
101
106
|
end
|
@@ -105,6 +110,9 @@ module RubyLLM
|
|
105
110
|
end
|
106
111
|
|
107
112
|
PRICES = {
|
113
|
+
gpt5: { input: 1.25, output: 10.0, cached_input: 0.125 },
|
114
|
+
gpt5_mini: { input: 0.25, output: 2.0, cached_input: 0.025 },
|
115
|
+
gpt5_nano: { input: 0.05, output: 0.4, cached_input: 0.005 },
|
108
116
|
gpt41: { input: 2.0, output: 8.0, cached_input: 0.5 },
|
109
117
|
gpt41_mini: { input: 0.4, output: 1.6, cached_input: 0.1 },
|
110
118
|
gpt41_nano: { input: 0.1, output: 0.4 },
|
data/lib/ruby_llm/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_llm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carmine Paolino
|
@@ -146,8 +146,10 @@ files:
|
|
146
146
|
- lib/generators/ruby_llm/chat_ui/templates/views/chats/index.html.erb.tt
|
147
147
|
- lib/generators/ruby_llm/chat_ui/templates/views/chats/new.html.erb.tt
|
148
148
|
- lib/generators/ruby_llm/chat_ui/templates/views/chats/show.html.erb.tt
|
149
|
+
- lib/generators/ruby_llm/chat_ui/templates/views/messages/_content.html.erb.tt
|
149
150
|
- lib/generators/ruby_llm/chat_ui/templates/views/messages/_form.html.erb.tt
|
150
151
|
- lib/generators/ruby_llm/chat_ui/templates/views/messages/_message.html.erb.tt
|
152
|
+
- lib/generators/ruby_llm/chat_ui/templates/views/messages/_tool_calls.html.erb.tt
|
151
153
|
- lib/generators/ruby_llm/chat_ui/templates/views/messages/create.turbo_stream.erb.tt
|
152
154
|
- lib/generators/ruby_llm/chat_ui/templates/views/models/_model.html.erb.tt
|
153
155
|
- lib/generators/ruby_llm/chat_ui/templates/views/models/index.html.erb.tt
|
@@ -283,6 +285,7 @@ metadata:
|
|
283
285
|
changelog_uri: https://github.com/crmne/ruby_llm/commits/main
|
284
286
|
documentation_uri: https://rubyllm.com
|
285
287
|
bug_tracker_uri: https://github.com/crmne/ruby_llm/issues
|
288
|
+
funding_uri: https://github.com/sponsors/crmne
|
286
289
|
rubygems_mfa_required: 'true'
|
287
290
|
post_install_message: |
|
288
291
|
Upgrading from RubyLLM <= 1.6.x? Check the upgrade guide for new features and migration instructions
|