Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Ucbepic Docetl PromptImprovementDialog

From Leeroopedia
Revision as of 17:01, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Ucbepic_Docetl_PromptImprovementDialog.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Knowledge Sources
Domains Frontend, React_UI
Last Updated 2026-02-08 00:00 GMT

Overview

Concrete tool for the AI-powered prompt improvement dialog that helps users iteratively refine operation prompts in the DocETL playground.

Description

The PromptImprovementDialog provides a multi-step workflow for improving operation prompts. Users first select a prompt type (for resolve operations: comparison or resolution prompt), then enter an analysis mode where the AI reviews current outputs, suggests improvements, and shows diffs between the original and proposed prompts. It supports multiple revision rounds with feedback connections between them, bookmarked output samples for context, and handles both simple prompts and resolve operation dual-prompt configurations. The component uses the Vercel AI SDK's useChat for streaming LLM responses.

Usage

Opened from the OperationCard's "Improve Prompt" button. Guides users through analyzing outputs and iteratively refining prompts with AI assistance.

Code Reference

Source Location

Signature

interface PromptImprovementDialogProps {
  open: boolean;
  onOpenChange: (open: boolean) => void;
  currentOperation: Operation;
  onSave: (
    newPrompt: string | { comparison_prompt: string; resolution_prompt: string },
    schemaChanges?: Array<[string, string]>
  ) => void;
}

export function PromptImprovementDialog(props: PromptImprovementDialogProps): JSX.Element

Import

import { PromptImprovementDialog } from "@/components/PromptImprovementDialog";

I/O Contract

Inputs (Props)

Name Type Required Description
open boolean Yes Whether the dialog is visible
onOpenChange (open: boolean) => void Yes Toggle dialog visibility
currentOperation Operation Yes The operation whose prompt is being improved
onSave function Yes Callback with the new prompt and optional schema changes

Outputs

Name Type Description
rendered JSX.Element Multi-step prompt improvement dialog with diff views

Usage Examples

<PromptImprovementDialog
  open={showImproveDialog}
  onOpenChange={setShowImproveDialog}
  currentOperation={selectedOperation}
  onSave={(newPrompt, schemaChanges) => {
    updateOperationPrompt(newPrompt);
    if (schemaChanges) applySchemaChanges(schemaChanges);
  }}
/>

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment