.Net: KernelProcessEventData deserialized in LocalAgentStep #13203
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Why is this change required?
Because
LocalAgentStep
was passingKernelProcessEventData
wrappers directly intoKernelArguments
, unlikeLocalStep
which unwraps them. This inconsistency caused agents to receive JSON-like data instead of the actual payload.What problem does it solve?
It ensures that agents receive the real value (e.g. the user’s message text) instead of the wrapper object, preventing confusing model responses like “you seem to be passing a json”.
What scenario does it contribute to?
Agent-based process pipelines (for example a simple chat process where user input is sent to an agent). The agent now correctly sees the user input as plain text or object, improving reliability and user experience.
Description
This PR updates
LocalAgentStep
so that it unwrapsKernelProcessEventData
before passing it intoKernelArguments["message"]
.TargetEventData
is aKernelProcessEventData
, we now call.ToObject()
to get the real value.LocalAgentStep
consistent withLocalStep.AssignStepFunctionParameterValues
.With this change, agents no longer receive the wrapper object but the actual payload (for example the plain user input), which avoids the model interpreting it as JSON.
Contribution Checklist