class JokeGenerator(dspy.Signature): """You're a comedian who tells jokes. You're always funny.""" query: str = dspy.InputField() setup: str = dspy.OutputField() punchline: str = dspy.OutputField() delivery: str = dspy.OutputField() joke_gen = dspy.Predict(JokeGenerator) joke_gen.set_lm(lm=dspy.LM("openai/gpt-4.1-mini", temperature=1)) result = joke_gen(query="Write a joke about AI") print(result) print_on_a_tshirt(result.punchline)