ruby_llm 0.1.0.pre37 → 0.1.0.pre38

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: 8befc508f1a0bdbaf7b113f3a2f8584f78fbe756ac07b22344af9ea90bc47f31
4
- data.tar.gz: 389cb1518cacfa6448f30891d45e573536c768aa8092f8d1fbac156ff4c2d4c5
3
+ metadata.gz: efcf5aa8692558d9214d82dbb6c053727b1b6c5e810fcd7cd224e9a909ae38ff
4
+ data.tar.gz: 4910f4d7dade64d20696f5af971e968ce31abf0d98eae14fa7c874efe6ac03ce
5
5
  SHA512:
6
- metadata.gz: 67493fd05b3c9f0765b8d7bd72d295756e615ad6ab8b133181c8a472d28a64ce83e8aaedf48f556de8e9ddc1d39c59fdd4e7cdf4f0521eff9b9d34726a6b6bcd
7
- data.tar.gz: e4569279dc890b62881c3d8da2cd03370fd8a87f6c20f112fe0bbce2d61aec0acba726d9d89252b724f4f4a2cc97ce383f229bddc8ea9d6c204fbcc66e71f6de
6
+ metadata.gz: 31679bff69003430d7f662dfa822a640ea6863087bf9e2260b0555f7341c41d3368a2e07d7c515c78255f5b1b400a05b08c631a80ee4ed7871fd0ceedb330ca2
7
+ data.tar.gz: 306fbf3cc3f35688b03b73995abe962152ddcde8d438093f4b4879d8c0b271187e4c7c26b10b8393f80556b955e1c631a8b30fdd693605712353cd7d6aa5e9cb
data/.rspec_status CHANGED
@@ -1,7 +1,38 @@
1
- example_id | status | run_time |
2
- ------------------------------------------- | ------ | ------------ |
3
- ./spec/ruby_llm/chat_content_spec.rb[1:1:1] | passed | 3.59 seconds |
4
- ./spec/ruby_llm/chat_content_spec.rb[1:1:2] | passed | 1.51 seconds |
5
- ./spec/ruby_llm/chat_content_spec.rb[1:1:3] | passed | 2.29 seconds |
6
- ./spec/ruby_llm/chat_content_spec.rb[1:2:1] | passed | 2.06 seconds |
7
- ./spec/ruby_llm/chat_content_spec.rb[1:2:2] | passed | 2.04 seconds |
1
+ example_id | status | run_time |
2
+ -------------------------------------------------- | ------ | --------------- |
3
+ ./spec/ruby_llm/active_record/acts_as_spec.rb[1:1] | passed | 3.38 seconds |
4
+ ./spec/ruby_llm/active_record/acts_as_spec.rb[1:2] | passed | 2.48 seconds |
5
+ ./spec/ruby_llm/chat_content_spec.rb[1:1:1] | passed | 2.74 seconds |
6
+ ./spec/ruby_llm/chat_content_spec.rb[1:1:2] | passed | 1.29 seconds |
7
+ ./spec/ruby_llm/chat_content_spec.rb[1:1:3] | passed | 2.54 seconds |
8
+ ./spec/ruby_llm/chat_content_spec.rb[1:2:1] | passed | 2.77 seconds |
9
+ ./spec/ruby_llm/chat_content_spec.rb[1:2:2] | passed | 2.1 seconds |
10
+ ./spec/ruby_llm/chat_spec.rb[1:1:1:1] | passed | 1.02 seconds |
11
+ ./spec/ruby_llm/chat_spec.rb[1:1:1:2] | passed | 3.95 seconds |
12
+ ./spec/ruby_llm/chat_spec.rb[1:1:2:1] | passed | 0.4854 seconds |
13
+ ./spec/ruby_llm/chat_spec.rb[1:1:2:2] | passed | 1.37 seconds |
14
+ ./spec/ruby_llm/chat_spec.rb[1:1:3:1] | passed | 7.34 seconds |
15
+ ./spec/ruby_llm/chat_spec.rb[1:1:3:2] | passed | 19.22 seconds |
16
+ ./spec/ruby_llm/chat_spec.rb[1:1:4:1] | passed | 3.15 seconds |
17
+ ./spec/ruby_llm/chat_spec.rb[1:1:4:2] | passed | 2.51 seconds |
18
+ ./spec/ruby_llm/chat_streaming_spec.rb[1:1:1:1] | passed | 0.91374 seconds |
19
+ ./spec/ruby_llm/chat_streaming_spec.rb[1:1:2:1] | passed | 0.50088 seconds |
20
+ ./spec/ruby_llm/chat_streaming_spec.rb[1:1:3:1] | passed | 5.69 seconds |
21
+ ./spec/ruby_llm/chat_streaming_spec.rb[1:1:4:1] | passed | 1.22 seconds |
22
+ ./spec/ruby_llm/chat_tools_spec.rb[1:1:1:1] | passed | 3.75 seconds |
23
+ ./spec/ruby_llm/chat_tools_spec.rb[1:1:1:2] | passed | 6.1 seconds |
24
+ ./spec/ruby_llm/chat_tools_spec.rb[1:1:1:3] | passed | 5.32 seconds |
25
+ ./spec/ruby_llm/chat_tools_spec.rb[1:1:2:1] | passed | 1.21 seconds |
26
+ ./spec/ruby_llm/chat_tools_spec.rb[1:1:2:2] | passed | 2.36 seconds |
27
+ ./spec/ruby_llm/chat_tools_spec.rb[1:1:2:3] | passed | 2.78 seconds |
28
+ ./spec/ruby_llm/chat_tools_spec.rb[1:1:3:1] | passed | 1.87 seconds |
29
+ ./spec/ruby_llm/chat_tools_spec.rb[1:1:3:2] | passed | 3.12 seconds |
30
+ ./spec/ruby_llm/chat_tools_spec.rb[1:1:3:3] | passed | 3.83 seconds |
31
+ ./spec/ruby_llm/embeddings_spec.rb[1:1:1:1] | passed | 0.33357 seconds |
32
+ ./spec/ruby_llm/embeddings_spec.rb[1:1:1:2] | passed | 0.43632 seconds |
33
+ ./spec/ruby_llm/embeddings_spec.rb[1:1:2:1] | passed | 0.65614 seconds |
34
+ ./spec/ruby_llm/embeddings_spec.rb[1:1:2:2] | passed | 2.16 seconds |
35
+ ./spec/ruby_llm/error_handling_spec.rb[1:1] | passed | 0.19586 seconds |
36
+ ./spec/ruby_llm/image_generation_spec.rb[1:1:1] | passed | 12.77 seconds |
37
+ ./spec/ruby_llm/image_generation_spec.rb[1:1:2] | passed | 18.13 seconds |
38
+ ./spec/ruby_llm/image_generation_spec.rb[1:1:3] | passed | 0.00035 seconds |
data/docs/_config.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  title: RubyLLM
2
2
  description: A delightful Ruby way to work with AI
3
- url: https://crmne.github.io/ruby_llm
4
- baseurl: /ruby_llm
3
+ url: https://rubyllm.com
4
+ baseurl: /
5
5
  remote_theme: just-the-docs/just-the-docs
6
6
 
7
7
  # Enable search
data/docs/index.md CHANGED
@@ -15,6 +15,25 @@ A delightful Ruby way to work with AI through a unified interface to OpenAI, Ant
15
15
  [Get started now]({% link installation.md %}){: .btn .btn-primary .fs-5 .mb-4 .mb-md-0 .mr-2 }
16
16
  [View on GitHub](https://github.com/crmne/ruby_llm){: .btn .fs-5 .mb-4 .mb-md-0 }
17
17
 
18
+ ---
19
+ <p align="center">
20
+ <img src="https://upload.wikimedia.org/wikipedia/commons/4/4d/OpenAI_Logo.svg" alt="OpenAI" height="40" width="120">
21
+ &nbsp;&nbsp;&nbsp;&nbsp;
22
+ <img src="https://upload.wikimedia.org/wikipedia/commons/7/78/Anthropic_logo.svg" alt="Anthropic" height="40" width="120">
23
+ &nbsp;&nbsp;&nbsp;&nbsp;
24
+ <img src="https://upload.wikimedia.org/wikipedia/commons/8/8a/Google_Gemini_logo.svg" alt="Google" height="40" width="120">
25
+ &nbsp;&nbsp;&nbsp;&nbsp;
26
+ <img src="https://upload.wikimedia.org/wikipedia/commons/e/ec/DeepSeek_logo.svg" alt="DeepSeek" height="40" width="120">
27
+ </p>
28
+
29
+ <p align="center">
30
+ <a href="https://badge.fury.io/rb/ruby_llm"><img src="https://badge.fury.io/rb/ruby_llm.svg" alt="Gem Version" /></a>
31
+ <a href="https://github.com/testdouble/standard"><img src="https://img.shields.io/badge/code_style-standard-brightgreen.svg" alt="Ruby Style Guide" /></a>
32
+ <a href="https://rubygems.org/gems/ruby_llm"><img alt="Gem Total Downloads" src="https://img.shields.io/gem/dt/ruby_llm"></a>
33
+ <a href="https://github.com/crmne/ruby_llm/actions/workflows/cicd.yml"><img src="https://github.com/crmne/ruby_llm/actions/workflows/cicd.yml/badge.svg" alt="CI" /></a>
34
+ <a href="https://codecov.io/gh/crmne/ruby_llm"><img src="https://codecov.io/gh/crmne/ruby_llm/branch/main/graph/badge.svg" alt="codecov" /></a>
35
+ </p>
36
+
18
37
  ---
19
38
 
20
39
  ## Overview
@@ -22,10 +41,11 @@ A delightful Ruby way to work with AI through a unified interface to OpenAI, Ant
22
41
  RubyLLM provides a beautiful, unified interface to modern AI services, including:
23
42
 
24
43
  - 💬 **Chat** with OpenAI GPT, Anthropic Claude, Google Gemini, and DeepSeek models
44
+ - 🎵 **Vision and Audio** understanding
25
45
  - 🖼️ **Image generation** with DALL-E and other providers
26
- - 🔍 **Embeddings** for vector search and semantic analysis
46
+ - 📊 **Embeddings** for vector search and semantic analysis
27
47
  - 🔧 **Tools** that let AI use your Ruby code
28
- - 🚊 **Rails integration** to persist chats and messages with ActiveRecord
48
+ - 🚂 **Rails integration** to persist chats and messages with ActiveRecord
29
49
  - 🌊 **Streaming** responses with proper Ruby patterns
30
50
 
31
51
  ## Quick start
@@ -23,7 +23,7 @@
23
23
  "created_at": "2023-08-21T18:16:55+02:00",
24
24
  "display_name": "Babbage 002",
25
25
  "provider": "openai",
26
- "context_window": 16384,
26
+ "context_window": 16385,
27
27
  "max_tokens": 16384,
28
28
  "type": "chat",
29
29
  "family": "babbage",
@@ -262,7 +262,7 @@
262
262
  "created_at": "2023-08-21T18:11:41+02:00",
263
263
  "display_name": "Davinci 002",
264
264
  "provider": "openai",
265
- "context_window": 16384,
265
+ "context_window": 16385,
266
266
  "max_tokens": 16384,
267
267
  "type": "chat",
268
268
  "family": "davinci",
@@ -287,7 +287,7 @@
287
287
  "family": "chat",
288
288
  "supports_vision": false,
289
289
  "supports_functions": true,
290
- "supports_json_mode": true,
290
+ "supports_json_mode": false,
291
291
  "input_price_per_million": 0.27,
292
292
  "output_price_per_million": 1.1,
293
293
  "metadata": {
@@ -371,63 +371,6 @@
371
371
  "owned_by": "google"
372
372
  }
373
373
  },
