@@ -140,24 +140,36 @@ async function streamModelResponse(
140
140
141
141
stream . progress ( `Using ${ chosenProvider } ...` ) ;
142
142
143
- await chatRequest ( chosenProvider , messages , { } , token , stream ) ;
143
+ return chatRequest ( chosenProvider , messages , { } , token , stream ) ;
144
144
}
145
145
146
146
async function selectProviderAndModel ( ) {
147
147
const selected = AiConfig . getModel ( ) ;
148
148
const copilotModels = await vscode . lm . selectChatModels ( ) ;
149
- let ollamaModels : ListResponse = { models : [ ] } ;
150
-
149
+ let ollamaModels : ListResponse = { models : [ ] } ;
150
+
151
151
try {
152
152
ollamaModels = await ollama . list ( ) ;
153
- } catch ( e ) { }
153
+ } catch ( e ) { }
154
154
155
155
const provider = await vscode . window . showQuickPick (
156
156
[
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
+ } ) ) ,
161
173
] ,
162
174
{
163
175
title : "Select the AI model" ,
0 commit comments