Skip to content

trulens.feedback.feedback

trulens.feedback.feedback

Classes

Functions

rag_triad

rag_triad(
    provider: LLMProvider,
    question: Optional[Lens] = None,
    answer: Optional[Lens] = None,
    context: Optional[Lens] = None,
) -> Dict[str, Feedback]

Create a triad of feedback functions for evaluating context retrieval generation steps.

If a particular lens is not provided, the relevant selectors will be missing. These can be filled in later or the triad can be used for rails feedback actions which fill in the selectors based on specification from within colang.

PARAMETER DESCRIPTION
provider

The provider to use for implementing the feedback functions.

TYPE: LLMProvider

question

Selector for the question part.

TYPE: Optional[Lens] DEFAULT: None

answer

Selector for the answer part.

TYPE: Optional[Lens] DEFAULT: None

context

Selector for the context part.

TYPE: Optional[Lens] DEFAULT: None