АРЧ - UI и domain loop: синхронизировать локальную LLM-модель через shared config + КВИН 3
This commit is contained in:
@@ -41,6 +41,32 @@ async function request<T>(path: string, init?: RequestInit): Promise<T> {
|
||||
}
|
||||
|
||||
export const apiClient = {
|
||||
async loadSharedConnectionConfig(): Promise<{
|
||||
ok: boolean;
|
||||
connection: Omit<ConnectionState, "apiKey"> | null;
|
||||
updated_at: string | null;
|
||||
exists: boolean;
|
||||
}> {
|
||||
return request("/llm/shared-connection");
|
||||
},
|
||||
|
||||
async saveSharedConnectionConfig(connection: ConnectionState): Promise<{
|
||||
ok: boolean;
|
||||
connection: Omit<ConnectionState, "apiKey">;
|
||||
updated_at: string;
|
||||
}> {
|
||||
return request("/llm/shared-connection", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
llmProvider: connection.llmProvider,
|
||||
model: connection.model,
|
||||
baseUrl: connection.baseUrl,
|
||||
temperature: connection.temperature,
|
||||
maxOutputTokens: connection.maxOutputTokens
|
||||
})
|
||||
});
|
||||
},
|
||||
|
||||
async listModels(connection: ConnectionState): Promise<{ ok: boolean; models: string[]; count: number; timestamp: string }> {
|
||||
return request("/llm/models", {
|
||||
method: "POST",
|
||||
|
||||
Reference in New Issue
Block a user