feat: complete TASK-WP3-02 runtime recommendation
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// Generated from openapi/openapi.json. Do not edit by hand.
|
||||
|
||||
import type { CreditAdjustmentResponse, CreditAdjustmentRequest, AccountDeletionResponse, AccountDeletionCompleteRequest, AdminLoginCompleteResponse, AdminLoginCompleteRequest, LoginCompleteResponse, LoginCompleteRequest, RegistrationCompleteResponse, RegistrationCompleteRequest, GenerationCreateResponse, AccountSettingsResponse, AdminSessionResponse, CreditBalanceResponse, GenerationTaskResponse, CreditLedgerResponse, ProjectDetailResponse, UserSessionResponse, ProjectListResponse, LogoutResponse, ProjectPurgeResponse, ProjectRenameResponse, ProjectRenameRequest, ProjectRestoreResponse, LatestExportSaveResponse, ProjectStateSaveResponse, ProjectEditableState, AccountDeletionSendResponse, RegistrationSendResponse, AdminLoginSendRequest, LoginSendRequest, RegistrationSendRequest, FailedEmptyTrashResponse, FailedEmptyTrashRequest, ProjectTrashResponse, AccountProfileUpdateResponse, AccountProfileUpdateRequest } from "./types.gen.js";
|
||||
import type { CreditAdjustmentResponse, CreditAdjustmentRequest, BrowserSupportSuccess, BrowserSupportRequest, AccountDeletionResponse, AccountDeletionCompleteRequest, AdminLoginCompleteResponse, AdminLoginCompleteRequest, LoginCompleteResponse, LoginCompleteRequest, RegistrationCompleteResponse, RegistrationCompleteRequest, GenerationCreateResponse, AccountSettingsResponse, AdminSessionResponse, CreditBalanceResponse, BootstrapResponse, GenerationTaskResponse, SseEvent, ModelConfig, ModelConfigurationResponse, CreditLedgerResponse, ProjectDetailResponse, UserSessionResponse, ProjectListResponse, LogoutResponse, ProjectPurgeResponse, ProjectRenameResponse, ProjectRenameRequest, ModelConfigUpdateRequest, ProjectRestoreResponse, LatestExportSaveResponse, ProjectStateSaveResponse, ProjectEditableState, AccountDeletionSendResponse, RegistrationSendResponse, AdminLoginSendRequest, LoginSendRequest, RegistrationSendRequest, FailedEmptyTrashResponse, FailedEmptyTrashRequest, ProjectTrashResponse, AccountProfileUpdateResponse, AccountProfileUpdateRequest } from "./types.gen.js";
|
||||
|
||||
export interface ClientOptions { baseUrl?: string; fetch?: typeof globalThis.fetch; headers?: HeadersInit; }
|
||||
|
||||
@@ -13,45 +13,13 @@ export async function adjustAdminUserCredits(body: CreditAdjustmentRequest, opti
|
||||
return response.json() as Promise<CreditAdjustmentResponse>;
|
||||
}
|
||||
|
||||
export async function checkBrowserSupport(body: {
|
||||
"brands": Array<{
|
||||
"brand": string;
|
||||
"version": string;
|
||||
}>;
|
||||
"full_version_list": Array<{
|
||||
"brand": string;
|
||||
"version": string;
|
||||
}>;
|
||||
"platform": string;
|
||||
}, options: ClientOptions = {}): Promise<{
|
||||
"app_version": string;
|
||||
"browser": {
|
||||
"brand": "Google Chrome" | "Microsoft Edge";
|
||||
"major": number;
|
||||
};
|
||||
"status": "supported";
|
||||
"supported_browsers": Array<{
|
||||
"brand": "Google Chrome" | "Microsoft Edge";
|
||||
"major": number;
|
||||
}>;
|
||||
}> {
|
||||
export async function checkBrowserSupport(body: BrowserSupportRequest, options: ClientOptions = {}): Promise<BrowserSupportSuccess> {
|
||||
const request = options.fetch ?? globalThis.fetch;
|
||||
const headers = new Headers(options.headers);
|
||||
headers.set("Content-Type", "application/json");
|
||||
const response = await request(`${options.baseUrl ?? ""}/api/v1/support/check`, { body: JSON.stringify(body), method: "POST", headers });
|
||||
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
||||
return response.json() as Promise<{
|
||||
"app_version": string;
|
||||
"browser": {
|
||||
"brand": "Google Chrome" | "Microsoft Edge";
|
||||
"major": number;
|
||||
};
|
||||
"status": "supported";
|
||||
"supported_browsers": Array<{
|
||||
"brand": "Google Chrome" | "Microsoft Edge";
|
||||
"major": number;
|
||||
}>;
|
||||
}>;
|
||||
return response.json() as Promise<BrowserSupportSuccess>;
|
||||
}
|
||||
|
||||
export async function completeAccountDeletion(body: AccountDeletionCompleteRequest, options: ClientOptions = {}): Promise<AccountDeletionResponse> {
|
||||
@@ -133,43 +101,11 @@ export async function getAdminUserCredits(options: ClientOptions = {}): Promise<
|
||||
return response.json() as Promise<CreditBalanceResponse>;
|
||||
}
|
||||
|
||||
export async function getBootstrap(options: ClientOptions = {}): Promise<{
|
||||
"app_version": string;
|
||||
"dependencies": Array<{
|
||||
"service_id": string;
|
||||
"status": "available" | "paused" | "degraded" | "unavailable";
|
||||
}>;
|
||||
"model_summary": {
|
||||
"config_set_version": number | null;
|
||||
"configured_default_model_id": string | null;
|
||||
"recommended_model_id": string | null;
|
||||
"runtime_availability_version": number | null;
|
||||
};
|
||||
"public_features": Array<{
|
||||
"feature_id": string;
|
||||
"status": "enabled" | "disabled" | "paused";
|
||||
}>;
|
||||
}> {
|
||||
export async function getBootstrap(options: ClientOptions = {}): Promise<BootstrapResponse> {
|
||||
const request = options.fetch ?? globalThis.fetch;
|
||||
const response = await request(`${options.baseUrl ?? ""}/api/v1/bootstrap`, { method: "GET", headers: options.headers ?? {} });
|
||||
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
||||
return response.json() as Promise<{
|
||||
"app_version": string;
|
||||
"dependencies": Array<{
|
||||
"service_id": string;
|
||||
"status": "available" | "paused" | "degraded" | "unavailable";
|
||||
}>;
|
||||
"model_summary": {
|
||||
"config_set_version": number | null;
|
||||
"configured_default_model_id": string | null;
|
||||
"recommended_model_id": string | null;
|
||||
"runtime_availability_version": number | null;
|
||||
};
|
||||
"public_features": Array<{
|
||||
"feature_id": string;
|
||||
"status": "enabled" | "disabled" | "paused";
|
||||
}>;
|
||||
}>;
|
||||
return response.json() as Promise<BootstrapResponse>;
|
||||
}
|
||||
|
||||
export async function getCurrentGeneration(options: ClientOptions = {}): Promise<GenerationTaskResponse> {
|
||||
@@ -190,64 +126,18 @@ export async function getGeneration(options: ClientOptions = {}): Promise<Genera
|
||||
return response.json() as Promise<GenerationTaskResponse>;
|
||||
}
|
||||
|
||||
export async function getModel(options: ClientOptions = {}): Promise<{
|
||||
"config_version": number;
|
||||
"contract_evidence_ref": string | null;
|
||||
"contract_validation_status": ModelContractValidationStatus;
|
||||
"credit_cost": number;
|
||||
"display_name": string;
|
||||
"enabled": boolean;
|
||||
"error_mapping_profile": Record<string, never>;
|
||||
"gateway_account_ref": string;
|
||||
"is_default": boolean;
|
||||
"model_id": ModelId;
|
||||
"prompt_max_length": number;
|
||||
"recommendation_priority": number;
|
||||
"reference_limits": ModelReferenceLimits;
|
||||
"route_profile": Record<string, never>;
|
||||
"runtime_availability": ModelRuntimeAvailability;
|
||||
"safety_source": string;
|
||||
"supported_ratios": Array<string>;
|
||||
}> {
|
||||
export async function getModel(options: ClientOptions = {}): Promise<ModelConfig> {
|
||||
const request = options.fetch ?? globalThis.fetch;
|
||||
const response = await request(`${options.baseUrl ?? ""}/api/v1/models/{model_id}`, { method: "GET", headers: options.headers ?? {} });
|
||||
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
||||
return response.json() as Promise<{
|
||||
"config_version": number;
|
||||
"contract_evidence_ref": string | null;
|
||||
"contract_validation_status": ModelContractValidationStatus;
|
||||
"credit_cost": number;
|
||||
"display_name": string;
|
||||
"enabled": boolean;
|
||||
"error_mapping_profile": Record<string, never>;
|
||||
"gateway_account_ref": string;
|
||||
"is_default": boolean;
|
||||
"model_id": ModelId;
|
||||
"prompt_max_length": number;
|
||||
"recommendation_priority": number;
|
||||
"reference_limits": ModelReferenceLimits;
|
||||
"route_profile": Record<string, never>;
|
||||
"runtime_availability": ModelRuntimeAvailability;
|
||||
"safety_source": string;
|
||||
"supported_ratios": Array<string>;
|
||||
}>;
|
||||
return response.json() as Promise<ModelConfig>;
|
||||
}
|
||||
|
||||
export async function getModels(options: ClientOptions = {}): Promise<{
|
||||
"config_set_version": number;
|
||||
"configured_default_model_id": ModelId;
|
||||
"models": Array<ModelConfig>;
|
||||
"recommended_model_id": ModelId | null;
|
||||
}> {
|
||||
export async function getModels(options: ClientOptions = {}): Promise<ModelConfigurationResponse> {
|
||||
const request = options.fetch ?? globalThis.fetch;
|
||||
const response = await request(`${options.baseUrl ?? ""}/api/v1/models`, { method: "GET", headers: options.headers ?? {} });
|
||||
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
||||
return response.json() as Promise<{
|
||||
"config_set_version": number;
|
||||
"configured_default_model_id": ModelId;
|
||||
"models": Array<ModelConfig>;
|
||||
"recommended_model_id": ModelId | null;
|
||||
}>;
|
||||
return response.json() as Promise<ModelConfigurationResponse>;
|
||||
}
|
||||
|
||||
export async function getMyCreditLedger(options: ClientOptions = {}): Promise<CreditLedgerResponse> {
|
||||
@@ -308,26 +198,13 @@ export async function renameProject(body: ProjectRenameRequest, options: ClientO
|
||||
return response.json() as Promise<ProjectRenameResponse>;
|
||||
}
|
||||
|
||||
export async function replaceModelConfiguration(body: {
|
||||
"expected_config_set_version": number;
|
||||
"models": Array<ModelConfigCandidate>;
|
||||
}, options: ClientOptions = {}): Promise<{
|
||||
"config_set_version": number;
|
||||
"configured_default_model_id": ModelId;
|
||||
"models": Array<ModelConfig>;
|
||||
"recommended_model_id": ModelId | null;
|
||||
}> {
|
||||
export async function replaceModelConfiguration(body: ModelConfigUpdateRequest, options: ClientOptions = {}): Promise<ModelConfigurationResponse> {
|
||||
const request = options.fetch ?? globalThis.fetch;
|
||||
const headers = new Headers(options.headers);
|
||||
headers.set("Content-Type", "application/json");
|
||||
const response = await request(`${options.baseUrl ?? ""}/api/v1/admin/models/configuration`, { body: JSON.stringify(body), method: "PUT", headers });
|
||||
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
||||
return response.json() as Promise<{
|
||||
"config_set_version": number;
|
||||
"configured_default_model_id": ModelId;
|
||||
"models": Array<ModelConfig>;
|
||||
"recommended_model_id": ModelId | null;
|
||||
}>;
|
||||
return response.json() as Promise<ModelConfigurationResponse>;
|
||||
}
|
||||
|
||||
export async function restoreProject(options: ClientOptions = {}): Promise<ProjectRestoreResponse> {
|
||||
|
||||
Reference in New Issue
Block a user