@@ -3,6 +3,10 @@ import type {
|
||||
DeviceRecord,
|
||||
HostGovernancePolicy,
|
||||
HostTokenUsageSummary,
|
||||
LlmProviderProfile,
|
||||
LlmProviderProfileListResponse,
|
||||
LlmProviderSettings,
|
||||
LlmProviderType,
|
||||
HostRecord,
|
||||
PluginRecord,
|
||||
PluginRegistrationPayload,
|
||||
@@ -253,3 +257,63 @@ export function registerPlugin(payload: PluginRegistrationPayload): Promise<Plug
|
||||
body: JSON.stringify(payload),
|
||||
});
|
||||
}
|
||||
|
||||
export function listLlmProviderProfiles(): Promise<LlmProviderProfileListResponse> {
|
||||
return request<LlmProviderProfileListResponse>("/v1/planner/providers");
|
||||
}
|
||||
|
||||
export function createLlmProviderProfile(payload: {
|
||||
name: string;
|
||||
provider_type: LlmProviderType;
|
||||
model: string;
|
||||
base_url?: string | null;
|
||||
timeout_seconds: number;
|
||||
api_key: string;
|
||||
}): Promise<LlmProviderProfile> {
|
||||
return request<LlmProviderProfile>("/v1/planner/providers", {
|
||||
method: "POST",
|
||||
body: JSON.stringify(payload),
|
||||
});
|
||||
}
|
||||
|
||||
export function updateLlmProviderProfile(
|
||||
profileId: string,
|
||||
payload: {
|
||||
name?: string;
|
||||
provider_type?: LlmProviderType;
|
||||
model?: string;
|
||||
base_url?: string | null;
|
||||
timeout_seconds?: number;
|
||||
enabled?: boolean;
|
||||
api_key?: string;
|
||||
expected_revision?: number;
|
||||
},
|
||||
): Promise<LlmProviderProfile> {
|
||||
return request<LlmProviderProfile>(`/v1/planner/providers/${encodeURIComponent(profileId)}`, {
|
||||
method: "PATCH",
|
||||
body: JSON.stringify(payload),
|
||||
});
|
||||
}
|
||||
|
||||
export function activateLlmProviderProfile(
|
||||
profileId: string,
|
||||
expectedSettingsRevision: number,
|
||||
): Promise<LlmProviderSettings> {
|
||||
return request<LlmProviderSettings>(
|
||||
`/v1/planner/providers/${encodeURIComponent(profileId)}/activate`,
|
||||
{
|
||||
method: "POST",
|
||||
body: JSON.stringify({ expected_settings_revision: expectedSettingsRevision }),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function deleteLlmProviderProfile(
|
||||
profileId: string,
|
||||
expectedRevision: number,
|
||||
): Promise<void> {
|
||||
return request<void>(
|
||||
`/v1/planner/providers/${encodeURIComponent(profileId)}?expected_revision=${expectedRevision}`,
|
||||
{ method: "DELETE" },
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user