Skip to content

Framework Utilities

trulens_eval.utils.langchain

Utilities for langchain apps. Includes component categories that organize various langchain classes and example classes:

  • WithFeedbackFilterDocuments: a VectorStoreRetriever that filters retrieved documents via a threshold on a specified feedback function.

Attributes

Classes

WithFeedbackFilterDocuments

Bases: VectorStoreRetriever

Functions
__init__
__init__(feedback: Feedback, threshold: float, *args, **kwargs)

A VectorStoreRetriever that filters documents using a minimum threshold on a feedback function before returning them.

  • feedback: Feedback - use this feedback function to score each document.

  • threshold: float - and keep documents only if their feedback value is at least this threshold.

Functions

trulens_eval.utils.llama

Utilities for llama_index apps. Includes component categories that organize various llama_index classes and example classes:

  • WithFeedbackFilterNodes, a VectorIndexRetriever that filters retrieved nodes via a threshold on a specified feedback function.

Classes

WithFeedbackFilterNodes

Bases: VectorIndexRetriever

Functions
__init__
__init__(feedback: Feedback, threshold: float, *args, **kwargs)

A VectorIndexRetriever that filters documents using a minimum threshold on a feedback function before returning them.

  • feedback: Feedback - use this feedback function to score each document.

  • threshold: float - and keep documents only if their feedback value is at least this threshold.

Functions