-
Notifications
You must be signed in to change notification settings - Fork 2.5k
fix: prompt-builder - jinja2 template set vars still shows required #9932
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?
Conversation
|
@srini047 is attempting to deploy a commit to the deepset Team on Vercel. A member of the Team first needs to authorize it. |
Pull Request Test Coverage Report for Build 19204656740Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
|
With the above listed changes I think we could then extend this to the other components you mention. It may be wise to add this as a utility method in |
|
hey @srini047 do you think you'll have time to work on this, this week? |
6835a8a to
a305317
Compare
624a201 to
de715ff
Compare
d016bd3 to
25e7416
Compare
25e7416 to
1f24f61
Compare
2f9d8c5 to
6a5705e
Compare
| extracted_variables = [] | ||
| if template and not variables: | ||
|
|
||
| def _extract_from_text( |
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.
Could we make this a class function instead of inline. Please also keep it as private so fine to leave the name as _extract_from_text
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.
Hey @srini047 it looks like this function wasn't made into a class function with signature
def _extract_from_text(
self, text: Optional[str], role: Optional[str] = None, is_filter_allowed: bool = False
) -> list[str]:yet
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.
@sjrl Can you take a look now. Hope this is the expectation.
Related Issues
PromptBuilderincorrectly marks internally set Jinja2 variables as required inputs when using `required_variables='*' #9916Proposed Changes:
Previously we checked only the undeclared variables and left the set variables.
Now, we find all the variables assigned using
setin the template and push it to the variables list.This behaviour would be seen in multiple components namely:
How did you test it?
Run the exisiting suite and added test case for the this scenario.
Notes for the reviewer
Checklist
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:and added!in case the PR includes breaking changes.