Skip to content

Commit

Permalink
Avoid the selection prompt when there is only one available agent
Browse files Browse the repository at this point in the history
  • Loading branch information
daxian-dbw committed Jan 9, 2024
1 parent 992d5ce commit 4bb79a8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions shell/ShellCopilot.Kernel/Shell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,11 @@ private void LoadAvailableAgents()

try
{
LLMAgent chosenAgent = Host
.PromptForSelectionAsync(
// If there is only 1 agent available, use it as the active one.
// Otherwise, ask user to choose the active one from the list.
LLMAgent chosenAgent = _agents.Count is 1
? _agents[0]
: Host.PromptForSelectionAsync(
title: "[orange1]Please select an [Blue]agent[/] to use[/]:",
choices: _agents,
converter: static a => a.Impl.Name)
Expand Down

0 comments on commit 4bb79a8

Please sign in to comment.