buster/web/src/api/buster_socket/chats/chatRequests.ts

56 lines
1.6 KiB
TypeScript
Raw Normal View History

2025-01-31 07:29:06 +08:00
import type { BusterSocketRequestBase } from '../base_interfaces';
2025-01-28 04:21:42 +08:00
export type ChatCreateNewChat = BusterSocketRequestBase<
'/chats/post',
{
dataset_id: string | null;
prompt?: string; //send if we are starting a new chat
chat_id?: string | null; //send if we are following up on a chat
suggestion_id?: string | null; //send if we clicked on a suggestion
message_id?: string; //send if we want to REPLACE current message
2025-02-04 01:31:15 +08:00
metric_id?: string; //send if we want to create a chat from a metric
2025-01-28 04:21:42 +08:00
draft_session_id?: string; //TODO: do we need this?
}
>;
export type ChatGetChat = BusterSocketRequestBase<'/chats/get', { id: string }>;
export type ChatUnsubscribeFromChat = BusterSocketRequestBase<'/chats/unsubscribe', { id: string }>;
export type ChatListEmitPayload = BusterSocketRequestBase<
'/chats/list',
{
page_token: number;
page_size: number;
admin_view: boolean;
filters?: {};
}
>;
export type ChatDeleteChat = BusterSocketRequestBase<'/chats/delete', { id: string }>;
export type ChatUpdateChat = BusterSocketRequestBase<
'/chats/update',
{ id: string; title?: string; is_favorited?: boolean }
>;
export type ChatsSearch = BusterSocketRequestBase<'/chats/search', { prompt: string }>;
export type ChatsDuplicateChat = BusterSocketRequestBase<
'/chats/duplicate',
{
id: string;
2025-02-04 01:31:15 +08:00
message_id: string; //send if we want to duplciate the chat starting from a specific message
2025-01-28 04:21:42 +08:00
}
>;
export type ChatEmits =
| ChatCreateNewChat
| ChatGetChat
| ChatUnsubscribeFromChat
| ChatListEmitPayload
| ChatDeleteChat
| ChatUpdateChat
| ChatsSearch
| ChatsDuplicateChat;