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: add 'RetainArgumentTypes' to agent arguments for ModelContextProtocolPlugin demo #11488

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pjirsa
Copy link
Contributor

@pjirsa pjirsa commented Apr 10, 2025

Motivation and Context

Extremely high token consumption when running this demo: https://github.com/microsoft/semantic-kernel/tree/main/dotnet/samples/Demos/ModelContextProtocolPlugin

When calling the ChatCompletionAgent with the default 'false' value for RetainArgumentTypes, all arguments are converted to string values which causes some of the tool calls to fail. The agent then iterates through other tools, searching for a successful response. This results in 80-85k tokens being consumed where only 11-12k should be consumed.

Description

This PR will update the ModelContextProtocolPlugin demo to re-use the configured PromptExecutionSettings object that includes the correct value for RetainArgumentTypes.

@pjirsa pjirsa requested a review from a team as a code owner April 10, 2025 15:04
@markwallace-microsoft markwallace-microsoft added the .NET Issue or Pull requests regarding .NET code label Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.NET Issue or Pull requests regarding .NET code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants