OpenAI.answers

You're seeing just the function answers, go back to OpenAI module for more information.

The endpoint first searches over provided documents or files to find relevant context. The relevant context is combined with the provided examples and question to create the prompt for completion.

Example request

OpenAI.answers(
  model: "curie",
  documents: ["Puppy A is happy.", "Puppy B is sad."],
  question: "which puppy is happy?",
  search_model: "ada",
  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
)

Example response

{:ok,
  %{
  answers: ["puppy A."],
  completion: "cmpl-2kdRgXcoUfaAXxlPjmZXBT8AlKWfB",
  model: "curie:2020-05-03",
  object: "answer",
  search_model: "ada",
  selected_documents: [
    %{"document" => 0, "text" => "Puppy A is happy. "},
    %{"document" => 1, "text" => "Puppy B is sad. "}
  ]
  }
}

See: https://beta.openai.com/docs/api-reference/answers