Skip to content

Commit b9070d6

Browse files
committed
Cleanup of chat selector
1 parent 74426a5 commit b9070d6

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

src/chat/chat.ts

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,18 +146,30 @@ async function streamModelResponse(
146146
async function selectProviderAndModel() {
147147
const selected = AiConfig.getModel();
148148
const copilotModels = await vscode.lm.selectChatModels();
149-
let ollamaModels: ListResponse = {models: []};
150-
149+
let ollamaModels: ListResponse = { models: [] };
150+
151151
try {
152152
ollamaModels = await ollama.list();
153-
} catch (e) {}
153+
} catch (e) { }
154154

155155
const provider = await vscode.window.showQuickPick(
156156
[
157-
{kind: vscode.QuickPickItemKind.Separator, label: "Ollama Models"},
158-
...ollamaModels.models.map((model): ModelQuickPickItem => ({ label: model.name, family: model.name, provider: "Ollama", iconPath: new vscode.ThemeIcon("heart"), picked: model.name === selected})),
159-
{kind: vscode.QuickPickItemKind.Separator, label: "GitHub Copilot Models"},
160-
...copilotModels.map((model): ModelQuickPickItem => ({ label: model.name, family: model.family, provider: "GitHub Copilot", iconPath: new vscode.ThemeIcon("copilot")})),
157+
{ kind: vscode.QuickPickItemKind.Separator, label: "Ollama Models" },
158+
...ollamaModels.models.map((model): ModelQuickPickItem => ({
159+
label: model.name,
160+
family: model.name,
161+
provider: "Ollama",
162+
iconPath: new vscode.ThemeIcon("heart"),
163+
description: selected === model.name ? "Selected" : ""
164+
})),
165+
{ kind: vscode.QuickPickItemKind.Separator, label: "GitHub Copilot Models" },
166+
...copilotModels.map((model): ModelQuickPickItem => ({
167+
label: model.name,
168+
family: model.family,
169+
provider: "GitHub Copilot",
170+
iconPath: new vscode.ThemeIcon("copilot"),
171+
description: selected === model.name ? "Selected" : ""
172+
})),
161173
],
162174
{
163175
title: "Select the AI model",

0 commit comments

Comments
 (0)