import type { UIMessage } from "ai"; import type { generateText } from "ai"; import type { Conversation, Fact, FactTrigger } from "./database/common"; export type OtherParameters = Omit< Parameters[0], "model" | "messages" | "abortSignal" >; export type ConversationUI = Conversation & {}; export type Store = { /** This is a string because Milvus sends it as a string, and the value * overflows the JS integer anyway. */ selectedConversationId: string; conversations: Array; messages: Array; message: string; systemPrompt: string; parameters: OtherParameters; facts: Array; factTriggers: Array; loading: boolean; setConversationId: (conversationId: string) => void; setConversationTitle: (conversationTitle: string) => void; setConversations: (conversations: Array) => void; addConversation: (conversation: ConversationUI) => void; removeConversation: (conversationId: string) => void; setMessages: (messages: Array) => void; setMessage: (message: string) => void; setSystemPrompt: (systemPrompt: string) => void; setParameters: (parameters: OtherParameters) => void; setFacts: (facts: Array) => void; setFactTriggers: (factTriggers: Array) => void; removeFact: (factId: string) => void; removeFactTrigger: (factTriggerId: string) => void; setLoading: (loading: boolean) => void; }; /** The message while it's being typed in the input box. */ export type DraftMessage = Omit; /** The message after it's been saved to the database. */ export type CommittedMessage = DraftMessage & { id: string; conversationId: string; index: number; runningSummary?: string; createdAt: string; };