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
Describe the bug
When using an AnswerBuilder after a ChatGenerator I am also passing meta information to the AnswerBuilder. However, when I do this noticed that the meta information I pass is ignored.
Here is an example piece of code
fromhaystackimportPipelinefromhaystack.dataclassesimportChatRole, ChatMessagefromhaystack.components.buildersimportAnswerBuilderbuilder=AnswerBuilder()
pipeline=Pipeline()
pipeline.add_component(name="builder", instance=builder)
# Test the pipelineresult=pipeline.run(
data={
"builder": {
"query": "What's the answer?",
"replies": [
ChatMessage(
role=ChatRole.ASSISTANT,
content="This is the answer from the LLM.",
meta={"stuff": "meta data that always comes from the generator"},
name=None
)
],
"meta": [
{"my_meta": "The meta data I want to add to the answer"}
]
}
}
)
print(result)
# {'builder':# {# 'answers': [# GeneratedAnswer(# data='This is the answer from the LLM.',# query="What's the answer?",# documents=[],# meta={'stuff': 'meta data that always comes from the generator'}) # <-- Should also include meta I passed# ]# }}
Expected behavior
Merge the meta data from the replies of the ChatGenerator + meta data passed as a run time variable
To Reproduce
Run the sample code
The text was updated successfully, but these errors were encountered:
sjrl
changed the title
Runtime meta parameter is ignored in AnswerBuilder
bug: Runtime meta parameter is ignored in AnswerBuilder
Nov 13, 2024
Describe the bug
When using an
AnswerBuilder
after aChatGenerator
I am also passing meta information to theAnswerBuilder
. However, when I do this noticed that the meta information I pass is ignored.Here is an example piece of code
Expected behavior
Merge the meta data from the replies of the ChatGenerator + meta data passed as a run time variable
To Reproduce
Run the sample code
The text was updated successfully, but these errors were encountered: