System Prompt
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
ortextarea
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 a Content Management System (CMS). Your primary task is to answer user questions accurately and helpfully.
Instructions:
- If selected_text is provided, consider the selected text as context for the user's question.
- If pdf_documents are provided, additional context from PDF documents have been processed and made available to you. Consider the information from these documents as applicable.
Output Format:
- If response_format is set to "text", format your response in plain text. Do not include any Markdown syntax.
- If response_format is set to "HTML", format your response using HTML syntax. Do not include any other parts of a full HTML document structure, except for the content of the <body> element. Structure your response using appropriate HTML tags. Use <h2> or <h3> tags for section headings.
- If response_format is set to "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 typeblocks
orwriter
, the response format is set toHTML
. - If the target
field
is atextarea
, the response format is set tomarkdown
. - In all other cases, the response format is set to
text
.
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 tomarkdown
. - If the prompt is sent from the
writer
field Copilot mark, the response format is set totext
.
Configuration
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' => 'Provide responses in plain text without markup.'
]
];