import { WidgetProps } from '../../../domains/widgets/components/widget/types';
import type { GetNlgInsightsResponse as GetNlgInsightsResponseInfra, SendAiFeedbackRequest } from '../../../infra/api/narrative/narrative-api-types.js';
import { ExpandedQueryModel } from '../../../modules/analytics-composer';
export interface ChatContext {
    title: string;
    live: boolean;
}
export interface ChatContextDetails {
    dashboardId?: string;
}
export interface TextMessage {
    role: 'assistant';
    content: string;
    type: 'text';
}
export interface NlqMessage {
    role: 'assistant';
    content: string;
    type: 'nlq';
}
interface RegularMessage {
    role: 'user' | 'assistant';
    content: string;
}
export type ChatMessage = RegularMessage | NlqMessage | TextMessage;
export interface Chat {
    chatId: string;
    contextId: string;
    contextTitle: string;
    contextDetails?: ChatContextDetails;
    expireAt: string;
    tenantId: string;
    userId: string;
    chatHistory: ChatMessage[];
}
export type ChatWithoutHistory = Omit<Chat, 'chatHistory'>;
export interface LlmConfig {
    provider: string;
    apiKey: string;
    baseUrl: string;
    model: string;
    version?: string;
}
export interface ChatRequest {
    text?: string;
    timezone?: string;
    options?: {
        enableFollowup?: boolean;
    };
}
interface TextResponse {
    chatHistory: ChatMessage[];
    data: {
        answer: string;
    };
    chatId: string;
    responseType: 'text';
}
interface ErrorResponse {
    data: {
        message: string;
        code: string;
        answer: string;
    };
    responseType: 'error';
}
/**
 * Response data for NLQ request
 */
export interface NlqResponseData extends ExpandedQueryModel {
    /** Detailed description of the response */
    detailedDescription: string;
    /** An array of suggested followup questions  */
    followupQuestions?: string[];
    /** NLQ prompt used in the request  */
    nlqPrompt: string;
    /** Suggested widget props*/
    widgetProps?: WidgetProps | undefined;
    /** The response message for the chat  */
    userMsg: string;
    /** @internal */
    clarification?: string;
    /**
     * Unique timestamp identifier for the response, used for memoization
     *
     * @internal
     */
    timestamp?: string;
}
export interface NlqResponse {
    data: NlqResponseData;
    timestamp: string;
    responseType: 'nlq';
}
export type ChatResponse = NlqResponse | TextResponse | ErrorResponse;
export interface QueryRecommendationConfig {
    numOfRecommendations: number;
    userPrompt?: string;
}
export type NlqResult = Omit<NlqResponseData, 'followupQuestions'>;
/** AI-generated recommended query you can run on your data model */
export interface QueryRecommendation extends Omit<NlqResponseData, 'followupQuestions'> {
}
export type QueryRecommendationResponse = QueryRecommendation[];
export type { GetNlgInsightsRequest } from '../../../infra/api/narrative/narrative-api-types.js';
/** @internal */
export type GetNlgInsightsResponse = GetNlgInsightsResponseInfra;
/** @internal */
export declare const NLQ_RESULT_CHART_TYPES: readonly ["indicator", "column", "line", "table", "pie", "bar"];
/** NLQ result chart types @expandType */
export type NlqResultChartType = (typeof NLQ_RESULT_CHART_TYPES)[number];
export interface GetNlqResultRequest {
    text: string;
    timezone?: string;
    chartTypes: NlqResultChartType[];
}
/** @internal */
export type SendFeedbackRequest = SendAiFeedbackRequest;
/**
 * The chat mode to use for a chat session
 *
 * analyze: Enable business users to uncover data insights
 * develop: Enable developers to build queries and charts for embedded analytics
 */
export type ChatMode = 'analyze' | 'develop';
