@promptbook/anthropic-claude
Version:
Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action
108 lines (107 loc) • 3.81 kB
TypeScript
/// <reference types="react" />
import type { id } from '../../../types/string_token';
import type { ChatMessage } from '../types/ChatMessage';
import type { ChatParticipant } from '../types/ChatParticipant';
import type { ParsedCitation } from '../utils/parseCitationsFromContent';
import type { ChatProps } from './ChatProps';
/**
* Props for the `ChatMessageItem` component
*
* @private props for internal subcomponent
*/
type ChatMessageItemProps = Pick<ChatProps, 'onMessage' | 'onActionButton' | 'onQuickMessageButton' | 'participants'> & {
message: ChatMessage;
participant: ChatParticipant | undefined;
isLastMessage: boolean;
setExpandedMessageId: (value: id | null) => void;
isExpanded: boolean;
currentRating: number;
handleRating: (message: ChatMessage, rating: number) => void;
mode: 'LIGHT' | 'DARK';
/**
* Enables the copy button for this message bubble.
*/
isCopyButtonEnabled?: boolean;
/**
* Enables the feedback (rating) UI for this message bubble.
*/
isFeedbackEnabled?: boolean;
/**
* Chooses which feedback controls should be rendered.
*/
feedbackMode?: ChatProps['feedbackMode'];
/**
* Optional localized labels used by feedback controls.
*/
feedbackTranslations?: ChatProps['feedbackTranslations'];
/**
* Optional localized labels used by timestamp metadata.
*/
timingTranslations?: ChatProps['timingTranslations'];
/**
* Optional moment locale used to format message timestamps.
*/
chatLocale?: ChatProps['chatLocale'];
/**
* Called when the copy button is pressed.
*/
onCopy?: () => void;
/**
* Called when the create agent button is pressed for book code blocks.
*/
onCreateAgent?: (bookContent: string) => void;
/**
* Optional mapping of technical tool names to human-readable titles.
* e.g., { "web_search": "Searching the web..." }
*/
toolTitles?: Record<string, string>;
/**
* Optional metadata about teammates for team tool calls
* Maps tool name to agent information
*/
teammates?: ChatProps['teammates'];
/**
* Called when the user chooses to reply to this message.
*/
onReplyToMessage?: ChatProps['onReplyToMessage'];
/**
* Determines whether this message can be replied to.
*/
canReplyToMessage?: ChatProps['canReplyToMessage'];
/**
* Optional cached metadata keyed by TEAM tool names to enrich tool call chips.
*/
teamAgentProfiles?: ChatProps['teamAgentProfiles'];
/**
* Controls whether assistant replies render as bubbles or article blocks.
*/
visualMode?: ChatProps['visualMode'];
/**
* Called when a tool call chiplet is clicked.
*/
onToolCallClick?: (toolCall: NonNullable<ChatMessage['toolCalls']>[number]) => void;
/**
* Called when a source citation chip is clicked.
*/
onCitationClick?: (citation: ParsedCitation) => void;
/**
* Optional sound system for triggering tool chip events.
*/
soundSystem?: ChatProps['soundSystem'];
/**
* Controls whether the play button below the message is shown.
*/
isSpeechPlaybackEnabled?: ChatProps['isSpeechPlaybackEnabled'];
readonly elevenLabsVoiceId?: ChatProps['elevenLabsVoiceId'];
/**
* Optional localized labels for Chat UI elements such as lifecycle badges.
*/
chatUiTranslations?: ChatProps['chatUiTranslations'];
};
/**
* Renders a single chat message item with avatar, content, buttons, and rating.
*
* @private internal subcomponent of `<Chat>` component
*/
export declare const ChatMessageItem: import("react").MemoExoticComponent<(props: ChatMessageItemProps) => import("react/jsx-runtime").JSX.Element>;
export {};