Before you can customize, you'll need to get the template in an editable format.
In the Page Editor, click the three dot menu next to the activated template. In the menu, select Make a Copy
You might be asked to create an alias if this is your first time copying a mod.
Optional: You can change the Mod ID, Name, and Description fields in the modal that appears
A system prompt is predefined instructions for an LLM that explain what it needs to do with queries from users. In the mod template, AI Copilot has a very basic system prompt.
You can see the system prompt set in the Create ChatGPT Payload brick on line 23. (You'll find this brick in the 2. Handle pbwelcome_copilot:ask-answer mod component.
The mod currently accepts an individual's system prompt, but you can set a default system prompt for each mod user, by replacing the You are a helpful AI chatbot text on line 23.
Depending on how you might use your copilot, you can customize the system prompt to be more specific and give it more context and instructions for the task the LLM will complete.
For example, if you want to use an AI Copilot for categorizing text, you might adjust your system prompt to explain that it will receive text and needs to categorize it. You could provide the categories and a few examples of sample text and how it should be categorized.
Testing your prompts and ensuring they produce the desired output is always a good practice. If you get unexpected results, you may want to adjust your system prompt further.
In this mod template, we use ChatGPT/OpenAI, but there are other LLMs that you might want to use.
In this case, we recommend using our HTTP Request brick and reviewing documentation for your favorite LLM's API. To do this, remove the [Experimental] Streaming HTTP Request brick and click the + button. Search for the HTTP Request brick, then fill it out accordingly.
To test it out, click the Render Panel button in the top right corner of the Page Editor.
Check the output to confirm that you've received your expected response. If not, you may need to tweak the HTTP request.
If you need transform your response to another format, you can use the Javascript brick to filter and map the data.
The last step is save your mod. PixieBrix will keep unsaved changes in the Page Editor, but for the changes to take affect when using the mod, you'll need to save. Click the save icon next to your mod to save the changes.