feat: add agent_with_prompt_builder super-component#440
Draft
feat: add agent_with_prompt_builder super-component#440
Conversation
As we've seen ChatPromptBuilder be paired with Agent for every use-case, a good opportunity for simplification is a super-component that encapsulates the two.
Pull Request Test Coverage Report for Build 22105228703Details
💛 - Coveralls |
sjrl
reviewed
Feb 17, 2026
| # --- ChatPromptBuilder parameters --- # | ||
| template: list[ChatMessage] | str | None = None, | ||
| required_variables: list[str] | Literal["*"] | None = None, | ||
| variables: list[str] | None = None, |
Contributor
There was a problem hiding this comment.
For simplicity we could consider dropping variables and just not use it. I don't think it's often used since we often rely on the auto detection of the template
sjrl
reviewed
Feb 17, 2026
| self, | ||
| *, | ||
| # --- ChatPromptBuilder parameters --- # | ||
| template: list[ChatMessage] | str | None = None, |
Contributor
There was a problem hiding this comment.
I think a preferred interface for this new component is to just expose a param called user_prompt: str which we feed into the ChatPromptBuilder internally.
Contributor
|
A few other comments I have:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issues
n/a
Proposed Changes:
As we've seen ChatPromptBuilder be paired with Agent for every use-case on the Platform, a good opportunity for simplification would be a (super-)component that encapsulates the two.
This is an attempts at implementation with a super-component indeed, happy for general feedback on that take.
How did you test it?
Added unit tests, mainly to ensure good behavior of the super-component's input inference based on the template provided.
Notes for the reviewer
I've tried to be exhaustive but there is one thing that I still don't quite get, and would appreciate guidance on:
to_dictandfrom_dict. I saw for example on Haystack'sdocument_preprocessorhow they are defined, but not on themulti_file_converterand I'm not sure I understand why on or the other.Also - as it's my first contribution to Haystack (albeit experimental), any pointers as to unfollowed standards, code quality or misunderstandings of the framework are more than welcome!
Checklist
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:.