Functions
FUNC create_dict
input_array: Iterable of dicts to index.**key_attrib_names: Keyword arguments whose values are attribute names within each dict. The resulting key is a hyphen-joined concatenation of those attribute values.
- Dict mapping the concatenated attribute value(s) to the original dict entry.
FUNC parse_hallucinations_text
hallucinations_text: Raw text from the model’s ”# Hallucinations:” section.
- List of dicts, each with
hallucination_id,risk, andresponse_textkeys.
FUNC add_hallucination_response_spans
hallucination_info: Parsed hallucination list as returned byparse_hallucinations_text.response_text_without_citations: Full response text with citation tags removed.remove_citations_from_response_text: Callable that strips citation tags from a substring of the response.
- Deep copy of
hallucination_infowithresponse_text,response_begin, - and
response_endpopulated for each entry.
FUNC add_citation_context_spans
citation_info: List of citation dicts as produced by the model output parser.docs: List of source document dicts, each withcitation_id,doc_id, andtextkeys.
- Deep copy of
citation_infowithcontext_beginandcontext_end - populated for each entry.