lammy 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lammy/openai.rb +2 -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: 8b017f8a1db36acfcb44ade375afb444be57a91950d2b8fdb9b4540c7a19d2a0
|
4
|
+
data.tar.gz: 98702338c1b30893351da07ffb3cd25c3b91ab0411536a67a782ffcd52dea16b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21363a7704447fbfec6b7d6a38ab199d907b35a7512f0ede712ee26ac3f641ee159ad4f3379a91d303d7dcea029c8923bfde7ce66d50fbad738800053165c8dc
|
7
|
+
data.tar.gz: a26916678096f4660d0abbb540655bd9b6d570c57bddfb01799b3595a5d1cf74ec8da51f8d15f837c33708fd3af48fd2212ce7218ffef05a1bceb46d2a833674
|
data/lib/lammy/openai.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'openai'
|
4
|
+
require 'hashie'
|
4
5
|
|
5
6
|
module L
|
6
7
|
# Use the OpenAI API's official Ruby library
|
@@ -26,7 +27,7 @@ module L
|
|
26
27
|
)
|
27
28
|
|
28
29
|
content = response.dig('choices', 0, 'message', 'content')
|
29
|
-
settings[:schema] ? Hashie::Mash.new(JSON.parse(content)) : content
|
30
|
+
settings[:schema] ? ::Hashie::Mash.new(JSON.parse(content)) : content
|
30
31
|
end
|
31
32
|
|
32
33
|
# OpenAI’s text embeddings measure the relatedness of text strings. An embedding is a vector of floating point
|