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. 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' })}>
      <div className="prose prose-sm">
        <ReactMarkdown children={marketing_content} />
      </div>
    </div>
  );
}

Example Response

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.