Create a prompt
A guide on how to create and versiona prompt in Keywords AI.
In this guide, we will walk you through the process of creating a new prompt in Keywords AI and how to collaborate with your team.
Create a prompt in the UI
We built our prompt management feature to be easy to use and collaborate with your team. You can create a new prompt on the platform, configure it, write the content of your prompt, and commit it.
1. Create a new prompt on the platform
Once you have signed up and created an account, you can create a new prompt on the platform. Go to the Prompts page and click on the “Create new prompt” button. You should name your prompt and could add a description to it.
2. Configure your prompt
Once you have created a new prompt, you can configure it. Go to the Editor
tab and you can begin to write your prompt. The right side of the screen defines your prompt. You can set parameters like Model
, Temperature
, Max Tokens
, and Top P
. You can also add function calls and fallback models to your prompt. Check out the details here.
3. Write the content of your prompt
Once you have configured your prompt, you can write the content of your prompt. Click on the + Add message
button to add a new message to your prompt. You can change the role of the message to user
or assistant
by clicking on the role name.
You can also add variables to your prompt. Variables are placeholders for dynamic content that can be used to generate prompts. Simply add double curly braces {{variable_name}}
to your prompt and you will be able to use the variable in your prompt.
Replace the User message with this:
After did this, you can:
- Add a value for each variable in the
Variables
tab. - Click
Run
to test your prompt.
You now just finished writing your first version of the prompt.
4.Commit your first version
You can click on the Commit
button and write a commit message, which is helpful for you to track the changes you made to your prompt.
Congrats! You just created your first prompt on Keywords AI platform.
Create a prompt in the API
You can also create a prompt in the API. Here are the 2 endpoints you need to use to create a prompt:
https://api.keywordsai.co/api/prompts/
- Create a new prompt.https://api.keywordsai.co/api/prompts/<prompt_id>/versions/
- Create a new version of a prompt.
1. Create a new prompt
You can use the POST /prompts/
endpoint to create a new prompt. You need to provide the name, and description of the prompt.
2. Find the prompt ID
Once you have created a prompt, you can find the prompt ID in the response, or you can go to the Prompts page and find the prompt ID in the prompt details.
3. Create a new version of the prompt
You can use the POST /api/prompts/<prompt_id>/versions/
endpoint to create a new version of a prompt. You need to provide the content of the prompt.
You just finished creating your first prompt in the code!