-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Improve PromptNode
integration with other nodes in Pipelines
#3877
Labels
Comments
@vblagoje I made some changes:
|
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
PromptNode
works differently then all other nodes with respect to:That makes it difficult for users to replace an existing node by
PromptNode
. This also makes it harder to experiment with different pipeline setups. Haystack users currently need to learn how to usePromptNode
instead of just connecting it like any other node.Describe the solution you'd like
PromptNode
should be usable as simple as any other node. Especially for existing use-cases like question answering it is too hard to usePromptNode
. See this example:Instead it should be something like that:
Here
QAPromptNode
could be easily replaced by anyReader
orGenerator
.So I suggest to:
QAPromptNode
which is an aggregate consisting of aPromptNode
with one input and one outputShaper
under the hoodquery
andqueries
params like any other nodeOpenAIAnswerGenerator
in:haystack/haystack/nodes/answer_generator/openai.py
Line 164 in d157e41
answers
like any otherReader
orGenerator
output_variable
can still set the key to enable multiple PromptNode results (see Results of intermediatePromptNodes
in a Multi-PromptNode
-Pipelines are burried #3878).Describe alternatives you've considered
PromptNode
andShaper
only, but I guess especially for experimenting, supporting the main use-cases like Generative QA, should be as easy as with any other node to give users the opportunity to replace existing nodes withPromptNode
.input_shaper
andoutput_shaper
params toPromptNode
. These could be set by default for certaindefault_prompt_template
values, e.g. set the corresponding shapers forquestion_answering
. Problem here is, thatPromptNode
would act completely differently depending on which template you use.PromptNode
itself. This would even be easier to handle for users, as there are less components to know (onlyPromptNode
, noQAPromptNode
, noShaper
). It would enable the shaping to make use ofPromptNode
's variables, like e.g. the model tokenizer, which improves/eases shaping (e.g. for concat_docs where there is a token limit for the prompt that onlyPromptNode
can know). But this would also mean that most of the functionality ofShaper
needs to be implemented withinPromptNode
which makes it pretty complex in addition to the drawbacks of the previous alternative.Additional context
We should not miss the great flexibility that
PromptNode
offers, of course. But I guess some clever decisions could improve user experience here a lot.The text was updated successfully, but these errors were encountered: