File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
extensions/positron-assistant/src Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -193,6 +193,7 @@ abstract class PositronAssistantParticipant implements IPositronAssistantPartici
193
193
// See IChatRuntimeSessionContext for the structure of the active
194
194
// session context objects
195
195
const activeSessions : Set < string > = new Set ( ) ;
196
+ let hasVariables = false ;
196
197
let hasConsoleSessions = false ;
197
198
for ( const reference of request . references ) {
198
199
const value = reference . value as any ;
@@ -202,6 +203,9 @@ abstract class PositronAssistantParticipant implements IPositronAssistantPartici
202
203
hasConsoleSessions = true ;
203
204
}
204
205
}
206
+ if ( value . variables && value . variables . length > 0 ) {
207
+ hasVariables = true ;
208
+ }
205
209
}
206
210
207
211
// List of tools for use by the language model.
@@ -279,8 +283,8 @@ abstract class PositronAssistantParticipant implements IPositronAssistantPartici
279
283
return activeSessions . has ( 'python' ) ;
280
284
case PositronAssistantToolName . GetPlot :
281
285
return positronContext . plots ?. hasPlots === true ;
282
- // case PositronAssistantToolName.InspectVariables:
283
- // TODO: only allow this tool when there are variables to inspect
286
+ case PositronAssistantToolName . InspectVariables :
287
+ return hasVariables ;
284
288
// Otherwise, include the tool if it is tagged for use with Positron Assistant.
285
289
// Allow all tools in Agent mode.
286
290
default :
You can’t perform that action at this time.
0 commit comments