feat: Send message with uuid #2088 (#2149)

### What problem does this PR solve?

feat: Send message with uuid #2088

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-08-29 11:24:27 +08:00
committed by GitHub
parent 4bd6c3145c
commit 1eb6286339
11 changed files with 122 additions and 70 deletions

View File

@ -7,7 +7,7 @@ export const isConversationIdExist = (conversationId: string) => {
return conversationId !== EmptyConversationId && conversationId !== '';
};
export const buildMessageUuid = (message: Message | IMessage) => {
export const buildMessageUuid = (message: Partial<Message | IMessage>) => {
if ('id' in message && message.id) {
return message.role === MessageType.User
? `${MessageType.User}_${message.id}`