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
Pass documents, a question string, and an example question/response to get an answer to a question:
98
+
99
+
```
100
+
response = client.answers(parameters: {
101
+
documents: ["Puppy A is happy.", "Puppy B is sad."],
102
+
question: "which puppy is happy?",
103
+
model: "curie",
104
+
examples_context: "In 2017, U.S. life expectancy was 78.6 years.",
105
+
examples: [["What is human life expectancy in the United States?","78 years."]],
106
+
})
107
+
```
108
+
109
+
You can alternatively search using the ID of a file you've uploaded:
110
+
111
+
```
112
+
response = client.answers(parameters: {
113
+
file: "123abc",
114
+
question: "which puppy is happy?",
115
+
model: "curie",
116
+
examples_context: "In 2017, U.S. life expectancy was 78.6 years.",
117
+
examples: [["What is human life expectancy in the United States?","78 years."]],
118
+
})
119
+
```
120
+
95
121
## Development
96
122
97
123
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