2025-02-08 13:24:18 +08:00
import type { FileType , ThoughtFileType } from './config' ;
2025-01-28 04:21:42 +08:00
export type BusterChatMessage = {
id : string ;
request_message : BusterChatMessageRequest ;
response_messages : BusterChatMessageResponse [ ] ;
2025-02-08 13:24:18 +08:00
reasoning : BusterChatMessageReasoning [ ] ;
2025-01-28 04:21:42 +08:00
created_at : string ;
} ;
2025-02-05 03:26:42 +08:00
export type BusterChatMessageRequest = null | {
2025-01-28 04:21:42 +08:00
request : string ;
sender_id : string ;
sender_name : string ;
sender_avatar : string | null ;
} ;
2025-02-08 13:24:18 +08:00
export type BusterChatMessageResponse = BusterChatMessage_text | BusterChatMessage_file ;
2025-01-28 04:21:42 +08:00
export type BusterChatMessage_text = {
id : string ;
type : 'text' ;
message : string ;
2025-02-05 03:26:42 +08:00
message_chunk? : string ;
2025-01-28 04:21:42 +08:00
} ;
export type BusterChatMessage_fileMetadata = {
status : 'loading' | 'completed' | 'failed' ;
message : string ;
2025-01-29 06:38:43 +08:00
timestamp? : number ;
2025-01-28 04:21:42 +08:00
} ;
export type BusterChatMessage_file = {
id : string ;
type : 'file' ;
file_type : FileType ;
2025-01-29 06:21:07 +08:00
file_name : string ;
2025-01-28 04:21:42 +08:00
version_number : number ;
version_id : string ;
metadata? : BusterChatMessage_fileMetadata [ ] ;
} ;
2025-02-08 13:24:18 +08:00
export type BusterChatMessageReasoning =
| BusterChatMessageReasoning_thought
| BusterChatMessageReasoning_text ;
export type BusterChatMessageReasoning_thoughtPill = {
text : string ;
type : ThoughtFileType ;
id : string ;
} ;
2025-02-11 00:59:54 +08:00
export type BusterChatMessageReasoning_thoughtPillContainer = {
title : string ;
thought_pills : BusterChatMessageReasoning_thoughtPill [ ] ;
} ;
2025-02-08 13:24:18 +08:00
export type BusterChatMessageReasoning_thought = {
id : string ;
type : 'thought' ;
thought_title : string ;
thought_secondary_title : string ;
2025-02-11 00:59:54 +08:00
thoughts? : BusterChatMessageReasoning_thoughtPillContainer [ ] ;
2025-02-08 13:24:18 +08:00
status ? : 'loading' | 'completed' | 'failed' ; //if left undefined, will automatically be set to 'loading' if the chat stream is in progress AND there is no message after it
} ;
export type BusterChatMessageReasoning_text = {
id : string ;
type : 'text' ;
message : string ;
message_chunk? : string ;
} ;