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: add required flag for prompt builder inputs #7553

Conversation

LastRemote
Copy link
Contributor

Related Issues

Proposed Changes:

PromptBuilder now takes a new optional parameter required_variables upon initialization to specify a list of jinja template variables that must be provided at all times. During pipeline or component runs, a properValueError will be thrown if some of the required variables are missing.

How did you test it?

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

Notes for the reviewer

For the sake of completeness, I also added a validation check in PromptBuilder.run().

Checklist

@LastRemote LastRemote requested review from a team as code owners April 17, 2024 03:30
@LastRemote LastRemote requested review from dfokina and shadeMe and removed request for a team April 17, 2024 03:30
@CLAassistant
Copy link

CLAassistant commented Apr 17, 2024

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added topic:tests 2.x Related to Haystack v2.0 type:documentation Improvements on the docs labels Apr 17, 2024
@LastRemote
Copy link
Contributor Author

Previous PR: #7442 . I devided to make a new one since this should not be considered a fix anymore.

@LastRemote LastRemote force-pushed the feat/add-required-flag-for-prompt-builder-inputs branch from 1c4adc1 to 5686eee Compare April 17, 2024 03:37
@shadeMe shadeMe self-assigned this Apr 20, 2024
@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 8715948805

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 90.073%

Totals Coverage Status
Change from base Build 8664841004: 0.01%
Covered Lines: 6261
Relevant Lines: 6951

💛 - Coveralls

@shadeMe shadeMe assigned silvanocerza and unassigned shadeMe Apr 25, 2024
@shadeMe shadeMe requested review from silvanocerza and removed request for shadeMe April 25, 2024 14:09
Copy link
Contributor

@silvanocerza silvanocerza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks! 🚀

@silvanocerza silvanocerza merged commit 40360e4 into deepset-ai:main Apr 29, 2024
23 checks passed
@LastRemote LastRemote deleted the feat/add-required-flag-for-prompt-builder-inputs branch May 7, 2024 03:53
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:tests type:documentation Improvements on the docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants