You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Here a simplified RAG pipeline (where a directly inject documents for testing):
The purpose of the latter is to offer a way of bypassing the generator when no documents is available using a ConditionalRouter.
The very last component of the pipeline is a custom component whose aim is to aggregate all variables in a payload that will be provided to build an API . Its code is as follows:
@component
class PayloadBuilder2:
"""
A component to build the payload
"""
@component.output_types(payload=Dict)
def run(
self,
documents: List[Document],
replies: List[ChatMessage],
no_documents: str,
):
print("PayloadBuilder.run")
return {
"payload": {
"documents": documents,
"no_documents": no_documents,
"replies": replies,
}
}
The problem is that no matter what we send, the pipeline will return an empty dictionary:
{}
By debugging, i found that the the reason is that my custom component necessarily expects to have a value for no_documents input in order to be allowed to run.
The fix in my case was the following:
Replace:
no_documents: str,
By
no_documents: str="",
The default parameter allow the component to run even if the pipeline don't go through this no_documents branch!
Describe the solution you'd like
Could it be possible to get a warning/message at runtime or creation of the pipeline when a component that should be run cannot because it will never have its requested value? ( because of a CondionalRouter for example)
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
![pipeline](https://private-user-images.githubusercontent.com/42644930/313285871-b6965479-ec17-4260-afd4-be77f2ebdbe8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE4NjI3NDYsIm5iZiI6MTcyMTg2MjQ0NiwicGF0aCI6Ii80MjY0NDkzMC8zMTMyODU4NzEtYjY5NjU0NzktZWMxNy00MjYwLWFmZDQtYmU3N2YyZWJkYmU4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI0VDIzMDcyNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNlOTM4NDliY2NmYjc5YjU2MTBjZDIxMzBmMzI0N2RkMGM3NWQwZTE1Y2YyMTdlYmQ4MTcwN2NlNWE3ZGJjNjgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.rd3lboXifwR877gxr33MCef5-vJCFynacVhB4uDn2oo)
Here a simplified RAG pipeline (where a directly inject documents for testing):
The purpose of the latter is to offer a way of bypassing the generator when no documents is available using a
ConditionalRouter
.The very last component of the pipeline is a custom component whose aim is to aggregate all variables in a payload that will be provided to build an API . Its code is as follows:
The problem is that no matter what we send, the pipeline will return an empty dictionary:
By debugging, i found that the the reason is that my custom component necessarily expects to have a value for
no_documents
input in order to be allowed torun
.The fix in my case was the following:
Replace:
By
The default parameter allow the component to run even if the pipeline don't go through this
no_documents
branch!Describe the solution you'd like
Could it be possible to get a warning/message at runtime or creation of the pipeline when a component that should be run cannot because it will never have its requested value? ( because of a
CondionalRouter
for example)Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: