mirror of
https://github.com/infinition/Bjorn.git
synced 2026-03-11 15:11:59 +00:00
Add RLUtils class for managing RL/AI dashboard endpoints
- Implemented methods for fetching AI stats, training history, and recent experiences. - Added functionality to set operation mode (MANUAL, AUTO, AI) with appropriate handling. - Included helper methods for querying the database and sending JSON responses. - Integrated model metadata extraction for visualization purposes.
This commit is contained in:
@@ -22,6 +22,7 @@ class StudioOps:
|
||||
self.base.execute("""
|
||||
CREATE TABLE IF NOT EXISTS actions_studio (
|
||||
b_class TEXT PRIMARY KEY,
|
||||
b_priority INTEGER DEFAULT 50,
|
||||
studio_x REAL,
|
||||
studio_y REAL,
|
||||
studio_locked INTEGER DEFAULT 0,
|
||||
@@ -31,6 +32,9 @@ class StudioOps:
|
||||
);
|
||||
""")
|
||||
|
||||
# Migration: ensure b_priority exists on pre-existing databases
|
||||
self.base._ensure_column("actions_studio", "b_priority", "b_priority INTEGER DEFAULT 50")
|
||||
|
||||
# Studio edges (relationships between actions)
|
||||
self.base.execute("""
|
||||
CREATE TABLE IF NOT EXISTS studio_edges (
|
||||
@@ -255,6 +259,7 @@ class StudioOps:
|
||||
self.base.execute("""
|
||||
CREATE TABLE IF NOT EXISTS actions_studio (
|
||||
b_class TEXT PRIMARY KEY,
|
||||
b_priority INTEGER DEFAULT 50,
|
||||
studio_x REAL,
|
||||
studio_y REAL,
|
||||
studio_locked INTEGER DEFAULT 0,
|
||||
@@ -282,10 +287,12 @@ class StudioOps:
|
||||
- Insert missing b_class entries
|
||||
- Update NULL fields only (non-destructive)
|
||||
"""
|
||||
# 1) Minimal table: PK + studio_* columns
|
||||
# 1) Minimal table: PK + studio_* columns (b_priority must be here so
|
||||
# get_studio_actions() can ORDER BY it before _sync adds action columns)
|
||||
self.base.execute("""
|
||||
CREATE TABLE IF NOT EXISTS actions_studio (
|
||||
b_class TEXT PRIMARY KEY,
|
||||
b_priority INTEGER DEFAULT 50,
|
||||
studio_x REAL,
|
||||
studio_y REAL,
|
||||
studio_locked INTEGER DEFAULT 0,
|
||||
|
||||
Reference in New Issue
Block a user