code: def generate_text(input: TextGenerationInput) -> TextGenerationOutput:
      """Generate text based on a given prompt."""
  
      res = nlp(
          input.text,
          temperature=input.temperature,
          max_length=input.max_length,
          repetition_penalty=input.repetition_penalty,
          top_k=input.top_k,
      )
      return TextGenerationOutput(
          generated_text=res[0]["generated_text"]
      )
  
imports: from pydantic import BaseModel, Field
  from transformers import pipeline
label_desc: Use image node_id 1 for calling a global function with example usage: generate_text(input) and returns: TextGenerationOutput