trulens.dashboard.utils.records_utils¶
trulens.dashboard.utils.records_utils
¶
Classes¶
Functions¶
df_cell_highlight
¶
df_cell_highlight(
score: float,
feedback_name: str,
feedback_directions: Dict[str, bool],
n_cells: int = 1,
) -> list[str]
Returns the background color for a cell in a DataFrame based on the score and feedback name.
PARAMETER | DESCRIPTION |
---|---|
score
|
The score value to determine the background color.
TYPE:
|
feedback_name
|
The feedback name to determine the background color.
TYPE:
|
feedback_directions
|
A dictionary mapping feedback names to their directions. True if higher is better, False otherwise.
TYPE:
|
n_cells
|
The number of cells to apply the background color. Defaults to 1.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
list[str]
|
A list of CSS styles representing the background color. |
display_feedback_call
¶
display_feedback_call(
record_id: str,
call: List[Dict[str, Any]],
feedback_name: str,
feedback_directions: Dict[str, bool],
)
Display the feedback call details in a DataFrame.
PARAMETER | DESCRIPTION |
---|---|
record_id
|
The record ID.
TYPE:
|
call
|
The feedback call details, including call metadata. |
feedback_name
|
The feedback name.
TYPE:
|
feedback_directions
|
A dictionary mapping feedback names to their directions. True if higher is better, False otherwise. |