Prompts
Prompt management and optimization at lytix
Lytix helps manage prompts directly in the CLI using our lytix
cli commands.
Note We currently only support Typescript/Javascript.
🚨 Prerequisite Login & setup your lytix
CLI here.
Sync your prompts (e.g. git pull
your prompts)
Now you can sync your prompts to your local machine. This is the equivalent of git pull
for your prompts.
If there are changes that are uncommited or would cause a conflict, you will be prompted to resolve them. You can pass the --force
flag to skip this check and overwrite your local changes.
Create a new prompt
Now let’s create our first prompt. All you need to get started is a prompt name.
Edit & Use The Prompt
Now let’s iterate on our prompt and start using it.
Add Variables
Lytix supports adding templated variables to your prompts. This allows you to dynamically pass in variables when you use the prompt and get type safety as lytix will generate a .ts
types file for you based on the inputs
Inside prompt.json
, the variables
field is where you can add your variables. It supports:
type
:STRING
|NUMBER
|BOOLEAN
- The type of the variablename
: The name of the variable
For example, a prompt.json
file with a toEcho
variable might look like this:
Commit Changes
Now you’re ready to commit changes (e.g. git commit && git push
).
Note This will immediately update the prompt and any incomming requests using the promptId
Pass promptId
& Use Prompt
⚠️ Important You need to use the v2
baseURL: https://api.lytix.co/proxy/v2/openai
. Please follow instructions here to setup the lytix OpenAI integration.
Now you are to use the lytixPromptId
to start using your prompt. You can now pass an empty messages
array and add the lytixPromptId
& lytixPromptVariables
to your request:
Delete a prompt
Once you are ready to delete a prompt, you can do so with the following command: