Skip to main content

Create a prompt

Navigate to the Prompts section in the left-hand sidebar or from the application homepage.

Choose a handle

The first time you enter the prompts section or the LangChain Hub, you'll be prompted to choose a handle. This handle will be used to identify your public prompts in the hub.

Name your new prompt

After clicking "New prompt", name your prompt and decide if you want it to be "private" or "public". Private prompts are only visible to your organization, while public prompts are discoverable to anyone in the LangChain hub. The rest of the fields are optional. Click save to create your prompt.

Pick a prompt type

You can choose between a regular prompt, a chat prompt, and a structured prompt. Standard prompts are for instruct-style models (text), while chat prompts are for chat-style models (list of messages). Structured prompts are chat-style prompts coupled with output schemas.

Compose your prompt

After choosing a prompt type, we're brought to the playground where we can develop our prompt. (We picked Chat Prompt.) On the left, we see an editable view of our Chat Prompt. To the right, we can enter sample inputs for our prompt variables and then run our prompt against a model.

(If you haven't yet, you'll need to enter an API key for whichever model you want to run your prompt with.)

To see the response from the model, click "Start".

Save your prompt

Once you're happy with your prompt, you can save it by clicking the "Commit" button and selecting the prompt name you created before. You can also create a new prompt from here by typing a new prompt name in the search bar.

View your prompts

You've just created your first prompt. View a table of your prompts in the prompts tab.

Was this page helpful?

You can leave detailed feedback on GitHub.