mirror of
https://github.com/open-jarvis/OpenJarvis.git
synced 2026-07-30 19:02:16 +00:00
- Add React/TypeScript Chat UI frontend with sidebar, conversation management, model selector, streaming indicator, and savings panel - Wire up TelemetryStore in `jarvis serve` so TELEMETRY_RECORD events are persisted to SQLite (matching the pattern from `jarvis ask`) - Switch agents (orchestrator, react, openhands, openclaw_plugin) and the direct route handler to use `instrumented_generate()` so token counts are recorded and the /v1/savings endpoint returns real data - Restyle savings panel model display with bordered card boxes (green accent for local, orange for cloud) instead of plain text rows - Add SGLang engine backend, dashboard routes, savings computation, and agent-stream bridge for SSE streaming Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
18 lines
449 B
TypeScript
18 lines
449 B
TypeScript
import { useState, useEffect } from 'react';
|
|
import type { ModelInfo } from '../types';
|
|
import { fetchModels } from '../api/client';
|
|
|
|
export function useModels() {
|
|
const [models, setModels] = useState<ModelInfo[]>([]);
|
|
const [loading, setLoading] = useState(true);
|
|
|
|
useEffect(() => {
|
|
fetchModels()
|
|
.then(setModels)
|
|
.catch(() => setModels([]))
|
|
.finally(() => setLoading(false));
|
|
}, []);
|
|
|
|
return { models, loading };
|
|
}
|