Skip to content

Commit 67cf28b

Browse files
committed
show model provider and model name when new model is selected
1 parent 57aa120 commit 67cf28b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/chat/chat.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,23 @@ export function activateChat(context: vscode.ExtensionContext) {
127127
context.subscriptions.push(chat, changeModelCommand);
128128
}
129129

130+
let lastSelectedModel: string | null = null;
131+
132+
async function showModelProviderIfNeeded(
133+
stream: vscode.ChatResponseStream,
134+
chosenProvider: AiProvider,
135+
chosenModel: string
136+
) {
137+
const currentModel = AiConfig.getModel();
138+
139+
if (lastSelectedModel === null || lastSelectedModel !== currentModel) {
140+
stream.markdown(
141+
`**Provider👨‍💻:** ${chosenProvider}\n\n**Model🧠:** ${chosenModel}\n\n***\n\n`
142+
);
143+
lastSelectedModel = currentModel;
144+
}
145+
}
146+
130147
async function streamModelResponse(
131148
messages: vscode.LanguageModelChatMessage[],
132149
stream: vscode.ChatResponseStream,
@@ -146,6 +163,7 @@ async function streamModelResponse(
146163
return;
147164
}
148165

166+
showModelProviderIfNeeded(stream, chosenProvider, chosenModel);
149167
stream.progress(`Provider: ${chosenProvider} Model: ${chosenModel}`);
150168

151169
return chatRequest(chosenProvider, messages, {}, token, stream);

0 commit comments

Comments
 (0)