2024-04-08 19:13:45 +08:00
|
|
|
export interface IAddLlmRequestBody {
|
|
|
|
|
llm_factory: string; // Ollama
|
2026-06-08 16:46:52 +08:00
|
|
|
// model_name: string;
|
|
|
|
|
// model_type: string | string[];
|
|
|
|
|
base_url?: string; // chat|embedding|speech2text|image2text
|
2026-01-05 09:53:47 +08:00
|
|
|
api_key?: string | Record<string, any>;
|
2024-11-19 14:51:33 +08:00
|
|
|
max_tokens: number;
|
2026-05-07 15:54:57 +08:00
|
|
|
is_tools?: boolean;
|
2026-06-02 19:04:20 +08:00
|
|
|
region?: string;
|
2026-06-08 16:46:52 +08:00
|
|
|
model_info: IModelInfo[];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IModelInfo {
|
|
|
|
|
model_name: string;
|
|
|
|
|
model_type: string | string[];
|
|
|
|
|
max_tokens: number;
|
|
|
|
|
/**
|
|
|
|
|
* Per-model extras (e.g. `is_tools` derived from the model descriptor's
|
|
|
|
|
* `features`). Optional for backward compatibility with legacy
|
|
|
|
|
* single-model payloads.
|
|
|
|
|
*/
|
|
|
|
|
extra?: Record<string, any>;
|
2024-04-08 19:13:45 +08:00
|
|
|
}
|
2024-05-10 10:38:39 +08:00
|
|
|
|
|
|
|
|
export interface IDeleteLlmRequestBody {
|
|
|
|
|
llm_factory: string; // Ollama
|
2024-09-24 19:10:06 +08:00
|
|
|
llm_name?: string;
|
2024-05-10 10:38:39 +08:00
|
|
|
}
|
2026-05-29 17:39:41 +08:00
|
|
|
|
|
|
|
|
export interface IListProvidersRequestParams {
|
|
|
|
|
available?: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IAddProviderRequestBody {
|
|
|
|
|
provider_name: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type IAddProviderInstanceRequestBody = IAddLlmRequestBody & {
|
|
|
|
|
instance_name: string;
|
2026-06-03 11:59:57 +08:00
|
|
|
region?: string;
|
2026-05-29 17:39:41 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export interface IDeleteProviderInstanceRequestBody {
|
|
|
|
|
provider_name: string;
|
|
|
|
|
instances: string[];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IShowProviderInstanceRequestParams {
|
|
|
|
|
provider_name: string;
|
|
|
|
|
instance_name: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IAddInstanceModelRequestBody {
|
|
|
|
|
model_name: string;
|
|
|
|
|
model_type: string[];
|
|
|
|
|
max_tokens: number;
|
|
|
|
|
extra?: Record<string, any>;
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-15 19:11:05 +08:00
|
|
|
export interface IEditInstanceModelRequestBody {
|
|
|
|
|
model_name: string[];
|
|
|
|
|
model_type: string[];
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-29 17:39:41 +08:00
|
|
|
export interface IListAllModelsRequestParams {
|
|
|
|
|
type?: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IUpdateModelStatusRequestBody {
|
|
|
|
|
provider_name: string;
|
|
|
|
|
instance_name: string;
|
|
|
|
|
model_name: string;
|
|
|
|
|
status: 'active' | 'inactive';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ISetDefaultModelRequestBody {
|
|
|
|
|
model_provider: string;
|
|
|
|
|
model_instance: string;
|
|
|
|
|
model_type: string;
|
|
|
|
|
model_name: string;
|
|
|
|
|
}
|
2026-06-08 16:46:52 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Item shape returned by the list-provider-models endpoint.
|
|
|
|
|
* Fields match the backend's available-model descriptor.
|
|
|
|
|
*/
|
|
|
|
|
export interface IProviderModelItem {
|
|
|
|
|
name: string;
|
|
|
|
|
max_tokens: number;
|
|
|
|
|
model_types: string[];
|
|
|
|
|
features: string[] | null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Request payload for the list-provider-models endpoint.
|
|
|
|
|
* Mirrors the verifyProviderConnection payload so the same form
|
|
|
|
|
* fields (api_key, base_url, region, model_info) can be reused.
|
|
|
|
|
*/
|
|
|
|
|
export interface IListProviderModelsRequestBody {
|
|
|
|
|
provider_name: string;
|
|
|
|
|
api_key: string;
|
|
|
|
|
base_url?: string;
|
|
|
|
|
region?: string;
|
|
|
|
|
model_info?: IModelInfo[];
|
|
|
|
|
}
|