future_annotations.py
1 # SPDX-FileCopyrightText: 2022-present deepset GmbH <info@deepset.ai> 2 # 3 # SPDX-License-Identifier: Apache-2.0 4 5 from __future__ import annotations 6 7 from haystack import component 8 9 10 @component 11 class HelloUsingFutureAnnotations: 12 @component.output_types(output=str) 13 def run(self, word: str) -> dict[str, str]: 14 """Takes a string in input and returns "Hello, <string>!"in output.""" 15 return {"output": f"Hello, {word}!"}