Joke Generator
Learn how to build a prompt that thinks like a human and generates jokes.
Overview
Have you ever tried to ask an LLM for a joke, and they either always tell the same one or give you a response that doesn’t make any sense?
In this example, we will use the Agent’s capability to think like a human using Chain Of Thought reasoning to generate a joke. The Agent will first think about the joke, then tell it to you.
Prompt
Step-by-step guide
Related documentation:
Agent configuration
To build an autonomous Chain Of Thought reasoning structure, we want the AI to think as many times as they want to, and finally return a final answer. To do so, we just need to enable the agentic mode by setting the type
to agent
in the prompt configuration.
Read about Agentic behaviour for more information.
Prompt
Now, let’s first define the prompt. We want to add a simple description of the task, and an input topic given by the user.
Improvin the chain of thought process
Finally, we’ll add a few instructions to help the agent think.
In this case, I will make the AI think it is made of a team of agents, even though it is just a single prompt. This works because each step the AI will generate a new message based on the whole previous conversation. While they normally expect that all assistant
messages are from the same agent, we can just tell them that they’re collaborating with more AI assistants and make them rate each other’s jokes.
And just for giving the AI a little push, we can fake the first message of this conversation, so it can start thinking right away.