import { Divider } from "@tremor/react"; import { usePlaygroundContext } from "../context"; import { MessagePlaceholderComponent } from "./MessagePlaceholderComponent"; export const MessagePlaceholders = () => { const { messagePlaceholders } = usePlaygroundContext(); return (
{messagePlaceholders.length === 0 ? (

No message placeholders defined.

Placeholders can be used to e.g. inject message histories into prompts.

) : (
{messagePlaceholders .slice() .sort((a, b) => { if (a.isUsed && !b.isUsed) return -1; if (!a.isUsed && b.isUsed) return 1; return a.name.localeCompare(b.name); }) .map((placeholder, index) => (
{index !== messagePlaceholders.length - 1 && ( )}
))}
)}
); };