import { type IChatConversation, type IChatConversationContent, type IChatConversationError, type IChatConversationItem, type IChatConversationMultipartPart, type IChatSuggestions } from "@gooddata/sdk-backend-spi"; import type { GenAIChatInteractionUserFeedback, GenAIChatRoutingUseCase, IGenAIChangeAnalysisParams, IGenAIVisualization, ISemanticSearchRelationship, ISemanticSearchResult, ISemanticSearchResultItem } from "@gooddata/sdk-model"; /** * @public * Describes an AI assistant agent. */ export 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; }; /** * @public */ export type TextContentObject = { id: string; type: "metric" | "attribute" | "fact" | "date" | "label" | "dashboard" | "visualization" | "dataset"; title: string; }; /** * @public */ export type TextContents = { type: "text"; text: string; objects: TextContentObject[]; }; /** * @internal */ export declare const isTextContents: (contents: Contents) => contents is TextContents; /** * @public */ export declare const makeTextContents: (text: string, objects: TextContentObject[]) => TextContents; /** * @public */ export type RoutingContents = { type: "routing"; text: string; useCase: GenAIChatRoutingUseCase; }; /** * @internal */ export declare const isRoutingContents: (contents: Contents) => contents is RoutingContents; /** * @internal */ export declare const makeRoutingContents: (text: string, useCase: GenAIChatRoutingUseCase) => RoutingContents; /** * @public */ export type ReasoningContents = { type: "reasoning"; steps: ReasoningStep[]; }; /** * @public */ export type ReasoningStep = { title: string; thoughts?: ReasoningThought[]; }; /** * @public */ export type ReasoningThought = { text: string; }; /** * @internal */ export declare const isReasoningContents: (contents: Contents) => contents is ReasoningContents; /** * @internal */ export declare const makeReasoningContents: (steps: ReasoningStep[]) => ReasoningContents; /** * @public */ export type SearchContents = { type: "search"; text: string; searchResults: ISemanticSearchResultItem[]; }; /** * @internal */ export declare const isSearchContents: (contents: Contents) => contents is SearchContents; /** * @internal */ export declare const makeSearchContents: (text: string, searchResults?: ISemanticSearchResultItem[]) => SearchContents; /** * @public */ export type SemanticSearchContents = { type: "semanticSearch"; text: string; searchResults: ISemanticSearchResultItem[]; relationships: ISemanticSearchRelationship[]; }; /** * @internal */ export declare function isSemanticSearchContents(contents: Contents): contents is SemanticSearchContents; /** * @internal */ export declare function makeSemanticSearchContents(result: ISemanticSearchResult): SemanticSearchContents; /** * @public */ export type VisualizationContents = { type: "visualization"; text: string; createdVisualizations: IGenAIVisualization[]; }; /** * @internal */ export declare const isVisualizationContents: (contents: Contents) => contents is VisualizationContents; /** * @internal */ export declare const makeVisualizationContents: (text: string, createdVisualizations?: IGenAIVisualization[]) => VisualizationContents; /** * @public */ export type ChangeAnalysisContents = { type: "changeAnalysis"; params: IGenAIChangeAnalysisParams; }; /** * @internal */ export declare const isChangeAnalysisContents: (contents: Contents) => contents is ChangeAnalysisContents; /** * @internal */ export declare const makeChangeAnalysisContents: (params: IGenAIChangeAnalysisParams) => ChangeAnalysisContents; /** * @public */ export type ErrorContents = { type: "error"; text: string; }; /** * @internal */ export declare const isErrorContents: (contents: Contents) => contents is ErrorContents; /** * @internal */ export declare const makeErrorContents: (text: string) => ErrorContents; /** * @public */ export type Contents = TextContents | RoutingContents | ReasoningContents | SearchContents | SemanticSearchContents | VisualizationContents | ChangeAnalysisContents | ErrorContents; /** * @public */ export 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 type UserMessage = BaseMessage & { role: "user"; }; /** * @internal */ export declare const isUserMessage: (message?: Message) => message is UserMessage; /** * @public */ export declare const makeUserMessage: (content: Contents[]) => UserMessage; /** * @public */ export type AssistantMessage = BaseMessage & { role: "assistant"; feedback: GenAIChatInteractionUserFeedback; feedbackError?: string; }; /** * @internal */ export declare const isAssistantMessage: (message?: Message) => message is AssistantMessage; /** * Create a new Assistant message. By default, mark it as incomplete. * @internal */ export declare const makeAssistantMessage: (content: Contents[], complete?: boolean, id?: string, feedback?: GenAIChatInteractionUserFeedback) => AssistantMessage; /** * All messages that can be stored in history. * @public */ export type Message = UserMessage | AssistantMessage; /** * Represents a local chat conversation that extends the base `IChatConversation` type. * Includes additional optional properties specific to the local context. * @public */ export type IChatConversationLocal = IChatConversation & { localId: string; generatingTitle?: boolean; inProgress?: boolean; }; /** * Chat conversation item with local ID. * @public */ export type IChatConversationLocalItem = Omit & { cancelled?: boolean; complete?: boolean; streaming?: boolean; filled?: boolean; localId: string; content: IChatConversationLocalContent | IChatConversationErrorContent | IChatConversationSystemContent; }; /** * Type guard for the IChatConversationLocalItem. * @internal */ export declare function isChatConversationLocalItem(obj: any): obj is IChatConversationLocalItem; /** * Chat local conversation content * @public */ export type IChatConversationLocalContent = IChatConversationContent & { objects?: TextContentObject[]; parts?: IChatConversationMultipartPart[]; }; /** * Chat conversation error content * @public */ export type IChatConversationErrorContent = { type: "error"; message: string; code?: number; reason?: IChatConversationError["reason"]; traceId?: string; }; /** * 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 type IChatConversationSystemContent = { type: "system"; }; /** * Chat local conversation multipart local part * @public */ export type IChatConversationMultipartLocalPart = IChatConversationMultipartPart & { reporting?: boolean; saving?: { started: boolean; completed: boolean; }; error?: { name: string; message: string; }; objects?: TextContentObject[]; suggestions?: IChatSuggestions; }; /** * Make a new conversation item with local ID. * @internal */ export declare const makeConversationItem: (item: IChatConversationItem) => IChatConversationLocalItem; /** * Make a new assistant message item. * @internal */ export declare const makeAssistantItem: (content?: IChatConversationLocalContent, id?: string, complete?: boolean) => IChatConversationLocalItem; /** * Make a new user message item. * @internal */ export declare const makeUserItem: (content?: IChatConversationLocalContent, id?: string) => IChatConversationLocalItem; /** * Make an optimistic agent change event item for the current session. * @internal */ export declare const makeAgentChangeItem: ({ agentId, oldAgentId, }: { agentId: string; oldAgentId?: string; }) => IChatConversationLocalItem; /** * Make a new error message item. */ export declare const makeErrorContent: (message: string, code?: number) => IChatConversationErrorContent; //# sourceMappingURL=model.d.ts.map