feat: unify installation model catalog
This commit is contained in:
@@ -17,13 +17,6 @@ export interface PiManagementStatus {
|
||||
message?: string;
|
||||
}
|
||||
|
||||
export interface PiManagementOptions {
|
||||
providers: string[];
|
||||
models: Array<{ provider: string; id: string }>;
|
||||
reasoning: PiReasoning[];
|
||||
checkedAt: string;
|
||||
}
|
||||
|
||||
export interface PiManagementTestResult {
|
||||
ready: boolean;
|
||||
checkedAt: string;
|
||||
@@ -37,9 +30,7 @@ export interface PiManagementLogs {
|
||||
|
||||
export type PiManagementApiErrorCode =
|
||||
| "pi_management_forbidden"
|
||||
| "pi_management_unavailable"
|
||||
| "pi_management_invalid_config"
|
||||
| "pi_management_write_failed";
|
||||
| "pi_management_unavailable";
|
||||
|
||||
export interface PiManagementApiError {
|
||||
status: number;
|
||||
@@ -50,8 +41,6 @@ export interface PiManagementApiError {
|
||||
const errorCodes = new Set<PiManagementApiErrorCode>([
|
||||
"pi_management_forbidden",
|
||||
"pi_management_unavailable",
|
||||
"pi_management_invalid_config",
|
||||
"pi_management_write_failed",
|
||||
]);
|
||||
|
||||
/** Narrows the sanctioned error code and derives its message locally. */
|
||||
@@ -65,11 +54,6 @@ export function asPiManagementApiError(error: unknown): PiManagementApiError | u
|
||||
}
|
||||
|
||||
export const getPiManagementStatus = () => apiFetch<PiManagementStatus>("/pi-management/status");
|
||||
export const getPiManagementOptions = () => apiFetch<PiManagementOptions>("/pi-management/options");
|
||||
export const savePiManagementConfig = (config: PiInstallationConfig) =>
|
||||
apiFetch<PiInstallationConfig & { updatedAt: string }>("/pi-management/config", {
|
||||
method: "PUT", body: JSON.stringify(config),
|
||||
});
|
||||
export const runPiManagementTest = () =>
|
||||
apiFetch<PiManagementTestResult>("/pi-management/test", { method: "POST" });
|
||||
export const getPiManagementLogs = () => apiFetch<PiManagementLogs>("/pi-management/logs");
|
||||
|
||||
Reference in New Issue
Block a user