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,
    _watch_changes: bool = False,
) -> 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.

TYPE: bool DEFAULT: False

_dev

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. Defaults to None.

TYPE: Path DEFAULT: None

_watch_changes

If True, the dashboard will watch for changes in the code and update the dashboard accordingly. Defaults to False.

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
Process

The Process executing the streamlit 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.