@hanzo/ui

Parts

import { Parts, Piece, join } from '@hanzo/ui/chat'

No examples yet.

Types

export type MessagePart =
export interface PartActions {
  /** Render prose. Absent, the words render plainly. */
  prose?: (text: string, part: MessagePart) => ReactNode
  /** Run the turn again — an `error` part's control. Absent, none renders. */
  onRetry?: () => void
  /** Open an `artifact` part. */
  onOpen?: (part: Extract<MessagePart, { type: 'artifact' }>) => void
  /** Open one of a `citation` part's sources. */
  onSource?: (source: Source) => void
}
export interface PieceProps extends PartActions {
  part: MessagePart
}
export interface PartsProps

Exports

PartsPiecejointype MessageParttype PartActionstype PartsPropstype PieceProps