Functions
FUNC check_answerability
question: Question that the user has posed in response to the last turn incontext.documents: Document snippets retrieved that may or may not answer the indicated question.context: Chat context containing the conversation thus far.backend: Backend instance that supports adding the LoRA or aLoRA adapters for answerability checks.
- Answerability score as a floating-point value from 0 to 1.
FUNC rewrite_question
question: Question that the user has posed in response to the last turn incontext.context: Chat context containing the conversation thus far.backend: Backend instance that supports adding the LoRA or aLoRA adapters.
- Rewritten version of
question.
FUNC clarify_query
question: Question that the user has posed.documents: Document snippets retrieved for the question.context: Chat context containing the conversation thus far.backend: Backend instance that supports the adapters that implement this intrinsic.
- Clarification question string (e.g., “Do you mean A or B?”), or
- the string “CLEAR” if no clarification is needed.
FUNC find_citations
response: Potential assistant response.documents: Documents that were used to generateresponse. These documents should set thedoc_idfield; otherwise the intrinsic will be unable to specify which document was the source of a given citation.context: Context of the dialog between user and assistant at the point where the user has just asked a question that will be answered with RAG documents.backend: Backend that supports one of the adapters that implements this intrinsic.
- List of records with the following fields:
response_begin, response_end,response_text,citation_doc_id,citation_begin,citation_end,citation_text. Begin and end offsets are character- offsets into their respective UTF-8 strings.
FUNC check_context_relevance
question: Question that the user has posed.document: A retrieved document snippet.context: The chat up to the point where the user asked a question.backend: Backend instance that supports the adapters that implement this intrinsic.
- Context relevance score as a floating-point value from 0 to 1.
FUNC flag_hallucinated_content
response: The assistant’s response to the user’s question in the last turn ofcontext.documents: Document snippets that were used to generateresponse.context: A chat log that ends with a user asking a question.backend: Backend instance that supports the adapters that implement this intrinsic.
- List of records with the following fields:
response_begin, response_end,response_text,faithfulness_likelihood,explanation.
FUNC rewrite_answer_for_relevance
response: The assistant’s response to the user’s question in the last turn ofcontext.documents: Document snippets that were used to generateresponse.context: A chat log that ends with a user asking a question.backend: Backend instance that supports the adapters that implement this intrinsic.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.
- Either the original response, or a rewritten version of the original response.