llm.rb 0.9.0 → 0.9.1

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: eb2885c3c77d0ac7555b59fd57ccbf15ed5c72e2b385f5f4d83f8ea906b34171
4
- data.tar.gz: 0cf0fa38bec61167de57441f11c389f13a1f86ea9dd04caf597698363fa53c71
3
+ metadata.gz: 20812e4c8cfc7ebee81190054e7483b00b24e0f0f567f630bfb4dc0ac962193f
4
+ data.tar.gz: 4ff26fa74520b29da3b6aa10331d5cd618e13d4df53cb9f0c5b7a7691f5fb42e
5
5
  SHA512:
6
- metadata.gz: 280bccde2d4d730485845440986b27ce7b753cdde7f080bc3c7e2f1381a3e924fa1aebe48fe734d9d6d58c5d0d5ff7e182a5d7bba5b3e390c79c4c2738bbd8c2
7
- data.tar.gz: dba89769f1fe6f35ac98e7ad6fce9e90775e8b61e47ee3215e8fb8df555d9787f9d289206bd3cdc60b3b1bdee4a5217e8e69b1d3aa33f29e0e193ba90f0e33f8
6
+ metadata.gz: 4ed6e3f0426fc0967cb59cc14ae0d0afe552a93e2a29b8d173bf000341b77800ea31ef9088d45a696d353ac0e7f58cc1b3d7f86c3c15d757ae73efb33523b56d
7
+ data.tar.gz: 136e14863ef92264e270f3b6616a9660298cdc477a2a15db1b89b9360be1ce2be3dde0ee66d97be68d57c5bf68f4f0fc9764657187fbf2ae226f1a5ed6579189
data/README.md CHANGED
@@ -1,17 +1,16 @@
1
1
  ## About
2
2
 
3
3
  llm.rb is a zero-dependency Ruby toolkit for Large Language Models that
4
- includes OpenAI, Gemini, Anthropic, DeepSeek, Ollama, and LlamaCpp.
5
- It's fast, simple and composable – with full support for chat,
6
- streaming, tool calling, audio, images, files, and JSON Schema
7
- generation.
4
+ includes OpenAI, Gemini, Anthropic, DeepSeek, Ollama, and LlamaCpp. The
5
+ toolkit includes full support for chat, streaming, tool calling, audio,
6
+ images, files, and JSON Schema generation.
8
7
 
9
8
  ## Features
10
9
 
11
10
  #### General
12
11
  - ✅ A single unified interface for multiple providers
13
12
  - 📦 Zero dependencies outside Ruby's standard library
14
- - 🚀 Optimized for performance and low memory usage
13
+ - 🚀 Efficient API design that minimizes the request count
15
14
 
16
15
  #### Chat, Agents
17
16
  - 🧠 Stateless and stateful chat via completions and responses API
@@ -25,7 +25,5 @@ class LLM::Bot
25
25
  role = params.delete(:role)
26
26
  @messages.push [LLM::Message.new(role, prompt), @params.merge(params), :complete]
27
27
  end
28
-
29
- include LLM
30
28
  end
31
29
  end
data/lib/llm/buffer.rb CHANGED
@@ -23,9 +23,13 @@ module LLM
23
23
  # Yields each message in the conversation thread
24
24
  # @raise (see LLM::Provider#complete)
25
25
  # @return [void]
26
- def each
27
- empty! unless @pending.empty?
28
- @completed.each { yield(_1) }
26
+ def each(...)
27
+ if block_given?
28
+ empty! unless @pending.empty?
29
+ @completed.each { yield(_1) }
30
+ else
31
+ enum_for(:each, ...)
32
+ end
29
33
  end
30
34
 
31
35
  ##
data/lib/llm/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LLM
4
- VERSION = "0.9.0"
4
+ VERSION = "0.9.1"
5
5
  end
data/llm.gemspec CHANGED
@@ -8,11 +8,13 @@ Gem::Specification.new do |spec|
8
8
  spec.authors = ["Antar Azri", "0x1eef"]
9
9
  spec.email = ["azantar@proton.me", "0x1eef@proton.me"]
10
10
 
11
- spec.summary = "llm.rb is a zero-dependency Ruby toolkit for " \
12
- "Large Language Models that includes OpenAI, Gemini, " \
13
- "Anthropic, DeepSeek, Ollama, and LlamaCpp. It’s fast, simple " \
14
- "and composable – with full support for chat, streaming, tool calling, audio, " \
15
- "images, files, and JSON Schema generation."
11
+ spec.summary = <<~SUMMARY
12
+ llm.rb is a zero-dependency Ruby toolkit for Large Language Models that
13
+ includes OpenAI, Gemini, Anthropic, DeepSeek, Ollama, and LlamaCpp. The
14
+ toolkit includes full support for chat, streaming, tool calling, audio,
15
+ images, files, and JSON Schema generation.
16
+ SUMMARY
17
+
16
18
  spec.description = spec.summary
17
19
  spec.homepage = "https://github.com/llmrb/llm"
18
20
  spec.license = "0BSDL"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: llm.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antar Azri
@@ -151,9 +151,9 @@ dependencies:
151
151
  - !ruby/object:Gem::Version
152
152
  version: '2.8'
153
153
  description: llm.rb is a zero-dependency Ruby toolkit for Large Language Models that
154
- includes OpenAI, Gemini, Anthropic, DeepSeek, Ollama, and LlamaCpp. It’s fast, simple
155
- and composable – with full support for chat, streaming, tool calling, audio, images,
156
- files, and JSON Schema generation.
154
+ includes OpenAI, Gemini, Anthropic, DeepSeek, Ollama, and LlamaCpp. The toolkit
155
+ includes full support for chat, streaming, tool calling, audio, images, files, and
156
+ JSON Schema generation.
157
157
  email:
158
158
  - azantar@proton.me
159
159
  - 0x1eef@proton.me
@@ -285,7 +285,7 @@ requirements: []
285
285
  rubygems_version: 3.6.8
286
286
  specification_version: 4
287
287
  summary: llm.rb is a zero-dependency Ruby toolkit for Large Language Models that includes
288
- OpenAI, Gemini, Anthropic, DeepSeek, Ollama, and LlamaCpp. It’s fast, simple and
289
- composable – with full support for chat, streaming, tool calling, audio, images,
290
- files, and JSON Schema generation.
288
+ OpenAI, Gemini, Anthropic, DeepSeek, Ollama, and LlamaCpp. The toolkit includes
289
+ full support for chat, streaming, tool calling, audio, images, files, and JSON Schema
290
+ generation.
291
291
  test_files: []