.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright 2025 Google. This software is provided as-is, without warranty or representation for any use or purpose.
|
||||
* Your use of it is subject to your agreement with Google.
|
||||
*/
|
||||
|
||||
package com.example.mapper.conversation;
|
||||
|
||||
import com.example.dto.dialogflow.conversation.ConversationEntryDTO;
|
||||
import com.example.dto.dialogflow.conversation.ConversationMessageDTO;
|
||||
import com.example.dto.dialogflow.conversation.MessageType;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class ConversationEntryMapper {
|
||||
|
||||
public ConversationMessageDTO toConversationMessageDTO(ConversationEntryDTO entry) {
|
||||
MessageType type = switch (entry.entity()) {
|
||||
case USUARIO -> MessageType.USER;
|
||||
case AGENTE -> MessageType.AGENT;
|
||||
case SISTEMA -> MessageType.SYSTEM;
|
||||
case LLM -> MessageType.LLM;
|
||||
};
|
||||
|
||||
return new ConversationMessageDTO(
|
||||
type,
|
||||
entry.timestamp(),
|
||||
entry.text(),
|
||||
entry.parameters(),
|
||||
entry.canal()
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user