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