孙家明
deploy: OilVerse for HuggingFace (Node.js 18 fix)
fab9847
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8765';
export async function fetchBenchmarks() {
const res = await fetch(`${API_BASE}/api/benchmarks`);
return res.json();
}
export async function fetchResults(benchmark) {
const res = await fetch(`${API_BASE}/api/results/${benchmark}`);
return res.json();
}
export async function fetchEval(benchmark) {
const res = await fetch(`${API_BASE}/api/eval/${benchmark}`);
return res.json();
}
export async function fetchNlg(benchmark) {
const res = await fetch(`${API_BASE}/api/nlg/${benchmark}`);
return res.json();
}
export async function fetchScenarios() {
const res = await fetch(`${API_BASE}/api/scenarios`);
return res.json();
}
export async function fetchRegime() {
const res = await fetch(`${API_BASE}/api/regime`);
return res.json();
}
export async function fetchHedging() {
const res = await fetch(`${API_BASE}/api/hedging`);
return res.json();
}
export async function fetchBacktest() {
const res = await fetch(`${API_BASE}/api/backtest`);
return res.json();
}
export async function fetchAblation() {
const res = await fetch(`${API_BASE}/api/ablation`);
return res.json();
}
export async function fetchQuality() {
const res = await fetch(`${API_BASE}/api/quality`);
return res.json();
}
export async function fetchLineage() {
const res = await fetch(`${API_BASE}/api/lineage`);
return res.json();
}
export async function fetchFeatSel() {
const res = await fetch(`${API_BASE}/api/feat_sel`);
return res.json();
}
export async function fetchCausal() {
const res = await fetch(`${API_BASE}/api/causal`);
return res.json();
}
export async function fetchEvents() {
const res = await fetch(`${API_BASE}/api/events`);
return res.json();
}
export async function sendChat(message, sessionId) {
const res = await fetch(`${API_BASE}/api/chat`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ message, session_id: sessionId }),
});
return res.json();
}