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

fix: make PromptBuilder input parameters mandatory #7442

Closed

Conversation

LastRemote
Copy link
Contributor

@LastRemote LastRemote commented Mar 30, 2024

Related Issues

Proposed Changes:

Make {'is_mandatory': True} for all PromptBuilder inputs. PromptBuilder will now check the input variables during pipeline runs and throw ValueError if some of the template variables found in jinja templates are missing.

How did you test it?

Tested by following the 2.0 RAG pipeline recipe from https://docs.haystack.deepset.ai/docs/creating-pipelines

Notes for the reviewer

Not sure if this needs a new unit test for a small change like this, but I can definitely go add one if necessary.
An additional question would be if PromptBuilder.run() should check these parameters as well. I decided to leave it alone since this willwould alter the behavior in test.components.builders.test_run_without_input(), but it makes sense either way.

Checklist

@LastRemote LastRemote requested a review from a team as a code owner March 30, 2024 10:26
@LastRemote LastRemote requested review from silvanocerza and removed request for a team March 30, 2024 10:26
@CLAassistant
Copy link

CLAassistant commented Mar 30, 2024

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the 2.x Related to Haystack v2.0 label Mar 30, 2024
@masci masci assigned silvanocerza and unassigned silvanocerza Apr 1, 2024
@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 8490134263

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 89.532%

Totals Coverage Status
Change from base Build 8466615213: 0.0%
Covered Lines: 5568
Relevant Lines: 6219

💛 - Coveralls

@shadeMe
Copy link
Collaborator

shadeMe commented Apr 2, 2024

Thanks for the PR! Would you mind adding a release note as well?

@LastRemote
Copy link
Contributor Author

Thanks for the PR! Would you mind adding a release note as well?

Thanks for the reply. Sure, I can add a release note to this, but I believe the issue still needs further discussion and we might need to change the implementation accordingly to avoid potential breaking changes (see #7441).

@LastRemote LastRemote changed the title fix: make PromptBuilder input parameters mandatory feat: add required flag for prompt builder inputs Apr 17, 2024
@LastRemote
Copy link
Contributor Author

Closing this PR in favor of #7553

@LastRemote LastRemote closed this Apr 17, 2024
@LastRemote LastRemote changed the title feat: add required flag for prompt builder inputs fix: make PromptBuilder input parameters mandatory Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Related to Haystack v2.0 topic:promptnode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

All input parameters in PromptBuilder are optional
5 participants