Skip to content

Commit 8a18d9f

Browse files
committed
Improved examples [skip ci]
1 parent 1d31316 commit 8a18d9f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

examples/openai_embeddings.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def fetch_embeddings(input)
2222
model: "text-embedding-3-small"
2323
}
2424

25-
response = Net::HTTP.post(URI(url), data.to_json, headers)
25+
response = Net::HTTP.post(URI(url), data.to_json, headers).tap(&:value)
2626
JSON.parse(response.body)["data"].map { |v| v["embedding"] }
2727
end
2828

examples/openai_embeddings_sequel.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def fetch_embeddings(input)
3131
model: "text-embedding-3-small"
3232
}
3333

34-
response = Net::HTTP.post(URI(url), data.to_json, headers)
34+
response = Net::HTTP.post(URI(url), data.to_json, headers).tap(&:value)
3535
JSON.parse(response.body)["data"].map { |v| v["embedding"] }
3636
end
3737

0 commit comments

Comments
 (0)