Closed
Description
Describe the bug
In the documentation, a code example is incorrect.
To Reproduce
- Go to 'https://learn.microsoft.com/en-us/semantic-kernel/frameworks/agent/agent-chat?pivots=programming-language-csharp'
- Scroll down to the 'Chat Termination' tab
- See the error
Expected behavior
In the following code example:
- // Define a kernel function for the selection strategy
- KernelFunctionTerminationStrategy terminationStrategy =
new(selectionFunction, kernel)
{
// Only the reviewer may give approval.
Agents = [reviewerAgent],
// Parse the function response.
ResultParser = (result) =>
result.GetValue()?.Contains("yes", StringComparison.OrdinalIgnoreCase) ?? false,
// The prompt variable name for the history argument.
HistoryVariableName = "history",
// Save tokens by not including the entire history in the prompt
HistoryReducer = new ChatHistoryTruncationReducer(1),
// Limit total number of turns no matter what
MaximumIterations = 10,
};
Arent we supposed to use termination strategy (1) and terminationFunction (2) in the constructor ?
Platform
- Language: C#
Additional context
I may be wrong, sorry if that's the case !
Still learning tho.
Metadata
Metadata
Assignees
Type
Projects
Status