Skip to main content
For the complete documentation index for agents and LLMs, see llms.txt.

WelcomeTextGenerator

Generate an uppercase welcome message from a name stringโ€”a minimal example component that demonstrates how to build a custom Haystack component.

Key Featuresโ€‹

  • Accepts a name string and returns a personalized, uppercase greeting.
  • Returns a second output (note) confirming the message is ready.
  • Requires no credentials or external services.
  • Demonstrates the @component decorator and @component.output_types pattern.
  • Can be used in any pipeline that needs a simple text transformation step.

Configurationโ€‹

No credentials or environment variables are required for this component.

  1. Drag the WelcomeTextGenerator component onto the canvas from the Component Library.
  2. Click on the component to open the configuration panel.
  3. No additional settings are required.

Connectionsโ€‹

WelcomeTextGenerator receives a name string. It outputs a welcome_text string (the greeting in uppercase) and a note string confirming the message is ready. Connect the welcome_text output to a prompt builder or any component that expects a text string.

Source Codeโ€‹

To check this component's source code, open context_prompt.py in the Haystack Core Integrations repository.

Usage Examplesโ€‹

Basic Configurationโ€‹

WelcomeTextGenerator:
type: haystack_integrations.prompts.github.context_prompt.WelcomeTextGenerator
init_parameters: {}

Using the Component in a Pipelineโ€‹

This example shows a pipeline that accepts a name from the input and returns a welcome message.

# haystack-pipeline

components:
welcome_generator:
type: haystack_integrations.prompts.github.context_prompt.WelcomeTextGenerator
init_parameters: {}

connections: []

inputs:
query:
- welcome_generator.name

outputs:
welcome_text: welcome_generator.welcome_text

max_runs_per_component: 100

metadata: {}

Parametersโ€‹

Inputsโ€‹

ParameterTypeDescription
namestrThe name to include in the welcome message.

Outputsโ€‹

ParameterTypeDescription
welcome_textstrPersonalized greeting in uppercase (for example, HELLO ALICE, WELCOME TO HAYSTACK!).
notestrA confirmation string: welcome message is ready.

Init Parametersโ€‹

This component has no init parameters.