Spaces:
Sleeping
Sleeping
Commit ·
1fac18a
1
Parent(s): 71a770c
Rebrand to PowerGrid and improve AI model selector UI
Browse files- backend/api/llm_evaluator.py +1 -1
- backend/api/routes.py +1 -1
- frontend/index.html +1 -1
- frontend/src/App.jsx +1 -1
- frontend/src/pages/Evaluate.jsx +17 -14
- server/app.py +1 -1
backend/api/llm_evaluator.py
CHANGED
|
@@ -88,7 +88,7 @@ def _build_prompt(data: dict) -> str:
|
|
| 88 |
task = data.get("task", "unknown")
|
| 89 |
scores = data.get("scores", {})
|
| 90 |
return f"""You are an expert in reinforcement learning for grid-scale energy storage systems.
|
| 91 |
-
Analyse the following
|
| 92 |
evaluation results. The agent uses a Soft Actor-Critic (SAC) stochastic architecture.
|
| 93 |
Return a thorough, actionable JSON assessment.
|
| 94 |
|
|
|
|
| 88 |
task = data.get("task", "unknown")
|
| 89 |
scores = data.get("scores", {})
|
| 90 |
return f"""You are an expert in reinforcement learning for grid-scale energy storage systems.
|
| 91 |
+
Analyse the following PowerGrid (Battery Energy Storage System – Reinforcement Learning) agent
|
| 92 |
evaluation results. The agent uses a Soft Actor-Critic (SAC) stochastic architecture.
|
| 93 |
Return a thorough, actionable JSON assessment.
|
| 94 |
|
backend/api/routes.py
CHANGED
|
@@ -138,7 +138,7 @@ class LLMAnalysisResponse(BaseModel):
|
|
| 138 |
|
| 139 |
@router.get("/health")
|
| 140 |
def health():
|
| 141 |
-
return {"status": "ok", "service": "
|
| 142 |
|
| 143 |
|
| 144 |
@router.get("/models")
|
|
|
|
| 138 |
|
| 139 |
@router.get("/health")
|
| 140 |
def health():
|
| 141 |
+
return {"status": "ok", "service": "PowerGrid Backend"}
|
| 142 |
|
| 143 |
|
| 144 |
@router.get("/models")
|
frontend/index.html
CHANGED
|
@@ -6,7 +6,7 @@
|
|
| 6 |
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
| 7 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
| 8 |
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet" />
|
| 9 |
-
<title>
|
| 10 |
<meta name="description" content="Advanced BESS Reinforcement Learning evaluation, simulation, and Gemini-powered analysis platform." />
|
| 11 |
</head>
|
| 12 |
<body>
|
|
|
|
| 6 |
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
| 7 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
| 8 |
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet" />
|
| 9 |
+
<title>PowerGrid | BESS RL Platform</title>
|
| 10 |
<meta name="description" content="Advanced BESS Reinforcement Learning evaluation, simulation, and Gemini-powered analysis platform." />
|
| 11 |
</head>
|
| 12 |
<body>
|
frontend/src/App.jsx
CHANGED
|
@@ -29,7 +29,7 @@ export default function App() {
|
|
| 29 |
<div className="brand">
|
| 30 |
<div className="brand-icon">⚡</div>
|
| 31 |
<div>
|
| 32 |
-
<div className="brand-title">
|
| 33 |
<div className="brand-sub">RL PLATFORM</div>
|
| 34 |
</div>
|
| 35 |
</div>
|
|
|
|
| 29 |
<div className="brand">
|
| 30 |
<div className="brand-icon">⚡</div>
|
| 31 |
<div>
|
| 32 |
+
<div className="brand-title">PowerGrid</div>
|
| 33 |
<div className="brand-sub">RL PLATFORM</div>
|
| 34 |
</div>
|
| 35 |
</div>
|
frontend/src/pages/Evaluate.jsx
CHANGED
|
@@ -139,20 +139,23 @@ export default function Evaluate() {
|
|
| 139 |
{/* LLM Grading Panel */}
|
| 140 |
<div className="card" style={{borderColor: 'rgba(99,102,241,.3)', borderTopWidth: 2}}>
|
| 141 |
<div className="card-head">
|
| 142 |
-
<div className="row gap-14">
|
| 143 |
<Sparkles size={16} className="text-accent"/>
|
| 144 |
-
<
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
|
|
|
|
|
|
|
|
|
| 156 |
</div>
|
| 157 |
{!llmResult && !llmLoading && (
|
| 158 |
<button className="btn btn-sm btn-ghost" onClick={triggerLLM} style={{color:'var(--accent)'}}>Request Grading</button>
|
|
@@ -160,7 +163,7 @@ export default function Evaluate() {
|
|
| 160 |
</div>
|
| 161 |
<div className="card-body">
|
| 162 |
{llmLoading ? (
|
| 163 |
-
<div className="loading-box" style={{padding: '30px 0'}}><div className="spinner"/> Requesting
|
| 164 |
) : llmResult ? (
|
| 165 |
llmResult.available ? (
|
| 166 |
<div className="llm-panel">
|
|
|
|
| 139 |
{/* LLM Grading Panel */}
|
| 140 |
<div className="card" style={{borderColor: 'rgba(99,102,241,.3)', borderTopWidth: 2}}>
|
| 141 |
<div className="card-head">
|
| 142 |
+
<div className="row gap-14" style={{flex: 1}}>
|
| 143 |
<Sparkles size={16} className="text-accent"/>
|
| 144 |
+
<div className="row gap-14" style={{background: 'rgba(99,102,241,0.1)', padding: '4px 10px', borderRadius: 6, border: '1px solid rgba(99,102,241,0.3)'}}>
|
| 145 |
+
<span style={{fontSize: 12, opacity: 0.8, fontWeight: 'bold', color: 'var(--accent)'}}>AI Model:</span>
|
| 146 |
+
<select
|
| 147 |
+
className="form-control btn-sm"
|
| 148 |
+
style={{width: 'auto', background: 'transparent', border: 'none', color: '#fff', fontWeight: 'bold', padding: 0, cursor: 'pointer', outline: 'none'}}
|
| 149 |
+
value={llmProvider}
|
| 150 |
+
onChange={e => {
|
| 151 |
+
const opt = llmOptions.find(o => o.id === e.target.value);
|
| 152 |
+
setLlmProvider(opt.id);
|
| 153 |
+
setLlmModel(opt.model);
|
| 154 |
+
}}
|
| 155 |
+
>
|
| 156 |
+
{llmOptions.map(o => <option key={o.id} value={o.id} style={{background: '#1a1b26'}}>{o.label}</option>)}
|
| 157 |
+
</select>
|
| 158 |
+
</div>
|
| 159 |
</div>
|
| 160 |
{!llmResult && !llmLoading && (
|
| 161 |
<button className="btn btn-sm btn-ghost" onClick={triggerLLM} style={{color:'var(--accent)'}}>Request Grading</button>
|
|
|
|
| 163 |
</div>
|
| 164 |
<div className="card-body">
|
| 165 |
{llmLoading ? (
|
| 166 |
+
<div className="loading-box" style={{padding: '30px 0'}}><div className="spinner"/> Requesting AI analysis ({llmProvider})...</div>
|
| 167 |
) : llmResult ? (
|
| 168 |
llmResult.available ? (
|
| 169 |
<div className="llm-panel">
|
server/app.py
CHANGED
|
@@ -21,7 +21,7 @@ frontend_dir = os.path.join(_ROOT, "frontend", "dist")
|
|
| 21 |
data_path = os.path.join(_ROOT, "data", "pjm_data.csv")
|
| 22 |
|
| 23 |
app = FastAPI(
|
| 24 |
-
title="
|
| 25 |
version="2.0.0",
|
| 26 |
description="OpenEnv simulation + React frontend API (SAC Agent)"
|
| 27 |
)
|
|
|
|
| 21 |
data_path = os.path.join(_ROOT, "data", "pjm_data.csv")
|
| 22 |
|
| 23 |
app = FastAPI(
|
| 24 |
+
title="PowerGrid RL Platform",
|
| 25 |
version="2.0.0",
|
| 26 |
description="OpenEnv simulation + React frontend API (SAC Agent)"
|
| 27 |
)
|