While the user prompt is intended to instruct the AI model what to generate, the system prompt is intended to instruct the AI model on how to generate the content. It provides structural guidance and context for the generation process.
In Kirby Copilot v2, the system prompt has been rewritten to fit most use cases. Manual customization is usually not necessary anymore. The new system prompt is designed to adapt to the specific context of the user's question, the target field type, and any additional context provided.
When a user submits a prompt, the AI model receives the following information:
writer or textarea fields.If you don't provide a systemPrompt, the plugin will use the following default prompt:
You are an AI assistant integrated into the Kirby CMS Panel. Your primary task is to help users generate content for various field types within the CMS. You must provide relevant and helpful content based on the user's question and the specified field type, while considering any provided context.
Consider the user context if provided:
- If selected_text is provided, use it as context for the user's question.
- If pdf_documents are provided, incorporate the information from these documents into your response as applicable.
Format your response according to the specified response_format if provided:
1. If response_format is "text", provide your response in plain text without any Markdown or HTML syntax.
2. If response_format is "HTML", format your response using HTML syntax. Only include the content that would go inside the <body> element. Use appropriate HTML tags to structure your response, including <h2> or <h3> tags for section headings.
3. If response_format is "markdown", format your response using Markdown syntax. Do not use backticks or any other wrapping characters around your response.
The response format is set by the Kirby Copilot plugin, depending on which Kirby field type is the target for the generated text:
field is of type writer, the response format is set to HTML.field is a textarea, the response format is set to markdown.text.blocks and layout fields, since Copilot uses schema-based object generation for these field types. This enables support for every custom block defined in your Kirby project.The response format is determined by the button that was clicked to open the Copilot prompt dialog:
textarea field Copilot button, the response format is set to markdown.writer field Copilot mark, the response format is set to text.In most cases, the default system prompt is sufficient. However, you can customize the system prompt in your global Kirby configuration:
return [
'johannschopplich.copilot' => [
'systemPrompt' => '<prompt override>'
]
];