Skip to content

trulens.dashboard.streamlit

trulens.dashboard.streamlit

Functions

init_from_args

init_from_args()

Parse command line arguments and initialize Tru with them.

As Tru is a singleton, further TruSession() uses will get the same configuration.

trulens_leaderboard

trulens_leaderboard(app_ids: Optional[List[str]] = None)

Render the leaderboard page.

Args:

app_ids List[str]: A list of application IDs (default is None)
Example
from trulens.core import streamlit as trulens_st

trulens_st.trulens_leaderboard()

trulens_feedback

trulens_feedback(record: Union[Record, str])

Render clickable feedback pills for a given record.

PARAMETER DESCRIPTION
record

Either a trulens record (non-OTel) or a record_id string (OTel).

TYPE: Union[Record, str]

Example
from trulens.core import streamlit as trulens_st

with tru_llm as recording:
    response = llm.invoke(input_text)

record, response = recording.get()

trulens_st.trulens_feedback(record=record)

trulens_trace

trulens_trace(record: Union[Record, str])

Display the trace view for a record.

PARAMETER DESCRIPTION
record

Either a trulens record (non-OTel) or a record_id string (OTel).

TYPE: Union[Record, str]

Example
from trulens.core import streamlit as trulens_st

# Using with Record object
with tru_llm as recording:
    response = llm.invoke(input_text)
record, response = recording.get()
trulens_st.trulens_trace(record=record)

# Using with record_id string
trulens_st.trulens_trace(record="record_123")