Docs should point out that only the EXTRACTIVE answer style will produce a "content" field if the answerable probability is low #83
Labels
component:documentation
Improvements or additions to documentation
status:triaged
Issue/PR triaged to the corresponding sub-team
type:bug
Something isn't working
On this page:
https://ai.google.dev/api/rest/v1beta/models/generateAnswer
In the Response Body section, there is this text for the
answer
field:"Candidate answer from the model.
Note: The model always attempts to provide a grounded answer, even when the answer is unlikely to be answerable from the given passages. In that case, a low-quality or ungrounded answer may be provided, along with a low answerableProbability."
While it is true that you will always get a
Candidate
answer object back, in theABSTRACTIVE
andVERBOSE
answer styles, where the model is forced to synthesize text, you you will not get acontent
child object field containing answer text. When theanswerableProbabillity
is too low, you will only get acontent
child object with answer text in theEXTRACTIVE
answer style, since the model just has to produce the grounding answer that is the closest match and does not have to synthesize any text to serve as a reply. So if you use the word "answer" in the context of aCandidate
object, as the docs use it, then the docs are correct. But in the traditional sense of an answer containing text that replies to a question, the doc text is less helpful then it could be.I suggest mentioning this in the docs, because I spent a fair amount of time trying to figure out why I didn't get any usable answer text due to this model behavior, until I wrote a rigorous test harness that tries the exact same user query and inline grounding passages set with each of the 3
AnswerStyle
values. A short doc note about this could save other developers some confusion.The text was updated successfully, but these errors were encountered: