You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This fine-tuned model name can then be used in classifications:
191
+
This fine-tuned model name can then be used in completions:
192
192
193
193
```ruby
194
194
response = client.completions(
@@ -247,58 +247,6 @@ Pass a string to check if it violates OpenAI's Content Policy:
247
247
=> 5.505014632944949e-05
248
248
```
249
249
250
-
### Classifications
251
-
252
-
Pass examples and a query to predict the most likely labels:
253
-
254
-
```ruby
255
-
response = client.classifications(parameters: {
256
-
examples: [
257
-
["A happy moment", "Positive"],
258
-
["I am sad.", "Negative"],
259
-
["I am feeling awesome", "Positive"]
260
-
],
261
-
query:"It is a raining day :(",
262
-
model:"text-ada-001"
263
-
})
264
-
```
265
-
266
-
Or use the ID of a file you've uploaded:
267
-
268
-
```ruby
269
-
response = client.classifications(parameters: {
270
-
file:"123abc,
271
-
query: "It is a raining day :(",
272
-
model: "text-ada-001"
273
-
})
274
-
```
275
-
276
-
### Answers
277
-
278
-
Pass documents, a question string, and an example question/response to get an answer to a question:
279
-
280
-
```ruby
281
-
response = client.answers(parameters: {
282
-
documents: ["PuppyA is happy.", "PuppyB is sad."],
283
-
question: "which puppy is happy?",
284
-
model: "text-curie-001",
285
-
examples_context: "In2017, U.S. life expectancy was 78.6 years.",
286
-
examples: [["What is human life expectancy in the UnitedStates?","78 years."]],
287
-
})
288
-
```
289
-
290
-
Or use the ID of a file you've uploaded:
291
-
292
-
```ruby
293
-
response = client.answers(parameters: {
294
-
file: "123abc",
295
-
question: "which puppy is happy?",
296
-
model: "text-curie-001",
297
-
examples_context: "In2017, U.S. life expectancy was 78.6 years.",
298
-
examples: [["What is human life expectancy in the UnitedStates?","78 years."]],
299
-
})
300
-
```
301
-
302
250
## Development
303
251
304
252
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
0 commit comments