Functions
FUNC check_answerability
context.
:param documents: Document snippets retrieved that may or may not answer the
indicated question.
:param backend: Backend instance that supports adding the LoRA or aLoRA adapters
for answerability checks
:return: Answerability score as a floating-point value from 0 to 1.
FUNC rewrite_question
context.
:param backend: Backend instance that supports adding the LoRA or aLoRA adapters
:return: Rewritten version of question.
FUNC find_citations
response. These documents
should set the doc_id field; otherwise the intrinsic will be unable to
specify which document was the source of a given citation.
:param backend: Backend that supports one of the adapters that implements this
intrinsic.
:return: List of records with the following fields:
response_beginresponse_endresponse_textcitation_doc_idcitation_begincitation_endcitation_textBegin and end offsets are character offsets into their respective UTF-8 strings.
FUNC check_context_relevance
FUNC flag_hallucinated_content
context
:param documents: Document snippets that were used to generate response
:param backend: Backend instance that supports the adapters that implement this
intrinsic
:return: List of records with the following fields:
- response_begin
- response_end
- response_text
- faithfulness_likelihood
- explanation
FUNC rewrite_answer_for_relevance
context
:param documents: Document snippets that were used to generate response
:param backend: Backend instance that supports the adapters that implement this
intrinsic
:param rewrite_threshold: Number between 0.0 and 1.0 that determines how eagerly
to skip rewriting the assistant’s answer for relevance. 0.0 means never rewrite
and 1.0 means always rewrite.
:returns: Either the original response, or a rewritten version of the original
response.