trinity.buffer.viewer module#

class trinity.buffer.viewer.SQLExperienceViewer(config: StorageConfig)[source]#

Bases: object

__init__(config: StorageConfig) None[source]#
get_experiences(offset: int, limit: int = 10) List[Experience][source]#
total_experiences() int[source]#
static run_viewer(model_path: str, db_url: str, table_name: str, port: int)[source]#

Start the Streamlit viewer.

Parameters:
  • model_path (str) – Path to the tokenizer/model directory.

  • db_url (str) – Database URL for the experience database.

  • table_name (str) – Name of the experience table in the database.

  • port (int) – Port number to run the Streamlit app on.

trinity.buffer.viewer.get_color_for_action_mask(action_mask_value: int) str[source]#

Return color based on action_mask value

trinity.buffer.viewer.render_experience(exp: Experience, tokenizer)[source]#

Render a single experience sequence in Streamlit.

trinity.buffer.viewer.parse_args()[source]#
trinity.buffer.viewer.main()[source]#