llm.rb 1.0.0 → 1.0.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: 143a4329539a3ac3f9ece7925f5aef3061ee4aee4562e251c1ee1b4f21ec834a
4
- data.tar.gz: 538019c363e178fff1ac8afec1c76cabcd23cbc05b212641251feb072d200958
3
+ metadata.gz: 207a44401195a654a57ebf8050d211fc2c1722420a647dedcc447031aead1451
4
+ data.tar.gz: aa8abf7d5104d0a93033a43041057d1af96f8f45dde7f924243788cd0b14621e
5
5
  SHA512:
6
- metadata.gz: 70da6593671516e75b0a7f0813ee2d50ab9dceddfecda072465e435bad8964aa9eb6fb539dff6ff3846872f3ff18f3648b726016e164ab3a5b852d6b2edc8068
7
- data.tar.gz: 4c473fe9e13b0b9ce2219c3c2023237860e0d77df44d408a6d8bed4f747e7169e6541303cb7823aa727aaec4f578c5579b40120921231aaf6ea2b9b568435159
6
+ metadata.gz: 8faf81ef91911ecbcd81694232f6e314caed8dab2ca8b30a241d8e346c3a4a084f0d46bb9e5e94f191a3dc7676c1c865f7062d440498d94e2e0b30a57a5a3510
7
+ data.tar.gz: 3ba71c5c46b5ebbec12d136f24cff08d0da11ea807b81db1319c31b1dae18cb6786ad8ed759f3333d7e2f0f1ee3c69ee7ae85cf95e6d82b3e5552f0d516a279e
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
- > **Maintenance Notice** <br>
1
+ > **⚠️ Maintenance Mode ⚠️** <br>
2
2
  > Please note that the primary author of llm.rb is pivoting away from
3
3
  > Ruby and towards [Golang](https://golang.org) for future projects.
4
4
  > Although llm.rb will be maintained for the foreseeable future it is not
5
- > where my primary interests lie anymore. Thanks for understanding.
5
+ > where my primary interests are anymore. Thanks for understanding.
6
6
 
7
7
  ## About
8
8
 
@@ -18,9 +18,10 @@ module LLM::OpenAI::Response
18
18
  alias_method :messages, :choices
19
19
 
20
20
  def model = body.model
21
- def prompt_tokens = body.usage["prompt_tokens"]
22
- def completion_tokens = body.usage["completion_tokens"]
23
- def total_tokens = body.usage["total_tokens"]
21
+ def prompt_tokens = usage["prompt_tokens"]
22
+ def completion_tokens = usage["completion_tokens"]
23
+ def total_tokens = usage["total_tokens"]
24
+ def usage = body.usage || {}
24
25
 
25
26
  private
26
27
 
@@ -7,5 +7,17 @@ module LLM::OpenAI::Response
7
7
  return enum_for(:each) unless block_given?
8
8
  data.each { yield(_1) }
9
9
  end
10
+
11
+ ##
12
+ # @return [Boolean]
13
+ def empty?
14
+ data.empty?
15
+ end
16
+
17
+ ##
18
+ # @return [Integer]
19
+ def size
20
+ data.size
21
+ end
10
22
  end
11
23
  end
data/lib/llm/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LLM
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.1"
5
5
  end
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: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antar Azri