import { MessageData } from "./services/conversations"; import { type ChatConfigProp, type RequestConfigProp } from "./services"; import { SortReferences } from "./references"; import { ChoosePromotion } from "./promotions"; import { type ConversationState } from "./conversationStore"; import { type ConversationHistoryStore } from "./history"; export type ConversationMethods = { createConversation: () => Promise; switchConversation: (conversationId: string, options?: { from?: "history"; }) => Promise; submit: (content: string) => Promise; getMessage: (messageId: string) => MessageData | undefined; rateMessage: (messageId: string, rating: boolean) => Promise; commentMessage: (messageId: string, comment: string) => Promise; getConversationHistoryInfo: () => Promise<{ id: string; name: string; }[]>; getHistoryVersion: () => number; }; export type Conversation = ConversationState & ConversationMethods; export type UseConversationParams = { /** * Base URL for the chat server. */ serverBaseUrl: string; chat: ChatConfigProp; request?: RequestConfigProp; shouldStream?: boolean; sortMessageReferences?: SortReferences; choosePriorityPromotion?: ChoosePromotion; history?: ConversationHistoryStore; getClientContext?: () => Record; }; export declare function useConversation(params: UseConversationParams): { conversationId: string | undefined; conversationName: string | undefined; messages: MessageData[]; error: string | undefined; streamingMessageId: string | undefined; createConversation: (args?: { name?: string; }) => Promise; submit: (content: string) => Promise; getMessage: (messageId: string) => MessageData | undefined; rateMessage: (messageId: string, rating: boolean) => Promise; commentMessage: (messageId: string, comment: string) => Promise; switchConversation: (conversationId: string, options?: { from?: "history"; }) => Promise; getConversationHistoryInfo: () => Promise; getHistoryVersion: () => number; };