AnswerJoiner
Merges multiple lists of Answer objects into a single list.
Basic Information
- Type:
haystack_integrations.joiners.answer_joiner.AnswerJoiner
Inputs
| Parameter | Type | Default | Description |
|---|---|---|---|
| answers | Variadic[List[AnswerType]] | Nested list of Answers to be merged. | |
| top_k | Optional[int] | None | The maximum number of Answers to return. Overrides the instance's top_k if provided. |
Outputs
| Parameter | Type | Default | Description |
|---|---|---|---|
| answers | List[AnswerType] | A dictionary with the following keys: - answers: Merged list of Answers |
Overview
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:
| Parameter | Type | Default | Description |
|---|---|---|---|
| join_mode | Union[str, JoinMode] | JoinMode.CONCATENATE | Specifies the join mode to use. Available modes: - concatenate: Concatenates multiple lists of Answers into a single list. |
| top_k | Optional[int] | None | The maximum number of Answers to return. |
| sort_by_score | bool | False | If 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.
| Parameter | Type | Default | Description |
|---|---|---|---|
| answers | Variadic[List[AnswerType]] | Nested list of Answers to be merged. | |
| top_k | Optional[int] | None | The maximum number of Answers to return. Overrides the instance's top_k if provided. |
Was this page helpful?