Skip to main content

AnswerJoiner

Merges multiple lists of Answer objects into a single list.

Basic Information

  • Type: haystack_integrations.joiners.answer_joiner.AnswerJoiner

Inputs

ParameterTypeDefaultDescription
answersVariadic[List[AnswerType]]Nested list of Answers to be merged.
top_kOptional[int]NoneThe maximum number of Answers to return. Overrides the instance's top_k if provided.

Outputs

ParameterTypeDefaultDescription
answersList[AnswerType]A dictionary with the following keys: - answers: Merged list of Answers

Overview

Work in Progress

Bear with us while we're working on adding pipeline examples and most common components connections.

Merges multiple lists of Answer objects into a single list.

Use this component to combine answers from different Generators into a single list. Currently, the component supports only one join mode: CONCATENATE. This mode concatenates multiple lists of answers into a single list.

Usage Example

components:
AnswerJoiner:
type: components.joiners.answer_joiner.AnswerJoiner
init_parameters:

Parameters

Init Parameters

These are the parameters you can configure in Pipeline Builder:

ParameterTypeDefaultDescription
join_modeUnion[str, JoinMode]JoinMode.CONCATENATESpecifies the join mode to use. Available modes: - concatenate: Concatenates multiple lists of Answers into a single list.
top_kOptional[int]NoneThe maximum number of Answers to return.
sort_by_scoreboolFalseIf True, sorts the documents by score in descending order. If a document has no score, it is handled as if its score is -infinity.

Run Method Parameters

These are the parameters you can configure for the component's run() method. This means you can pass these parameters at query time through the API, in Playground, or when running a job. For details, see Modify Pipeline Parameters at Query Time.

ParameterTypeDefaultDescription
answersVariadic[List[AnswerType]]Nested list of Answers to be merged.
top_kOptional[int]NoneThe maximum number of Answers to return. Overrides the instance's top_k if provided.