374
- {
375
- "id": "gemini-1.0-pro",
376
- "created_at": null,
377
- "display_name": "Gemini 1.0 Pro",
378
- "provider": "gemini",
379
- "context_window": 32768,
380
- "max_tokens": 4096,
381
- "type": "chat",
382
- "family": "gemini10_pro",
383
- "supports_vision": false,
384
- "supports_functions": false,
385
- "supports_json_mode": false,
386
- "input_price_per_million": 0.5,
387
- "output_price_per_million": 1.5,
388
- "metadata": {
389
- "object": "model",
390
- "owned_by": "google"
391
- }
392
- },
393
- {
394
- "id": "gemini-1.0-pro-001",
395
- "created_at": null,
396
- "display_name": "Gemini 1.0 Pro 001",
397
- "provider": "gemini",
398
- "context_window": 32768,
399
- "max_tokens": 4096,
400
- "type": "chat",
401
- "family": "gemini10_pro",
402
- "supports_vision": false,
403
- "supports_functions": false,
404
- "supports_json_mode": false,
405
- "input_price_per_million": 0.5,
406
- "output_price_per_million": 1.5,
407
- "metadata": {
408
- "object": "model",
409
- "owned_by": "google"
410
- }
411
- },
412
- {
413
- "id": "gemini-1.0-pro-latest",
414
- "created_at": null,
415
- "display_name": "Gemini 1.0 Pro Latest",
416
- "provider": "gemini",
417
- "context_window": 32768,
418
- "max_tokens": 4096,
419
- "type": "chat",
420
- "family": "gemini10_pro",
421
- "supports_vision": false,
422
- "supports_functions": false,
423
- "supports_json_mode": false,
424
- "input_price_per_million": 0.5,
425
- "output_price_per_million": 1.5,
426
- "metadata": {
427
- "object": "model",
428
- "owned_by": "google"
429
- }
430
- },
431
374
  {
432
375
  "id": "gemini-1.0-pro-vision-latest",
433
376
  "created_at": null,
@@ -884,44 +827,6 @@
884
827
  "owned_by": "google"
885
828
  }
886
829
  },
887
- {
888
- "id": "gemini-2.0-flash-lite-preview",
889
- "created_at": null,
890
- "display_name": "Gemini 2.0 Flash Lite Preview",
891
- "provider": "gemini",
892
- "context_window": 1048576,
893
- "max_tokens": 8192,
894
- "type": "chat",
895
- "family": "gemini20_flash_lite",
896
- "supports_vision": true,
897
- "supports_functions": false,
898
- "supports_json_mode": false,
899
- "input_price_per_million": 0.075,
900
- "output_price_per_million": 0.3,
901
- "metadata": {
902
- "object": "model",
903
- "owned_by": "google"
904
- }
905
- },
906
- {
907
- "id": "gemini-2.0-flash-lite-preview-02-05",
908
- "created_at": null,
909
- "display_name": "Gemini 2.0 Flash Lite Preview 02 05",
910
- "provider": "gemini",
911
- "context_window": 1048576,
912
- "max_tokens": 8192,
913
- "type": "chat",
914
- "family": "gemini20_flash_lite",
915
- "supports_vision": true,
916
- "supports_functions": false,
917
- "supports_json_mode": false,
918
- "input_price_per_million": 0.075,
919
- "output_price_per_million": 0.3,
920
- "metadata": {
921
- "object": "model",
922
- "owned_by": "google"
923
- }
924
- },
925
830
  {
926
831
  "id": "gemini-2.0-flash-mmgen-rev17",
927
832
  "created_at": null,
@@ -1093,25 +998,6 @@
1093
998
  "owned_by": "google"
1094
999
  }
1095
1000
  },
1096
- {
1097
- "id": "gemini-pro",
1098
- "created_at": null,
1099
- "display_name": "Gemini Pro",
1100
- "provider": "gemini",
1101
- "context_window": 32768,
1102
- "max_tokens": 4096,
1103
- "type": "chat",
1104
- "family": "other",
1105
- "supports_vision": false,
1106
- "supports_functions": false,
1107
- "supports_json_mode": false,
1108
- "input_price_per_million": 0.075,
1109
- "output_price_per_million": 0.3,
1110
- "metadata": {
1111
- "object": "model",
1112
- "owned_by": "google"
1113
- }
1114
- },
1115
1001
  {
1116
1002
  "id": "gemini-pro-vision",
1117
1003
  "created_at": null,
@@ -1212,7 +1098,7 @@
1212
1098
  "created_at": "2024-01-23T23:19:18+01:00",
1213
1099
  "display_name": "GPT-3.5-Turbo 0125",
1214
1100
  "provider": "openai",
1215
- "context_window": 16385,
1101
+ "context_window": 4096,
1216
1102
  "max_tokens": 4096,
1217
1103
  "type": "chat",
1218
1104
  "family": "gpt35",
@@ -1231,7 +1117,7 @@
1231
1117
  "created_at": "2023-11-02T22:15:48+01:00",
1232
1118
  "display_name": "GPT-3.5-Turbo 1106",
1233
1119
  "provider": "openai",
1234
- "context_window": 16385,
1120
+ "context_window": 4096,
1235
1121
  "max_tokens": 4096,
1236
1122
  "type": "chat",
1237
1123
  "family": "gpt35",
@@ -1460,7 +1346,7 @@
1460
1346
  "display_name": "GPT-4o 20240513",
1461
1347
  "provider": "openai",
1462
1348
  "context_window": 128000,
1463
- "max_tokens": 4096,
1349
+ "max_tokens": 16384,
1464
1350
  "type": "chat",
1465
1351
  "family": "gpt4o",
1466
1352
  "supports_vision": true,
@@ -1650,7 +1536,7 @@
1650
1536
  "display_name": "GPT-4o-Mini Realtime Preview",
1651
1537
  "provider": "openai",
1652
1538
  "context_window": 128000,
1653
- "max_tokens": 4096,
1539
+ "max_tokens": 16384,
1654
1540
  "type": "chat",
1655
1541
  "family": "gpt4o_mini_realtime",
1656
1542
  "supports_vision": true,
@@ -1669,7 +1555,7 @@
1669
1555
  "display_name": "GPT-4o-Mini Realtime Preview 20241217",
1670
1556
  "provider": "openai",
1671
1557
  "context_window": 128000,
1672
- "max_tokens": 4096,
1558
+ "max_tokens": 16384,
1673
1559
  "type": "chat",
1674
1560
  "family": "gpt4o_mini_realtime",
1675
1561
  "supports_vision": true,
@@ -1688,7 +1574,7 @@
1688
1574
  "display_name": "GPT-4o-Realtime Preview",
1689
1575
  "provider": "openai",
1690
1576
  "context_window": 128000,
1691
- "max_tokens": 4096,
1577
+ "max_tokens": 16384,
1692
1578
  "type": "chat",
1693
1579
  "family": "gpt4o_realtime",
1694
1580
  "supports_vision": true,
@@ -1707,7 +1593,7 @@
1707
1593
  "display_name": "GPT-4o-Realtime Preview 20241001",
1708
1594
  "provider": "openai",
1709
1595
  "context_window": 128000,
1710
- "max_tokens": 4096,
1596
+ "max_tokens": 16384,
1711
1597
  "type": "chat",
1712
1598
  "family": "gpt4o_realtime",
1713
1599
  "supports_vision": true,
@@ -1726,7 +1612,7 @@
1726
1612
  "display_name": "GPT-4o-Realtime Preview 20241217",
1727
1613
  "provider": "openai",
1728
1614
  "context_window": 128000,
1729
- "max_tokens": 4096,
1615
+ "max_tokens": 16384,
1730
1616
  "type": "chat",
1731
1617
  "family": "gpt4o_realtime",
1732
1618
  "supports_vision": true,
@@ -65,8 +65,8 @@ module RubyLLM
65
65
  # Determines if the model supports JSON mode
66
66
  # @param model_id [String] the model identifier
67
67
  # @return [Boolean] true if the model supports JSON mode
68
- def supports_json_mode?(model_id)
69
- model_id.match?(/deepseek-chat/) # Only deepseek-chat supports JSON mode
68
+ def supports_json_mode?(_model_id)
69
+ false # DeepSeek function calling is unstable
70
70
  end
71
71
 
72
72
  # Returns a formatted display name for the model
@@ -15,8 +15,7 @@ module RubyLLM
15
15
  when /o1-2024/, /o3-mini/, /o3-mini-2025/ then 200_000
16
16
  when /gpt-4o/, /gpt-4o-mini/, /gpt-4-turbo/, /o1-mini/ then 128_000
17
17
  when /gpt-4-0[0-9]{3}/ then 8_192
18
- when /gpt-3.5/ then 16_385
19
- when /babbage-002/, /davinci-002/ then 16_384
18
+ when /gpt-3.5-turbo$/, /babbage-002/, /davinci-002/, /16k/ then 16_385
20
19
  else 4_096
21
20
  end
22
21
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyLLM
4
- VERSION = '0.1.0.pre37'
4
+ VERSION = '0.1.0.pre38'
5
5
  end
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: 0.1.0.pre37
4
+ version: 0.1.0.pre38
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carmine Paolino