Skip to content

Commit a5f7339

Browse files
committed
Update README
1 parent b94fed9 commit a5f7339

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,32 @@ You can alternatively search using the ID of a file you've uploaded:
9292
client.search(engine: "ada", file: "abc123", query: "happy")
9393
```
9494

95+
### Answers
96+
97+
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+
95121
## Development
96122

97123
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

Comments
 (0)