Configuration

Section Options

Define the blueprint properties for the Kirby Copilot section, like the user prompt.

Properties

When the required global configuration is set up, you can define the blueprint properties for the Kirby Copilot section.

label String

The label property defines the label of the section.

The default value is Copilot.

If you want to change the label, you can do so by setting the label property:

sections/copilot.yml
type: copilot
label: My Copilot

field String

Use the field property to tell the Kirby Copilot plugin which field to use for adding generated content.

It has no default value and is required.

sections/copilot.yml
type: copilot
field: blocks
The following Kirby field types are supported: blocks, writer, textarea and text. More field types will be supported in the future.

userPrompt String

If you want to provide a user or editor with a user prompt, you can define it with the userPrompt property. The Panel user will be able to edit the prompt and revert back to the original prompt when changes have been made. In the latter case, an undo button will be shown.

sections/copilot.yml
type: copilot
field: blocks
userPrompt: Write a short story about the future of the world.
Kirby Copilot section preview

Changes to the prompt are stored to the local storage of the user's browser.

By default, the user prompt is empty.

Check out the editable property to disable the editing of the user prompt.

Kirby Query Language
You can use a query to set the user prompt dynamically. Useful in conjunction with non-editable prompts.

sections/copilot.yml
type: copilot
field: blocks
userPrompt: "{{ page.myPrompt.value }}"

systemPrompt String

If you want to define a system prompt, you can do so with the systemPrompt property. The Panel user will not be able to edit or see the prompt. It is only needed to instruct the AI how to structure the generated text.

The value will be inherited from the global systemPrompt configuration if not defined in the section blueprint.

Learn more about the system prompt in the global configuration property description.
Kirby queries are supported just as in the userPrompt property.

storage Boolean

If the user prompt is editable (being either predefined or empty), the prompt will be stored in the local storage of the user's browser. This is done to prevent the user from losing the prompt when navigating away from the page.

The default value is true.

To disable the storage of the user prompt, set the storage property to false:

sections/copilot.yml
type: copilot
field: blocks
storage: false

editable Boolean

By default, the user prompt is editable. This makes most sense of no user prompt has been defined in the blueprint options.

If a custom userPrompt has been set and you want to disable the editing of the prompt, you can do so by setting the editable property to false:

sections/copilot.yml
type: copilot
field: blocks
userPrompt: Write a short story about the evolution of the universe. Segment the text and use headings (H2).
editable: false
Kirby Copilot section preview

files Boolean | String

Learn more about working with files on the dedicated Files as Context page.

Context is key to a good user prompt. That's why the Panel user can add files to a given prompt.

The default value is true.

If you want to disable the files select button and thus prevent the user from adding files to the prompt, you can do so by setting the files property to false:

sections/copilot.yml
type: copilot
field: blocks
files: false

On a Kirby file page, you can set the value to auto to pre-select the current file as context for the user prompt. This is useful if you want to generate text for a specific file, such as an image or PDF, that has already been uploaded to the Panel:

sections/copilot.yml
type: copilot
field: alt
# Use the uploaded file as context
files: auto
# Optional: Provide a pre-defined user prompt
userPrompt: Summarize the provided image in maximum 10 words.
# Optional: Disable the editing of the user prompt
editable: false

The section above will use the current file of a Kirby file model as context for the user prompt:

size String

Determines how the section buttons (Generate, Undo, Redo) are displayed. By default, the buttons are displayed in sm (small) size.

If the buttons should occupy the same height as text/input fields, you can set the size property to md (medium):

sections/copilot.yml
type: copilot
field: blocks
size: md