semantic-kernel icon indicating copy to clipboard operation
semantic-kernel copied to clipboard

.Net: Agents - What should the default maximum number of turns be for AgentGroupChat?

Open crickman opened this issue 4 months ago • 0 comments

TerminationStrategy.MaximumIterations defines the maximum number of turns for agents to take in a chat. This only affects when calling:

public async IAsyncEnumerable<ChatMessageContent> InvokeAsync([EnumeratorCancellation] CancellationToken cancellationToken = default)

and not

public async IAsyncEnumerable<ChatMessageContent> InvokeAsync(Agent agent, [EnumeratorCancellation] CancellationToken cancellationToken = default)

As the second method always only takes a single turn for the given agent, regardless of the SelectionStrategy or MaximumIterations.

Current definition is:

  • The default TerminationStrategy on AgentGroupChatSettings is limited to a single iteration.
  • Any TerminationStrategy default to 99 maximum iterations.

crickman avatar Apr 11 '24 20:04 crickman