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 +4 -4
- data/README.md +2 -2
- data/lib/llm/providers/openai/response/completion.rb +4 -3
- data/lib/llm/providers/openai/response/enumerable.rb +12 -0
- data/lib/llm/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 207a44401195a654a57ebf8050d211fc2c1722420a647dedcc447031aead1451
|
4
|
+
data.tar.gz: aa8abf7d5104d0a93033a43041057d1af96f8f45dde7f924243788cd0b14621e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8faf81ef91911ecbcd81694232f6e314caed8dab2ca8b30a241d8e346c3a4a084f0d46bb9e5e94f191a3dc7676c1c865f7062d440498d94e2e0b30a57a5a3510
|
7
|
+
data.tar.gz: 3ba71c5c46b5ebbec12d136f24cff08d0da11ea807b81db1319c31b1dae18cb6786ad8ed759f3333d7e2f0f1ee3c69ee7ae85cf95e6d82b3e5552f0d516a279e
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
>
|
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
|
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 =
|
22
|
-
def completion_tokens =
|
23
|
-
def 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