mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-07-15 13:00:53 +00:00

* First rough implementation of refactored run * Further improve run logic * Properly handle variadic input in run * Further work * Enhance names and add more documentation * Fix issue with output distribution * This works * Enhance run comments * Mark Multiplexer as greedy * Remove MergeLoop in favour of Multiplexer in tests * Remove FirstIntSelector in favour of Multiplexer * Handle corner when waiting for input is stuck * Remove unused import * Handle mutable input data in run and misbehaving components * Handle run input validation * Test validation * Fix pylint * Fix mypy * Call warm_up in run to fix tests
22 lines
725 B
Python
22 lines
725 B
Python
# SPDX-FileCopyrightText: 2022-present deepset GmbH <info@deepset.ai>
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
import logging
|
|
|
|
from haystack.core.pipeline import Pipeline
|
|
from haystack.testing.sample_components import AddFixedValue, Double
|
|
|
|
logging.basicConfig(level=logging.DEBUG)
|
|
|
|
|
|
def test_pipeline():
|
|
pipeline = Pipeline()
|
|
pipeline.add_component("first_addition", AddFixedValue(add=2))
|
|
pipeline.add_component("second_addition", AddFixedValue())
|
|
pipeline.add_component("double", Double())
|
|
pipeline.connect("first_addition", "double")
|
|
pipeline.connect("double", "second_addition")
|
|
|
|
results = pipeline.run({"first_addition": {"value": 1}})
|
|
assert results == {"second_addition": {"result": 7}}
|