feat: add ModelUsageEntry types and status API client functions
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { fetchAPI, type SystemConfig, type SystemHealth, type SystemStats } from './index';
|
||||
import { fetchAPI, type ModelUsageResponse, type SystemConfig, type SystemHealth, type SystemStats } from './index';
|
||||
|
||||
export async function getSystemStats(): Promise<SystemStats> {
|
||||
return fetchAPI<SystemStats>('/status/stats');
|
||||
@@ -12,4 +12,14 @@ export async function getSystemHealth(): Promise<SystemHealth> {
|
||||
return fetchAPI<SystemHealth>('/status/health');
|
||||
}
|
||||
|
||||
export type { SystemConfig, SystemHealth, SystemStats };
|
||||
/** Passive read: current connection status + cumulative token usage for all 4 AI model roles. */
|
||||
export async function getModelUsage(): Promise<ModelUsageResponse> {
|
||||
return fetchAPI<ModelUsageResponse>('/status/models');
|
||||
}
|
||||
|
||||
/** Active check: sends one minimal request to each enabled model, then returns fresh statuses. */
|
||||
export async function pingModelConnections(): Promise<ModelUsageResponse> {
|
||||
return fetchAPI<ModelUsageResponse>('/status/models/ping', { method: 'POST' });
|
||||
}
|
||||
|
||||
export type { ModelUsageResponse, SystemConfig, SystemHealth, SystemStats };
|
||||
|
||||
Reference in New Issue
Block a user