refactor: consolidate agent node input conversion into a helper and add validation test coverage#991
Open
hanorik wants to merge 1 commit into
Open
refactor: consolidate agent node input conversion into a helper and add validation test coverage#991hanorik wants to merge 1 commit into
hanorik wants to merge 1 commit into
Conversation
…dd validation test coverage
wolo-lab
approved these changes
Jun 9, 2026
| Parts: []*genai.Part{{Text: string(b)}}, | ||
| } | ||
| } | ||
| if userContent == nil { |
There was a problem hiding this comment.
I would remove this fallback. Is there a strong reason to keep it?
Contributor
Author
There was a problem hiding this comment.
I thought that there might be situations when agent node could receive nil input so the agent could reference the original UserContent rather than being invoked with completely empty context, wdyt?
There was a problem hiding this comment.
please verify what adk python does in this scenario.
Contributor
Author
There was a problem hiding this comment.
Seems that they don't fallback and just provide None input.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Consolidated AgentNode input validation and conversion logic. Input schemas are now fully integrated with BaseNode, and input data is parsed into
genai.Contentbefore invoking the wrapped agent.Key Changes
inputSchema/outputSchemafields fromAgentNode. These schemas now reside entirely inBaseNodeand are passed via the constructor.nodeInputToContent, which handles:nil*genai.Contentstringjson.MarshalerAgentNode.Runconverts the validated input into a*genai.Contentand passes it to the wrapped agent, which observes it asInvocationContext.UserContent().Tests Added