Add ollama support (#7)

This commit is contained in:
Will Chen
2025-04-23 14:48:57 -07:00
committed by GitHub
parent a7b3e66499
commit b616598bab
14 changed files with 386 additions and 73 deletions

View File

@@ -17,6 +17,8 @@ import type {
Message,
Version,
SystemDebugInfo,
LocalModel,
LocalModelListResponse,
} from "./ipc_types";
import type { CodeProposal, ProposalResult } from "@/lib/schemas";
import { showError } from "@/lib/toast";
@@ -729,14 +731,24 @@ export class IpcClient {
// Get system debug information
public async getSystemDebugInfo(): Promise<SystemDebugInfo> {
try {
const result = await this.ipcRenderer.invoke("get-system-debug-info");
return result;
const data = await this.ipcRenderer.invoke("get-system-debug-info");
return data;
} catch (error) {
showError(error);
throw error;
}
}
public async listLocalModels(): Promise<LocalModel[]> {
const { models, error } = (await this.ipcRenderer.invoke(
"local-models:list"
)) as LocalModelListResponse;
if (error) {
throw new Error(error);
}
return models;
}
// Listen for deep link events
public onDeepLinkReceived(
callback: (data: DeepLinkData) => void