Business Context
Providing business context enables Puck AI to understand your business to build relevant pages.
Context for AI plugin
When using the AI plugin, you can provide context to all interactions by using the ai.context parameter in the puckHandler().
import { puckHandler } from "@puckeditor/cloud-client";
const handler = puckHandler({
ai: {
context: "We are Google. You create Google landing pages.",
},
});You can use this parameter to provide extensive information for your use-case:
import { puckHandler } from "@puckeditor/cloud-client";
const context = `## Overview
We are Google. You help us build Google landing pages.
## Brand guidelines
Our brand colors are:
- #4285F4 (primary)
- #DB4437
- #F4B400
- #0F9D58
## Tone of voice
- American English
- ...
`;
const handler = puckHandler({
ai: {
context,
},
});Context for one-off pages
The context parameter on generate() allows you to provide additional business information when generating one-off pages:
import { generate } from "@puckeditor/cloud-client";
await generate({
config,
context: "We are Google. You help us build Google landing pages.",
prompt: "Create a page about our maps product",
});