/** * This package provides React components for GoodData's GenAI features. * @packageDocumentation * @beta */ import { ActionCreatorWithoutPayload } from '@reduxjs/toolkit'; import { ActionCreatorWithPayload } from '@reduxjs/toolkit'; import { CatalogItem } from '@gooddata/sdk-model'; import { ComponentType } from 'react'; import { DashboardSelectorEvaluator } from '@gooddata/sdk-ui-dashboard'; import { EnhancedStore } from '@reduxjs/toolkit'; import { GenAIChatEffort } from '@gooddata/sdk-model'; import type { GenAIChatInteractionUserFeedback } from '@gooddata/sdk-model'; import type { GenAIChatRoutingUseCase } from '@gooddata/sdk-model'; import { GenAIObjectType } from '@gooddata/sdk-model'; import { IAnalyticalBackend } from '@gooddata/sdk-backend-spi'; import { IChatConversation } from '@gooddata/sdk-backend-spi'; import { IChatConversationContent } from '@gooddata/sdk-backend-spi'; import { IChatConversationError } from '@gooddata/sdk-backend-spi'; import { IChatConversationItem } from '@gooddata/sdk-backend-spi'; import { IChatConversationMultipartPart } from '@gooddata/sdk-backend-spi'; import { IChatConversationVisualisationContent } from '@gooddata/sdk-backend-spi'; import { IChatSuggestion } from '@gooddata/sdk-backend-spi'; import { IChatSuggestions } from '@gooddata/sdk-backend-spi'; import { IColorPalette } from '@gooddata/sdk-model'; import { IDashboard } from '@gooddata/sdk-model'; import type { IGenAIChangeAnalysisParams } from '@gooddata/sdk-model'; import { IGenAIUserContext } from '@gooddata/sdk-model'; import type { IGenAIVisualization } from '@gooddata/sdk-model'; import { IInsight } from '@gooddata/sdk-model'; import { IListedDashboard } from '@gooddata/sdk-model'; import type { ISemanticSearchRelationship } from '@gooddata/sdk-model'; import type { ISemanticSearchResultItem } from '@gooddata/sdk-model'; import { ISlotProps } from '@gooddata/sdk-ui-kit'; import { IUiButtonProps } from '@gooddata/sdk-ui-kit'; import { IUiMenuGroupItemProps } from '@gooddata/sdk-ui-kit'; import { IUiMenuInteractiveItemProps } from '@gooddata/sdk-ui-kit'; import { IUiMenuInteractiveItemWrapperProps } from '@gooddata/sdk-ui-kit'; import { IUiMenuItem } from '@gooddata/sdk-ui-kit'; import { IUserWorkspaceSettings } from '@gooddata/sdk-backend-spi'; import { JSX } from 'react/jsx-runtime'; import { ReactNode } from 'react'; import { SdkErrorType } from '@gooddata/sdk-ui'; import { Store } from '@reduxjs/toolkit'; /** * @public */ export declare type AssistantMessage = BaseMessage & { role: "assistant"; feedback: GenAIChatInteractionUserFeedback; feedbackError?: string; }; /** * A common event definition for the Chat component. * @public */ export declare type BaseEvent = { threadId?: string; }; /** * @public */ export declare type BaseMessage = { /** * Server-side ID for the message. */ id?: string; /** * Local ID for the message. We need the id right away for optimistic rendering. */ localId: string; /** * A timestamp of the message creation. */ created: number; /** * Specifies if the message processing was cancelled. */ cancelled: boolean; /** * Specifies if the message processing is complete. */ complete: boolean; /** * The contents of the message. */ content: Contents[]; }; /** * @public */ export declare type ChangeAnalysisContents = { type: "changeAnalysis"; params: IGenAIChangeAnalysisParams; }; /** * A chat agent changed * @public */ export declare type ChatAgentChangeEvent = BaseEvent & { type: "onSelectedAgentAction"; previousAgentId?: string; agentId?: string; }; /** * A chat assistant message event. * @public */ export declare type ChatAssistantMessageEvent = BaseEvent & { type: "chatAssistantMessage"; interactionId?: string; useCase: string; }; /** * A chat window closed event. * @public */ export declare type ChatClosedEvent = BaseEvent & { type: "chatClosed"; }; /** * A chat context change event. * @public */ export declare type ChatContextChangeEvent = BaseEvent & { type: "onContextChange"; contextType: "ambient" | "user"; userContext?: IGenAIUserContext; replaceUserContext?: boolean; }; /** * A chat copy to clipboard event. * @public */ export declare type ChatConversationChangedEvent = BaseEvent & { type: "chatConversationChanged"; conversation: IChatConversationLocal; }; /** * A chat conversation deleted error event. * @public */ export declare type ChatConversationDeletedErrorEvent = BaseEvent & { type: "chatConversationDeletedError"; conversation: IChatConversation; error: Error; }; /** * A chat conversation deleted success event. * @public */ export declare type ChatConversationDeletedSuccessEvent = BaseEvent & { type: "chatConversationDeletedSuccess"; conversation: IChatConversation; }; /** * A chat conversation deleted event. * @public */ export declare type ChatConversationDeleteEvent = BaseEvent & { type: "chatConversationDelete"; conversation: IChatConversation; }; /** * A chat conversation pinned state change error event. * @public */ export declare type ChatConversationPinErrorEvent = BaseEvent & { type: "chatConversationPinError"; conversation: IChatConversationLocal; error: Error; }; /** * A chat conversation pinned state change event. * @public */ export declare type ChatConversationPinnedEvent = BaseEvent & { type: "chatConversationPinned"; conversation: IChatConversationLocal; pinned: boolean; }; /** * A chat conversation renamed error event. * @public */ export declare type ChatConversationRenamedErrorEvent = BaseEvent & { type: "chatConversationRenamedError"; conversation: IChatConversationLocal; title: string; error: Error; }; /** * A chat conversation renamed success event. * @public */ export declare type ChatConversationRenamedSuccessEvent = BaseEvent & { type: "chatConversationRenamedSuccess"; conversation: IChatConversationLocal; title: string; }; /** * A chat conversation rename event. * @public */ export declare type ChatConversationRenameEvent = BaseEvent & { type: "chatConversationRename"; conversation: IChatConversationLocal; title: string; }; /** * A chat copy to clipboard event. * @public */ export declare type ChatCopyToClipboardEvent = BaseEvent & { type: "chatCopyToClipboard"; content: string; }; /** * A chat definition received event. * @public */ export declare type ChatDefinitionReceivedEvent = BaseEvent & { type: "onDefinitionReceived"; definitionType: "dashboard" | "visualization"; itemId: string; conversationId: string; interactionId?: string; dashboard?: IDashboard; insights?: IInsight[]; visualization?: NonNullable; }; /** * A union type for all chat events. * @public */ export declare type ChatEvent = ChatOpenedEvent | ChatClosedEvent | ChatResetEvent | ChatModeChangeEvent | ChatConversationPinnedEvent | ChatConversationPinErrorEvent | ChatConversationDeleteEvent | ChatConversationDeletedSuccessEvent | ChatConversationDeletedErrorEvent | ChatConversationRenameEvent | ChatConversationRenamedSuccessEvent | ChatConversationRenamedErrorEvent | ChatUserMessageEvent | ChatAgentChangeEvent | ChatAssistantMessageEvent | ChatFeedbackEvent | ChatFeedbackErrorEvent | ChatContextChangeEvent | ChatCopyToClipboardEvent | ChatVisualizationErrorEvent | ChatSaveVisualizationErrorEvent | ChatSaveVisualizationSuccessEvent | ChatConversationChangedEvent | ChatDefinitionReceivedEvent; /** * An event handler for the Chat component. * @public */ export declare type ChatEventHandler = { /** * A guard for a specific event type. */ eval: (event: ChatEvent) => event is TEvent; /** * Event handler. */ handler: (event: TEvent) => void; }; /** * A chat feedback error event. * @public */ export declare type ChatFeedbackErrorEvent = BaseEvent & { type: "chatFeedbackError"; interactionId?: string; errorMessage: string; }; /** * A chat feedback event. * @public */ export declare type ChatFeedbackEvent = BaseEvent & { type: "chatFeedback"; interactionId?: string; feedback: "POSITIVE" | "NEGATIVE" | "NONE"; userTextFeedback?: string; }; /** * A chat mode changed * @public */ export declare type ChatModeChangeEvent = BaseEvent & { type: "onModeChange"; mode: GenAIAssistantMode; }; /** * A chat window opened event. * @public */ export declare type ChatOpenedEvent = BaseEvent & { type: "chatOpened"; }; /** * A chat conversation clearing event. * @public */ export declare type ChatResetEvent = BaseEvent & { type: "chatReset"; }; /** * A chat save visualization error event. * @public */ export declare type ChatSaveVisualizationErrorEvent = BaseEvent & { type: "chatSaveVisualizationError"; errorType: string; errorMessage?: string; }; /** * A chat save visualization success event. * @public */ export declare type ChatSaveVisualizationSuccessEvent = BaseEvent & { type: "chatSaveVisualizationSuccess"; savedVisualizationId: string; }; /** * A chat user message event. * @public */ export declare type ChatUserMessageEvent = BaseEvent & { type: "chatUserMessage"; question: string; objects: TextContentObject[]; }; /** * A chat visualization error event. * @public */ export declare type ChatVisualizationErrorEvent = BaseEvent & { type: "chatVisualizationError"; errorType: SdkErrorType; errorMessage?: string; }; /** * @public */ export declare const /** * @public */ clearThreadAction: ActionCreatorWithoutPayload<"messages/clearThreadAction">; /** * @public */ export declare type Contents = TextContents | RoutingContents | ReasoningContents | SearchContents | SemanticSearchContents | VisualizationContents | ChangeAnalysisContents | ErrorContents; /** * Default implementation of the AgentChooser slot. * * @alpha */ export declare function DefaultAgentChooser(props: IGenAIAssistantAgentChooserProps): JSX.Element; /** * Default implementation of the AgentItem slot. * * @alpha */ export declare function DefaultAgentItem(props: IGenAIAssistantAgentItemProps): JSX.Element; /** * Default implementation of the AssistantMessage slot. * * @alpha */ export declare function DefaultAssistantMessage(props: IGenAIAssistantAssistantMessageProps): JSX.Element; /** * Default implementation of the ConversationDateGrouping slot. * * @alpha */ export declare function DefaultConversationDateGrouping(props: IGenAIAssistantConversationDateGroupingProps): JSX.Element; /** * Default implementation of the ConversationDrawerHeader slot. * * @alpha */ export declare function DefaultConversationDrawerHeader(props: IGenAIAssistantConversationDrawerHeaderProps): JSX.Element; /** * Default implementation of the ConversationFooter slot. * * @alpha */ export declare function DefaultConversationFooter(_: IGenAIAssistantConversationFooterProps): null; /** * Default implementation of the ConversationHeader slot. * * @alpha */ export declare function DefaultConversationHeader(_: IGenAIAssistantConversationHeaderProps): null; /** * Default implementation of the ConversationItem slot. * * @alpha */ export declare function DefaultConversationItem(props: IGenAIAssistantConversationItemProps): JSX.Element; /** * Default implementation of the Disclaimer slot. * * @alpha */ export declare function DefaultDisclaimer(_props: IGenAIAssistantDisclaimerProps): JSX.Element; /** * Default implementation of the Feedback slot. * * @alpha */ export declare function DefaultFeedback(props: IGenAIAssistantFeedbackProps): JSX.Element; /** * Default implementation of the FollowUpButtons slot. * * @alpha */ export declare function DefaultFollowUpButtons(props: IGenAIAssistantFollowUpButtonsProps): JSX.Element; /** * Default implementation of the FollowUpQuestion slot. * * @alpha */ export declare function DefaultFollowUpQuestion(props: IGenAIAssistantFollowUpQuestionProps): JSX.Element; /** * Default implementation of the LandingContainer slot. * * @alpha */ export declare function DefaultLandingContainer({ children, isBigScreen, isSmallScreen, isFullscreen, }: ILandingContentProps): JSX.Element; /** * Default implementation of the LandingQuestion slot. * * @alpha */ export declare function DefaultLandingQuestion({ icon, question, answer, title }: ILandingQuestionProps): JSX.Element; /** * Default implementation of the LandingQuestions slot. * * @alpha */ export declare function DefaultLandingQuestions({ children, isFullscreen, isBigScreen, isSmallScreen, }: ILandingContentProps): JSX.Element; /** * Default implementation of the LandingScreen slot. * * @alpha */ export declare function DefaultLandingScreen({ LandingScreen, isBigScreen, isSmallScreen, isFullscreen, }: LandingScreenProps): JSX.Element; /** * Default implementation of the LandingTitle slot. * * @alpha */ export declare function DefaultLandingTitle({ children }: ILandingTitleProps): JSX.Element; /** * Default implementation of the LandingTitleAscent slot. * * @alpha */ export declare function DefaultLandingTitleAscent({ children }: ILandingTitleProps): JSX.Element; /** * Default implementation of the MessageErrorContent slot. * * @alpha */ export declare function DefaultMessageErrorContent(props: IGenAIAssistantMessageErrorContentProps): JSX.Element; /** * Default implementation of the MessageMultipartContent slot. * * @alpha */ export declare function DefaultMessageMultipartContent(props: IGenAIAssistantMessageMultipartContentProps): JSX.Element; /** * Default implementation of the MessageReasoningContent slot. * * @alpha */ export declare function DefaultMessageReasoningContent(props: IGenAIAssistantMessageReasoningContentProps): JSX.Element; /** * Default implementation of the MessageTextContent slot. * * @alpha */ export declare function DefaultMessageTextContent(props: IGenAIAssistantMessageTextContentProps): JSX.Element; /** * Default implementation of the UserMessage slot. * * @alpha */ export declare function DefaultUserMessage(props: IGenAIAssistantUserMessageProps): JSX.Element; /** * @public */ export declare type ErrorContents = { type: "error"; text: string; }; /** * @public * Describes an AI assistant agent. */ export declare type GenAIAgent = { /** * Unique identifier of the agent. */ id: string; /** * Title of the agent. */ title: string; /** * Description of the agent. */ description?: string; /** * The date and time when the agent was last modified. */ modifiedAt?: string; /** * The date and time when the agent was last used. */ lastUsedAt?: string; }; /** * UI component that renders the Gen AI assistant. * @public */ export declare function GenAIAssistant(props: GenAIAssistantProps): JSX.Element; /** * Display mode of the Gen AI assistant. * @public */ export declare type GenAIAssistantDisplayMode = "inline" | "modal"; /** * Mode of the Gen AI assistant. * @public */ export declare type GenAIAssistantMode = "docked" | "fullscreen"; /** * Properties for the GenAIAssistant component. * @public */ export declare type GenAIAssistantProps = Omit & { /** * The locale to use for the chat UI. */ locale?: string; /** * When provided, references to the metadata objects will be rendered as clickable links. * Otherwise, the metadata objects will be rendered as plain text (using object title). */ onLinkClick?: (linkClickEvent: LinkHandlerEvent) => string | undefined; /** * When true, allows the chat to render links that open in a new tab or window. This * is handy only when embedding the chat in same environment where GD platform is running because * chat always create full URLs to the links. */ allowNativeLinks?: boolean; /** * This will disable manage permissions for the user even if the user has them defined. */ disableManage?: boolean; /** * This will disable analyze permissions for the user even if the user has them defined. */ disableAnalyze?: boolean; /** * This will disable full control permissions for the user even if the user has them defined. */ disableFullControl?: boolean; /** * Selector that is used to automatically build ambient context for the chat. * If its provided, the chat will automatically load the dashboards and related data * from it. */ dashboardSelector?: DashboardSelectorEvaluator; /** * Customizations for the Gen AI assistant. */ slots?: IGenAIAssistantSlots; /** * Additional class name applied to the root element. */ className?: string; /** * Display mode of the assistant. Adapts the internal layout to a narrow or to a wide container; * the assistant always fills its parent element, so this does not resize it. * On small screens the fullscreen layout is always used. */ mode?: GenAIAssistantMode; /** * Called when the display mode changes on its own, e.g. after `setFullscreenAction` is dispatched, * so that the embedding application can keep its own chrome in sync. */ onModeChange?: (mode: GenAIAssistantMode) => void; }; /** * UI component that renders the Gen AI chat. * @deprecated This is an old name. Use {@link GenAIAssistant} instead. * @public */ export declare const GenAIChat: typeof GenAIAssistant; /** * Properties for the GenAIChat component. * @deprecated This is an old name. Use {@link GenAIAssistantProps} instead. * @public */ export declare type GenAIChatProps = GenAIAssistantProps; /** * UI component that renders the Gen AI assistant. * @public */ export declare function GenAIConversations(props: GenAIConversationsProps): JSX.Element; /** * Properties for the GenAIConversations component. * @public */ export declare type GenAIConversationsProps = Omit & { /** * The locale to use for the chat UI. */ locale?: string; /** * When provided, the function will be called when a conversation is selected. * The function will be called with the selected conversation. */ onConversationSelect?: (conversation: IChatConversationLocal) => void; /** * Additional class name applied to the root element. */ className?: string; /** * Customizations for the Gen AI assistant. */ slots?: IGenAIAssistantSlots; }; /** * The Interaction Intelligence panel: a single timeline of the processing steps behind one * assistant response, with a list view and a per-category detail view. Loads its own data on * mount and owns which view/category is currently shown. * @public */ export declare function GenAiInteractionIntelligence({ responseId, onClose, initialMode, initialCategory, }: IGenAiInteractionIntelligenceProps): JSX.Element | null; /** * Provides the Gen AI store to the application. * @public */ export declare function GenAiStore(props: GenAiStoreProps): JSX.Element | null; /** * Props for the GenAiStore component. * @public */ export declare type GenAiStoreProps = { /** * Store to use for the GenAiStore component. */ providedStore?: Promise; /** * Analytical backend to use for server communication. */ backend?: IAnalyticalBackend; /** * The workspace ID the user is working with. */ workspace?: string; /** * Catalog items for autocomplete. */ catalogItems?: CatalogItem[]; /** * Dashboards offered by the context chooser. When provided, the list is taken as complete and * no dashboards are loaded from the backend. */ dashboards?: IListedDashboard[]; /** * Visualizations offered by the context chooser. When provided, the list is taken as complete * and no visualizations are loaded from the backend. */ visualizations?: IInsight[]; /** * User settings to use for the chat UI. */ settings?: IUserWorkspaceSettings; /** * Callback to handle link clicks. */ onLinkClick?: (linkClickEvent: LinkHandlerEvent) => string | undefined; /** * Whether to allow native links to be opened in a new tab. */ allowNativeLinks?: boolean; /** * Event handlers to subscribe to chat events. */ eventHandlers?: ChatEventHandler[]; /** * A list of object types to search for. */ objectTypes?: GenAIObjectType[]; /** * Only objects with these tags will be included */ includeTags?: string[]; /** * Objects with these tags will be excluded */ excludeTags?: string[]; /** * Color palette to use for the chat UI. */ colorPalette?: IColorPalette; /** * Mode of the assistant. Adapts the internal layout to a narrow or to a wide container; * the assistant always fills its parent element, so this does not resize it. * On small screens the fullscreen layout is always used. */ mode?: GenAIAssistantMode; /** * Display mode of the Gen AI assistant. */ displayMode?: GenAIAssistantDisplayMode; /** * When provided, the function will be called with the store dispatch function * after the store has been initialized. */ onDispatcher?: (dispatch: EnhancedStore["dispatch"]) => void; /** * Render function or component to be wrapped with the Gen AI store. */ children: ReactNode | ((genAIStore: EnhancedStore) => ReactNode); /** * When `true`, the assistant operates against the caller's preview agent * for this workspace (backend agent id: `{userId}-{workspaceId}-preview`). * New conversations are created as preview conversations and the * conversation list is filtered to preview conversations only. * * The preview agent must already exist and be enabled; otherwise * conversation creation will fail. * * Note: toggling this prop rebuilds the chat state from scratch. * * @internal */ isPreview?: boolean; /** * Enables the Interaction Intelligence panel on assistant messages. Agent builder * passes `true`; regular assistants leave this off. Also requires * `settings.enableGenAiInteractionIntelligence` to be enabled — both must be true for the * panel to be usable. * * @internal */ allowInteractionIntelligence?: boolean; }; /** * Chat conversation error content * @public */ export declare type IChatConversationErrorContent = { type: "error"; message: string; code?: number; reason?: IChatConversationError["reason"]; traceId?: string; }; /** * Represents a local chat conversation that extends the base `IChatConversation` type. * Includes additional optional properties specific to the local context. * @public */ export declare type IChatConversationLocal = IChatConversation & { localId: string; generatingTitle?: boolean; inProgress?: boolean; }; /** * Chat local conversation content * @public */ export declare type IChatConversationLocalContent = IChatConversationContent & { objects?: TextContentObject[]; parts?: IChatConversationMultipartPart[]; }; /** * Chat conversation item with local ID. * @public */ export declare type IChatConversationLocalItem = Omit & { cancelled?: boolean; complete?: boolean; streaming?: boolean; filled?: boolean; localId: string; content: IChatConversationLocalContent | IChatConversationErrorContent | IChatConversationSystemContent; }; /** * Chat local conversation multipart local part * @public */ export declare type IChatConversationMultipartLocalPart = IChatConversationMultipartPart & { reporting?: boolean; saving?: { started: boolean; completed: boolean; }; error?: { name: string; message: string; }; objects?: TextContentObject[]; suggestions?: IChatSuggestions; }; /** * Local-only content type for system-role items (e.g. agent-switch events). * Meaningful data lives in top-level item fields; content is structurally required but unused. * @public */ export declare type IChatConversationSystemContent = { type: "system"; }; /** * @public */ export declare interface IChatMessagesGroup { type: "reasoning" | "user" | "assistant" | "error" | "system"; messages: IChatConversationLocalItem[]; } /** * Properties for the AgentChooser slot. * @alpha */ export declare type IGenAIAssistantAgentChooserProps = { /** * The available agents to choose from. */ agents: GenAIAgent[]; /** * The conversations in the chat history. */ conversations?: IChatConversationLocal[]; /** * The agent id associated with the current conversation. */ conversationAgentId?: string; /** * The currently selected agent id. */ selectedAgentId?: string; /** * The effective selected agent id, taking into account the current conversation and available agents. */ effectiveSelectedAgentId?: string; /** * Callback when an agent is selected. */ onSelectAgent: (agentId: string | undefined, options?: { showChangeEvent?: boolean; }) => void; /** * The currently selected reasoning effort. */ selectedEffort?: GenAIChatEffort; /** * Callback when a reasoning effort is selected. */ onSelectEffort?: (effort: GenAIChatEffort) => void; /** * Whether the agent chooser is disabled. */ isDisabled?: boolean; /** * Whether the agent chooser is loading. */ isLoading?: boolean; }; /** * Properties for the AgentItem slot. * @public */ export declare type IGenAIAssistantAgentItemProps = { /** * The agent to render. */ agent: GenAIAgent; /** * Whether the agent is currently selected. */ isSelected: boolean; /** * Props to pass to the underlying UiMenuInteractiveItemWrapper. */ menuItemProps?: IUiMenuInteractiveItemWrapperProps; /** * The content to render inside the item. */ Content?: ComponentType; }; /** * Properties for the AssistantMessage slot. * @alpha */ export declare type IGenAIAssistantAssistantMessageProps = { /** * The message to render. */ message: IChatConversationLocalItem; /** * The groups of messages in the conversation. */ groups: IChatMessagesGroup[]; /** * Whether the message is the last one in the conversation. */ isLast?: boolean; }; /** * Properties for the ConversationDateGrouping slot. * @alpha */ export declare type IGenAIAssistantConversationDateGroupingProps = { /** * Props to pass to the underlying UiMenuGroupItem component. */ menuGroupItemProps: IUiMenuGroupItemProps; }; /** * Properties for the ConversationDrawerHeader slot. * @alpha */ export declare type IGenAIAssistantConversationDrawerHeaderProps = { /** * Title displayed in the conversations drawer header. */ title: string; }; /** * Properties for the ConversationFooter slot. * @alpha */ export declare type IGenAIAssistantConversationFooterProps = { /** * Identifier of the conversations list. */ id: string; /** * Conversations list items. */ listItems: IUiMenuItem[]; }; /** * Properties for the ConversationHeader slot. * @alpha */ export declare type IGenAIAssistantConversationHeaderProps = { /** * Identifier of the conversations list. */ id: string; /** * Conversations list items. */ listItems: IUiMenuItem[]; }; /** * Properties for the ConversationItem slot. * @alpha */ export declare type IGenAIAssistantConversationItemProps = { /** * The conversation represented by the item. */ conversation: IChatConversationLocal; /** * Props to pass to the underlying UiMenuInteractiveItemWrapper. */ menuItemProps: IUiMenuInteractiveItemWrapperProps; }; /** * Properties for the Disclaimer slot. * @public */ export declare type IGenAIAssistantDisclaimerProps = Record; /** * Properties for the Feedback slot. * @alpha */ export declare type IGenAIAssistantFeedbackProps = { /** * The message to render feedback buttons for. */ message: IChatConversationLocalItem; /** * The groups of messages in the conversation. */ group: IChatMessagesGroup; /** * Whether the message is the last one in the conversation. */ isLast?: boolean; /** * Whether the feedback is hidden. */ isHidden?: boolean; /** * Whether the related message is complete. */ isComplete?: boolean; }; /** * Properties for the FollowUpButtons slot. * @alpha */ export declare type IGenAIAssistantFollowUpButtonsProps = { /** * The message to render follow up buttons for. */ message: IChatConversationLocalItem; /** * The suggestions for follow up questions. */ suggestions: IChatSuggestion[]; }; /** * Properties for the FollowUpQuestion slot. * @alpha */ export declare type IGenAIAssistantFollowUpQuestionProps = { /** * The message to render follow up question for. */ message: IChatConversationLocalItem; /** * The follow up question text. */ question: string; /** * The references to metadata objects. */ references: TextContentObject[]; }; /** * Properties for the LandingScreen slot. * @public */ export declare type IGenAIAssistantLandingScreenProps = { /** * Whether the chat is in fullscreen mode. */ isFullscreen?: boolean; /** * Whether the chat is in big screen mode (greater or equal to md) */ isBigScreen?: boolean; /** * Whether the chat is in small screen mode (less than md) */ isSmallScreen?: boolean; }; /** * Properties for the MessageErrorContent slot. * @alpha */ export declare type IGenAIAssistantMessageErrorContentProps = IChatConversationErrorContent & { /** * Whether the message is still loading. */ isLoading?: boolean; }; /** * Properties for the MessageMultipartContent slot. * @alpha */ export declare type IGenAIAssistantMessageMultipartContentProps = { /** * The message containing the multipart content. */ message: IChatConversationLocalItem; /** * The parts of the multipart content. */ parts: IChatConversationMultipartLocalPart[]; /** * The references to metadata objects. */ references: TextContentObject[]; /** * Whether the message is the last one in the conversation. */ isLast?: boolean; }; /** * Properties for the MessageReasoningContent slot. * @alpha */ export declare type IGenAIAssistantMessageReasoningContentProps = { /** * The summary of the reasoning. */ summary: string; /** * The objects to render as links in the reasoning. */ objects: TextContentObject[]; /** * Whether the message is still loading. */ isLoading?: boolean; }; /** * Properties for the MessageTextContent slot. * @alpha */ export declare type IGenAIAssistantMessageTextContentProps = { /** * The text to render. */ text: string; /** * The objects to render as links in the text. */ objects: TextContentObject[]; /** * Whether the message is still loading. */ isLoading?: boolean; }; /** * Customizations for the Gen AI assistant. * @public */ export declare interface IGenAIAssistantSlots { /** * Custom React node rendered when no conversation exists yet or user has click * on "New conversation" button. */ LandingScreen?: ComponentType>; /** * Custom React component rendered below the input as a disclaimer. */ Disclaimer?: ComponentType>; /** * Custom React component rendered for each agent in the agent chooser dropdown. */ AgentItem?: ComponentType>; /** * @alpha * Custom React component rendered for each conversation item in the history list. */ ConversationItem?: ComponentType>; /** * @alpha * Custom React component rendered as the drawer header for conversation history. */ ConversationDrawerHeader?: ComponentType>; /** * @alpha * Custom React component rendered above each conversation history list section. */ ConversationHeader?: ComponentType>; /** * @alpha * Custom React component rendered below each conversation history list section. */ ConversationFooter?: ComponentType>; /** * @alpha * Custom React component rendered for date grouped conversation sections. */ ConversationDateGrouping?: ComponentType>; /** * @alpha * Custom React component rendered for each user message. */ UserMessage?: ComponentType>; /** * @alpha * Custom React component rendered for each assistant message. */ AssistantMessage?: ComponentType>; /** * @alpha * Custom React component rendered for text content of a message. */ MessageTextContent?: ComponentType>; /** * @alpha * Custom React component rendered for error content of a message. */ MessageErrorContent?: ComponentType>; /** * @alpha * Custom React component rendered for reasoning content of a message. */ MessageReasoningContent?: ComponentType>; /** * @alpha * Custom React component rendered for multipart content of a message. */ MessageMultipartContent?: ComponentType>; /** * @alpha * Custom React component rendered for follow up buttons of a message. */ FollowUpButtons?: ComponentType>; /** * @alpha * Custom React component rendered for feedback buttons of a message. */ Feedback?: ComponentType>; /** * @alpha * Custom React component rendered for follow up question of a message. */ FollowUpQuestion?: ComponentType>; /** * @alpha * Custom React component rendered for the agent chooser. */ AgentChooser?: ComponentType>; } /** * Properties for the UserMessage slot. * @alpha */ export declare type IGenAIAssistantUserMessageProps = { /** * The message to render. */ message: IChatConversationLocalItem; /** * The groups of messages in the conversation. */ groups: IChatMessagesGroup[]; /** * Whether the message is the last one in the conversation. */ isLast?: boolean; }; /** * Props for the {@link GenAiInteractionIntelligence} component. * @public */ export declare interface IGenAiInteractionIntelligenceProps { responseId: string; onClose: () => void; /** Lets a consumer render directly into a specific category's detail view. */ initialMode?: InteractionIntelligenceMode; /** Category id to open when `initialMode === "detail"`. Falls back to list mode if unknown. */ initialCategory?: string; } /** * @beta */ export declare interface ILandingContentProps { children: ReactNode; isFullscreen?: boolean; isBigScreen?: boolean; isSmallScreen?: boolean; } /** * Default implementation of the LandingQuestion slot. * * @alpha */ export declare interface ILandingQuestionProps { question: string; answer: string; icon?: IUiButtonProps["iconBefore"]; title?: string; } /** * @alpha */ export declare interface ILandingTitleProps { children: ReactNode; } /** * The modes the panel can render: the full list/timeline view or a single category's detail view. * @public */ export declare type InteractionIntelligenceMode = "list" | "detail"; /** * Type guard for the ChatAgentChangeEvent. * @public */ export declare const isChatAgentChangeEvent: (event: ChatEvent) => event is ChatAgentChangeEvent; /** * Type guard for the ChatAssistantMessageEvent. * @public */ export declare const isChatAssistantMessageEvent: (event: ChatEvent) => event is ChatAssistantMessageEvent; /** * Type guard for the ChatClosedEvent. * @public */ export declare const isChatClosedEvent: (event: ChatEvent) => event is ChatClosedEvent; /** * Type guard for the ChatContextChangeEvent. * @public */ export declare const isChatContextChangeEvent: (event: ChatEvent) => event is ChatContextChangeEvent; /** * Type guard for the ChatCopyToClipboardEvent. * @public */ export declare const isChatConversationChangedEvent: (event: ChatEvent) => event is ChatConversationChangedEvent; /** * Type guard for the ChatConversationDeletedEvent. * @public */ export declare const isChatConversationDeletedErrorEvent: (event: ChatEvent) => event is ChatConversationDeletedErrorEvent; /** * Type guard for the ChatConversationDeletedEvent. * @public */ export declare const isChatConversationDeletedSuccessEvent: (event: ChatEvent) => event is ChatConversationDeletedSuccessEvent; /** * Type guard for the ChatConversationDeletedEvent. * @public */ export declare const isChatConversationDeleteEvent: (event: ChatEvent) => event is ChatConversationDeleteEvent; /** * Type guard for the ChatConversationPinnedEvent. * @public */ export declare const isChatConversationPinErrorEvent: (event: ChatEvent) => event is ChatConversationPinErrorEvent; /** * Type guard for the ChatConversationPinnedEvent. * @public */ export declare const isChatConversationPinnedEvent: (event: ChatEvent) => event is ChatConversationPinnedEvent; /** * Type guard for the ChatConversationRenamedErrorEvent. * @public */ export declare const isChatConversationRenamedErrorEvent: (event: ChatEvent) => event is ChatConversationRenamedErrorEvent; /** * Type guard for the ChatConversationRenamedSuccessEvent. * @public */ export declare const isChatConversationRenamedSuccessEvent: (event: ChatEvent) => event is ChatConversationRenamedSuccessEvent; /** * Type guard for the ChatConversationRenameEvent. * @public */ export declare const isChatConversationRenameEvent: (event: ChatEvent) => event is ChatConversationRenameEvent; /** * Type guard for the ChatCopyToClipboardEvent. * @public */ export declare const isChatCopyToClipboardEvent: (event: ChatEvent) => event is ChatCopyToClipboardEvent; /** * Type guard for the ChatDefinitionReceivedEvent. * @public */ export declare const isChatDefinitionReceivedEvent: (event: ChatEvent) => event is ChatDefinitionReceivedEvent; /** * Type guard for the ChatFeedbackErrorEvent. * @public */ export declare const isChatFeedbackErrorEvent: (event: ChatEvent) => event is ChatFeedbackErrorEvent; /** * Type guard for the ChatFeedbackEvent. * @public */ export declare const isChatFeedbackEvent: (event: ChatEvent) => event is ChatFeedbackEvent; /** * Type guard for the ChatModeChangeEvent. * @public */ export declare const isChatModeChangeEvent: (event: ChatEvent) => event is ChatModeChangeEvent; /** * Type guard for the ChatOpenedEvent. * @public */ export declare const isChatOpenedEvent: (event: ChatEvent) => event is ChatOpenedEvent; /** * Type guard for the ChatResetEvent. * @public */ export declare const isChatResetEvent: (event: ChatEvent) => event is ChatResetEvent; /** * Type guard for the ChatVisualizationErrorEvent. * @public */ export declare const isChatSaveVisualizationErrorEvent: (event: ChatEvent) => event is ChatSaveVisualizationErrorEvent; /** * Type guard for the ChatSaveVisualizationSuccessEvent. * @public */ export declare const isChatSaveVisualizationSuccessEvent: (event: ChatEvent) => event is ChatSaveVisualizationSuccessEvent; /** * Type guard for the ChatUserMessageEvent. * @public */ export declare const isChatUserMessageEvent: (event: ChatEvent) => event is ChatUserMessageEvent; /** * Type guard for the ChatVisualizationErrorEvent. * @public */ export declare const isChatVisualizationErrorEvent: (event: ChatEvent) => event is ChatVisualizationErrorEvent; /** * @alpha */ export declare type LandingScreenProps = IGenAIAssistantLandingScreenProps & { /** * Custom React node rendered when no conversation exists yet. * @deprecated Use slots.LandingScreen instead. */ LandingScreen?: ComponentType; }; /** * @public */ export declare type LinkHandlerEvent = { type: "setting" | GenAIObjectType; id: string; workspaceId: string; newTab: boolean; itemUrl: string; preventDefault: () => void; section?: "ai"; dashboard?: IDashboard; insights?: IInsight[]; dashboardStatus?: "saved" | "draft"; visualization?: IInsight; visualizationStatus?: "saved" | "draft"; action: "copy" | "open"; }; /** * Make a new assistant message item. * @internal */ export declare const makeAssistantItem: (content?: IChatConversationLocalContent, id?: string, complete?: boolean) => IChatConversationLocalItem; /** * @public */ export declare const makeTextContents: (text: string, objects: TextContentObject[]) => TextContents; /** * Make a new user message item. * @internal */ export declare const makeUserItem: (content?: IChatConversationLocalContent, id?: string) => IChatConversationLocalItem; /** * @public */ export declare const makeUserMessage: (content: Contents[]) => UserMessage; /** * All messages that can be stored in history. * @public */ export declare type Message = UserMessage | AssistantMessage; /** * @public */ export declare const /** * @public */ newMessageAction: ActionCreatorWithPayload; /** * @public */ export declare type ReasoningContents = { type: "reasoning"; steps: ReasoningStep[]; }; /** * @public */ export declare type ReasoningStep = { title: string; thoughts?: ReasoningThought[]; }; /** * @public */ export declare type ReasoningThought = { text: string; }; /** * @public */ export declare type RoutingContents = { type: "routing"; text: string; useCase: GenAIChatRoutingUseCase; }; /** * @public */ export declare type SearchContents = { type: "search"; text: string; searchResults: ISemanticSearchResultItem[]; }; /** * @public */ export declare type SemanticSearchContents = { type: "semanticSearch"; text: string; searchResults: ISemanticSearchResultItem[]; relationships: ISemanticSearchRelationship[]; }; /** * @public */ export declare const /** * @public */ setAmbientUserContextAction: ActionCreatorWithPayload< { userContext?: IGenAIUserContext; loading?: boolean; }, "chatWindow/setAmbientUserContextAction">; /** * @public */ export declare const /** * @public */ setCurrentConversationAction: ActionCreatorWithPayload< { conversation: IChatConversationLocal; }, "messages/setCurrentConversationAction">; /** * Switches the assistant between the docked and the fullscreen layout. * @public */ export declare const /** * Switches the assistant between the docked and the fullscreen layout. * @public */ setFullscreenAction: ActionCreatorWithPayload< { isFullscreen: boolean; }, "chatWindow/setFullscreenAction">; /** * @public */ export declare const /** * @public */ setSelectedAgentAction: ActionCreatorWithPayload< { agentId: string | undefined; previousAgentId?: string | undefined; showChangeEvent?: boolean; }, "messages/setSelectedAgentAction">; /** * @public */ export declare const /** * @public */ setUserContextAction: ActionCreatorWithPayload< { userContext?: IGenAIUserContext; replaceUserContext?: boolean; }, "chatWindow/setUserContextAction">; /** * @public */ export declare const /** * @public */ startNewConversationAction: ActionCreatorWithoutPayload<"messages/startNewConversationAction">; /** * @public */ export declare type TextContentObject = { id: string; type: "metric" | "attribute" | "fact" | "date" | "label" | "dashboard" | "visualization" | "dataset"; title: string; }; /** * @public */ export declare type TextContents = { type: "text"; text: string; objects: TextContentObject[]; }; /** * @internal */ export declare function useGenAiChatAvailability(backend: IAnalyticalBackend, workspaceId?: string, enabled?: boolean, canManage?: boolean): boolean; /** * Hook to retrieve the list of all conversations. * * @alpha */ export declare function useGenAiConversations(): IChatConversationLocal[] | undefined; /** * Hook to retrieve whether the conversations have been loaded. * * @alpha */ export declare function useGenAiConversationsLoaded(): boolean; /** * Hook to retrieve the current active conversation. * * @alpha */ export declare function useGenAiCurrentConversation(): IChatConversationLocal | undefined; /** * Hook to retrieve the GenAI dispatcher. * * @remarks * This hook must be used within a GenAiStore component. * * @public */ export declare function useGenAiDispatcher(): EnhancedStore["dispatch"]; /** * @public */ export declare type UserMessage = BaseMessage & { role: "user"; }; /** * @public */ export declare type VisualizationContents = { type: "visualization"; text: string; createdVisualizations: IGenAIVisualization[]; }; export { }