14 lines
423 B
TypeScript
14 lines
423 B
TypeScript
import { useChatStore } from "@/store/chat"
|
|
|
|
export function listChatSessions() {
|
|
return useChatStore.getState().sessions
|
|
}
|
|
|
|
export function getChatSessionById(sessionId: string) {
|
|
return useChatStore.getState().sessions.find((session) => session.id === sessionId)
|
|
}
|
|
|
|
export function listChatMessages(sessionId: string) {
|
|
return useChatStore.getState().messages.filter((message) => message.sessionId === sessionId)
|
|
}
|