Skip to content

trulens.dashboard.run

trulens.dashboard.run

Classes

Functions

find_unused_port

find_unused_port() -> int

Find an unused port.

run_dashboard

run_dashboard(
    session: Optional[TruSession] = None,
    port: Optional[int] = None,
    address: Optional[str] = None,
    force: bool = False,
    _dev: Optional[Path] = None,
) -> Process

Run a streamlit dashboard to view logged results and apps.

PARAMETER DESCRIPTION
port

Port number to pass to streamlit through server.port.

TYPE: Optional[int] DEFAULT: None

address

Address to pass to streamlit through server.address. address cannot be set if running from a colab notebook.

TYPE: Optional[str] DEFAULT: None

force

Stop existing dashboard(s) first. Defaults to False. If given, runs the dashboard with the given PYTHONPATH. This can be used to run the dashboard from outside of its pip package installation folder.

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
Process

The Process executing the streamlit

Process

dashboard.

RAISES DESCRIPTION
RuntimeError

Dashboard is already running. Can be avoided if force is set.

stop_dashboard

stop_dashboard(
    session: Optional[TruSession] = None,
    force: bool = False,
) -> None

Stop existing dashboard(s) if running.

PARAMETER DESCRIPTION
force

Also try to find any other dashboard processes not started in this notebook and shut them down too.

This option is not supported under windows.

TYPE: bool DEFAULT: False

RAISES DESCRIPTION
RuntimeError

Dashboard is not running in the current process. Can be avoided with force.