Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net: Bug: Wrong code example in documentation #10565

Open
Arkanioos opened this issue Feb 17, 2025 · 0 comments
Open

.Net: Bug: Wrong code example in documentation #10565

Arkanioos opened this issue Feb 17, 2025 · 0 comments
Assignees
Labels
bug Something isn't working .NET Issue or Pull requests regarding .NET code

Comments

@Arkanioos
Copy link

Describe the bug
In the documentation, a code example is incorrect.

To Reproduce

  1. Go to 'https://learn.microsoft.com/en-us/semantic-kernel/frameworks/agent/agent-chat?pivots=programming-language-csharp'
  2. Scroll down to the 'Chat Termination' tab
  3. See the error

Expected behavior
In the following code example:

  1. // Define a kernel function for the selection strategy
  2. 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 ?

Screenshots
Image

Platform

  • Language: C#

Additional context
I may be wrong, sorry if that's the case !
Still learning tho.

@Arkanioos Arkanioos added the bug Something isn't working label Feb 17, 2025
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code triage labels Feb 17, 2025
@github-actions github-actions bot changed the title Bug: Wrong code example in documentation .Net: Bug: Wrong code example in documentation Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working .NET Issue or Pull requests regarding .NET code
Projects
Status: Bug
Development

No branches or pull requests

3 participants