Skip to content

AI Assistant Dialog ​

The assistant dialog allows users to generate or refine content directly within the Uhuu editor, using AI-driven prompts and responses.

video

Parameters ​

The editDialog method is configured with the following options for assistant editing:

  • type Set to 'assistant' to indicate that the editor should open with assistant dialog.
  • path (string, required): Specifies the data path within the payload where the output will be stored.
  • value (recommended): The current resolved value at path. Pass it explicitly so manual edits and assistant output start from the value rendered by the template.
  • tags (array, optional): Prompt selection is filtered by tag intersection. A prompt must contain every tag supplied by the dialog.
  • prompt (string, optional): One-off instruction for this invocation. It is context only; persist reusable instructions in an assistant prompt pack instead.

In this example, "marketing_content" is the target path for AI-generated content.

Example Setup ​

Below is an example of a simple React component setup to initialize The assistant Dialog for generating marketing content.

javascript
import ReactMarkdown from "react-markdown";

export default function ({ payload }) {
  const {marketing_content} = payload;

  return (                       
    <div onClick={() => $uhuu.editDialog({
      path: 'marketing_content',
      type: 'assistant',
      value: marketing_content,
      tags: ['marketing-content'],
    })}>
      <div className="prose prose-sm">
        <ReactMarkdown children={marketing_content} />
      </div>
    </div>
  );
}

Once content is generated by the assistant, response text may be stored in the payload as follows:

json
{
  "marketing_content": "## Introducing Our Product\nLearn about the innovative features..."
}

This dialog is especially useful for content creation, marketing copy, or any document area requiring dynamic AI-generated text.

Multiple Types ​

When you have multiple dialog types available in an editable area, you can use the types parameter to pass an array of dialog type options.

video

Example: Call the editDialog method with the types parameter:

js
$uhuu.editDialog({
  types: [
    { title: "Lage", path: "listing.wp_areaenglish__c", type: 'assistant'},
    { title: "Parkieren", path: "listing.wp_parkinginternetenglish__c", type: 'assistant'},
    { title: "Ausbaustandard", path: "listing.wp_standardlevelenglish__c", type: 'assistant'},
    { title: "Besonderes", path: "listing.wp_specialsinternetenglish__c", type: 'assistant'}
  ]
})

Prompt Tags ​

The tags parameter is an array of tags to be filtered by default in the assistant dialog.

The assistant dialog will only show prompts including all tags. For example, tags: ['title', 'special'] matches a prompt tagged with both title and special, but not a prompt carrying only one of them.

Example:

javascript

export default function ({ payload }) {
  const {property_title} = payload;

  return (                       
    <div onClick={() => $uhuu.editDialog({ path: 'property_title', type: 'assistant', tags: ['title', 'special'] })}>
      <div className="prose prose-sm">
        { property_title }
      </div>
    </div>
  );
}

Prompt packs ​

Production templates keep reusable assistants and prompts in an uhuu-assistants.json file beside the template source. Use stable prompt slugs and tags that describe the destination field; do not rely on the dialog prompt option as a stored prompt definition. Validate the pack with uhuu assistants check, then deploy it with uhuu assistants push or the preflighted uhuu deploy --with-assistants workflow.

Public developer documentation for Uhuu.