Add LM Studio support (#22)
This commit is contained in:
committed by
GitHub
parent
3529627172
commit
5fc49231ee
@@ -785,14 +785,28 @@ export class IpcClient {
|
||||
}
|
||||
}
|
||||
|
||||
public async listLocalModels(): Promise<LocalModel[]> {
|
||||
const { models, error } = (await this.ipcRenderer.invoke(
|
||||
"local-models:list"
|
||||
)) as LocalModelListResponse;
|
||||
if (error) {
|
||||
throw new Error(error);
|
||||
public async listLocalOllamaModels(): Promise<LocalModel[]> {
|
||||
try {
|
||||
const response = await this.ipcRenderer.invoke("local-models:list-ollama");
|
||||
return response?.models || [];
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
throw new Error(`Failed to fetch Ollama models: ${error.message}`);
|
||||
}
|
||||
throw new Error('Failed to fetch Ollama models: Unknown error occurred');
|
||||
}
|
||||
}
|
||||
|
||||
public async listLocalLMStudioModels(): Promise<LocalModel[]> {
|
||||
try {
|
||||
const response = await this.ipcRenderer.invoke("local-models:list-lmstudio");
|
||||
return response?.models || [];
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
throw new Error(`Failed to fetch LM Studio models: ${error.message}`);
|
||||
}
|
||||
throw new Error('Failed to fetch LM Studio models: Unknown error occurred');
|
||||
}
|
||||
return models;
|
||||
}
|
||||
|
||||
// Listen for deep link events
|
||||
|
||||
Reference in New Issue
Block a user