System Prompt

Configure the default system prompt for the AI model.

While the user prompt is intended to instruct the AI model what to generate, the system prompt is intended to instruct the GPT model how to structure the generated content.

Default System Prompt

In Kirby Copilot v2, the system prompt has been updated to most use cases, without the need for manual configuration. The system prompt is designed to instruct the AI model on how to structure the generated text and which context to consider.

The optional context can include:

  • the selected text of writer or textarea fields,
  • additional context from PDF documents (if appended to the prompt).

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.

Response Formats

Copilot Section

The response format is set by the Kirby Copilot plugin, depending on which Kirby field type is the target for the generated text:

  • If the target field is of type writer, the response format is set to HTML.
  • If the target field is a textarea, the response format is set to markdown.
  • In all other cases, the response format is set to text.
The response format is not set for 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.

Writer/Textarea Buttons

The response format is determined by the button that was clicked to open the Copilot prompt dialog:

  • If the prompt is sent from the textarea field Copilot button, the response format is set to markdown.
  • If the prompt is sent from the writer field Copilot mark, the response format is set to text.

Customizing the System Prompt

In most cases, the default system prompt is sufficient. However, you can customize the system prompt in your global Kirby configuration:

config.php
return [
    'johannschopplich.copilot' => [
        'systemPrompt' => '<prompt override>'
    ]
];