allow creating and listing custom language model (#134)

This commit is contained in:
Will Chen
2025-05-12 16:00:16 -07:00
committed by GitHub
parent c63781d7cc
commit 477015b43d
13 changed files with 925 additions and 291 deletions

View File

@@ -22,6 +22,9 @@ import type {
ChatLogsData,
BranchResult,
LanguageModelProvider,
LanguageModel,
CreateCustomLanguageModelProviderParams,
CreateCustomLanguageModelParams,
} from "./ipc_types";
import type { ProposalResult } from "@/lib/schemas";
import { showError } from "@/lib/toast";
@@ -732,17 +735,18 @@ export class IpcClient {
return this.ipcRenderer.invoke("get-language-model-providers");
}
public async getLanguageModels(params: {
providerId: string;
}): Promise<LanguageModel[]> {
return this.ipcRenderer.invoke("get-language-models", params);
}
public async createCustomLanguageModelProvider({
id,
name,
apiBaseUrl,
envVarName,
}: {
id: string;
name: string;
apiBaseUrl: string;
envVarName?: string;
}): Promise<LanguageModelProvider> {
}: CreateCustomLanguageModelProviderParams): Promise<LanguageModelProvider> {
return this.ipcRenderer.invoke("create-custom-language-model-provider", {
id,
name,
@@ -751,5 +755,11 @@ export class IpcClient {
});
}
public async createCustomLanguageModel(
params: CreateCustomLanguageModelParams,
): Promise<void> {
await this.ipcRenderer.invoke("create-custom-language-model", params);
}
// --- End window control methods ---
}