Create answer about example and example_context

about using uploaded documents for generating answers

I want to get the answer for “My router is flashing red, why ?”

I curl in the uploaded docs for an answer

what exactly is the purpose of example and example_context

Do I need to provide examples and context based on the content of the uploaded document or
are this parameters used for how the answer is build

In the docs the paramters have no logical relation to the asked question, which confuses me

 "question": "which puppy is happy?",
  "search_model": "ada",
  "model": "curie",
  "examples_context": "In 2017, U.S. life expectancy was 78.6 years.",
  "examples": [["What is human life expectancy in the United States?","78 years."]],
  "max_tokens": 5,

I have been working with the answers endpoint lately as well. A good way to understand it is to add the return_prompt flag and see what it is actually doing. You will find it useful.

Essentially answers endpoint is doing a search request then a completion. The example is to give the completion something to follow off of.

1 Like