-
Notifications
You must be signed in to change notification settings - Fork 18
Add test for Pydantic model output field reference between nodes #3370
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
base: main
Are you sure you want to change the base?
Add test for Pydantic model output field reference between nodes #3370
Conversation
This test demonstrates that a node can output a Pydantic model and a subsequent node can reference a specific field from that model using bracket notation (e.g., FirstNode.Outputs.profile["name"]). Co-Authored-By: [email protected] <[email protected]>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
dvargas92495
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DevinAI if the test fails on main, let it
| class SecondNode(BaseNode): | ||
| """A node that references a field from the Pydantic model output.""" | ||
|
|
||
| user_name = FirstNode.Outputs.profile["name"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DevinAI change this reference to point to the profile directly, eg user = FirstNode.Outputs.profile
| greeting: str | ||
|
|
||
| def run(self) -> BaseOutputs: | ||
| return self.Outputs(greeting=f"Hello, {self.user_name}!") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DevinAI then update the interpolation here to self.profile.name
…n method Co-Authored-By: [email protected] <[email protected]>
Adds a test demonstrating that a node can output a Pydantic model and a subsequent node can reference that model output, then access its fields via dot notation in the run method (e.g.,
self.profile.name).