haystack icon indicating copy to clipboard operation
haystack copied to clipboard

feat: add required flag for prompt builder inputs

Open LastRemote opened this issue 1 year ago • 3 comments

Related Issues

  • changes PromptBuilder behavior according to #7441

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 avatar Apr 17 '24 03:04 LastRemote

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Apr 17 '24 03:04 CLAassistant

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

LastRemote avatar Apr 17 '24 03:04 LastRemote

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

coveralls avatar Apr 20 '24 11:04 coveralls