Skip to content

Commit ac41081

Browse files
committed
Merge branch 'chatai' of https://github.com/halcyon-tech/vscode-db2i into chatai
merge
2 parents a54d8f2 + b9070d6 commit ac41081

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

src/chat/chat.ts

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,24 +140,36 @@ async function streamModelResponse(
140140

141141
stream.progress(`Using ${chosenProvider}...`);
142142

143-
await chatRequest(chosenProvider, messages, {}, token, stream);
143+
return chatRequest(chosenProvider, messages, {}, token, stream);
144144
}
145145

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)