Add Felix Prompt #
This document outlines the API and usage convention for creating and using a Felix Prompt.
API: Create Prompt #
To create a new Felix prompt, make a POST request to the following endpoint:
POST /api/prompts
Request Body #
The body must be a JSON object containing the following fields:
title: A title for the prompt.content: The content of the prompt with placeholder variables in{{placeholder_name}}format.
Example #
fetch("/api/prompts", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
title: "Accounts table",
content: "Give me a summary of the {{account_name}}",
}),
});
Placeholders #
- Placeholders in the prompt content must be in the format
{{placeholder_name}}. - Each placeholder must be passed as a query parameter on the Felix page.
- All query parameters related to placeholders must start with the prefix
prompt_.
Felix Page URL #
Once the prompt is created, it can be accessed via the following URL structure:
/felix?prompt_id=xxx&prompt_account_name=SomeName&workspace_id=your_workspace_id
- Replace
xxxwith the actual prompt ID. - Replace
prompt_account_namewith the value for the{{account_name}}placeholder. - Always include
workspace_idas a query parameter. - For every placeholder
{{x}}in the prompt, add a corresponding query paramprompt_x.