Business Context
Providing business context enables Puck AI to understand your business and build relevant pages. It applies in both assembly and design modes.
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";
export async function POST(request) {
return puckHandler(request, {
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
- ...
`;
export async function POST(request) {
return puckHandler(request, {
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",
});