Skip to content

Commit 2b0105c

Browse files
authored
Merge pull request alexrudall#274 from rjaus/main
Update README.md
2 parents a754f61 + d3a3930 commit 2b0105c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,15 @@ puts response.dig("choices", 0, "text")
185185
You can use the embeddings endpoint to get a vector of numbers representing an input. You can then compare these vectors for different inputs to efficiently check how similar the inputs are.
186186

187187
```ruby
188-
client.embeddings(
188+
response = client.embeddings(
189189
parameters: {
190190
model: "babbage-similarity",
191191
input: "The food was delicious and the waiter..."
192192
}
193193
)
194+
195+
puts response.dig("data", 0, "embedding")
196+
# => Vector representation of your embedding
194197
```
195198

196199
### Files

0 commit comments

Comments
 (0)