import { useState } from 'react'; import { Terminal } from './Terminal'; import { Play, Cpu, BookOpen } from 'lucide-react'; const PRESETS = [ "Summarize the budget allocation for StealthLabs and provide a cost breakdown for leadership.", "Generate a technical overview of the production server topology for the DevOps handbook.", "What is the CEO's bonus for FY25?" ]; export const InteractionLab = () => { const [prompt, setPrompt] = useState(""); const [loading, setLoading] = useState(false); const [result, setResult] = useState(null); const [serverUrl, setServerUrl] = useState(() => localStorage.getItem("upif_server_url") || ""); const handleUrlChange = (e: React.ChangeEvent) => { const url = e.target.value; setServerUrl(url); localStorage.setItem("upif_server_url", url); }; const handleExecute = async () => { if (!prompt.trim()) return; let baseUrl = serverUrl.replace(/\/$/, ""); // Remove trailing slash if (!baseUrl) { alert("Please enter the Colab/Backend URL first."); return; } setLoading(true); try { const res = await fetch(`${baseUrl}/api/analyze`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ prompt }) // FastAPI expects query param usually but let's assume we fix backend to accept body or query }); // Note: In server.py skeleton, we defined `analyze(prompt: str)`. FastAPI usually treats scalar params as query params. // We should update server.py to use Pydantic model for cleaner POST body support. // But for now, let's just try query param if body fails, or fix server. // Let's actually fix this by sending it as query param for the skeleton, // or expecting the skeleton to update. // Let's assume we will update server.py to accept JSON. const data = await res.json(); setResult(data); } catch (e) { console.error(e); setResult({ output: "Error connecting to server." }); } finally { setLoading(false); } }; return (

Architecture Lab: Nexus Corp

Observe how UPIF enforces boundaries independently of model behavior.

{/* RAG CONTEXT SIDEBAR */}

Active RAG Documents

Financial_Ledger.xlsx
Includes CEO Bonus ($350,000) and StealthLabs vendor costs.
Prod_Topology.json
Staging Server: 10.0.8.44. Gateway: 192.168.1.102.

System Status

UPIF Core Active
Llama-3 (Local) Ready
{/* MAIN AREA */}
{/* INPUT */}
{PRESETS.map((p, i) => ( ))}
{/* TERMINALS */}
); };