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

feat!: Dont run nodes with only default inputs #8680

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Willenbrink
Copy link

@Willenbrink Willenbrink commented Jan 2, 2025

Related Issues

Proposed Changes:

Currently, nodes with only default inputs (or a variadic input without any input) are run by the pipeline. This PR changes that.

An example to motivate the change is the prompt builder: Assume that we have a pipeline for structured output, similar to this example. But instead of the prompt builder being run every time, we want it to only run sometimes. In this case, if the pipeline does not run the prompt builder and reaches its end, the prompt builder suddenly runs without being passed any input and the whole skipped branch runs. See the cropped pipeline below:

pipeline_edited

This is obviously a breaking change. I think it is worth it anyway as the issue is quite hard to work around in more complicated pipelines and occurs multiple times in my project and presumably others too.

How did you test it?

The unit tests were adapted to reflect the changes. I also successfully use the PR in my project.

Notes for the reviewer

Review after #8679 as it is based on that one.

Checklist

  • I have read the contributors guidelines and the code of conduct
  • I have updated the related issue with new insights and changes
  • I added unit tests and updated the docstrings
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I documented my code
  • I ran pre-commit hooks and fixed any issue

@Willenbrink Willenbrink requested a review from a team as a code owner January 2, 2025 13:31
@Willenbrink Willenbrink requested review from Amnah199 and removed request for a team January 2, 2025 13:31
@CLAassistant
Copy link

CLAassistant commented Jan 2, 2025

CLA assistant check
All committers have signed the CLA.

@Willenbrink Willenbrink force-pushed the dont-run-only-default-nodes branch from 7b0c493 to d7fe07b Compare January 2, 2025 16:33
@Willenbrink Willenbrink force-pushed the dont-run-only-default-nodes branch from d7fe07b to e49ffa0 Compare January 3, 2025 12:25
@Willenbrink Willenbrink marked this pull request as draft January 3, 2025 12:37
This allows recognizing nodes with only default inputs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants