You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.3 KiB
TypeScript
37 lines
1.3 KiB
TypeScript
import type { Message as UIMessage } from "ai";
|
|
import type { generateText } from "ai";
|
|
import type {
|
|
Conversations,
|
|
ConversationsId,
|
|
} from "./database/generated/public/Conversations";
|
|
|
|
export type OtherParameters = Omit<
|
|
Parameters<typeof generateText>[0],
|
|
"model" | "messages" | "abortSignal"
|
|
>;
|
|
|
|
export type ConversationUI = Conversations & {};
|
|
|
|
export type Store = {
|
|
/** This is a string because Milvus sends it as a string, and the value
|
|
* overflows the JS integer anyway. */
|
|
conversationId: ConversationsId;
|
|
conversationTitle: string;
|
|
conversations: Array<ConversationUI>;
|
|
messages: Array<UIMessage>;
|
|
message: string;
|
|
systemPrompt: string;
|
|
parameters: OtherParameters;
|
|
loading: boolean;
|
|
setConversationId: (conversationId: ConversationsId) => void;
|
|
setConversationTitle: (conversationTitle: string) => void;
|
|
setConversations: (conversations: Array<ConversationUI>) => void;
|
|
addConversation: (conversation: ConversationUI) => void;
|
|
removeConversation: (conversationId: ConversationsId) => void;
|
|
setMessages: (messages: Array<UIMessage>) => void;
|
|
setMessage: (message: string) => void;
|
|
setSystemPrompt: (systemPrompt: string) => void;
|
|
setParameters: (parameters: OtherParameters) => void;
|
|
setLoading: (loading: boolean) => void;
|
|
};
|