UPDATE 10-sept
This commit is contained in:
@@ -28,6 +28,16 @@ public record ConversationEntryDTO(
|
||||
null);
|
||||
}
|
||||
|
||||
public static ConversationEntryDTO forUser(String text, Map<String, Object> parameters) {
|
||||
return new ConversationEntryDTO(
|
||||
ConversationEntryEntity.USUARIO,
|
||||
ConversationEntryType.CONVERSACION,
|
||||
Instant.now(),
|
||||
text,
|
||||
parameters,
|
||||
null);
|
||||
}
|
||||
|
||||
public static ConversationEntryDTO forAgent(QueryResultDTO agentQueryResult) {
|
||||
String fulfillmentText = (agentQueryResult != null && agentQueryResult.responseText() != null) ? agentQueryResult.responseText() : "";
|
||||
Map<String, Object> parameters = (agentQueryResult != null) ? agentQueryResult.parameters() : null;
|
||||
@@ -63,6 +73,8 @@ public record ConversationEntryDTO(
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static ConversationEntryDTO forSystem(String text, Map<String, Object> parameters) {
|
||||
return new ConversationEntryDTO(
|
||||
ConversationEntryEntity.SISTEMA,
|
||||
@@ -73,4 +85,26 @@ public record ConversationEntryDTO(
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
public static ConversationEntryDTO forLlmConversation(String text) {
|
||||
return new ConversationEntryDTO(
|
||||
ConversationEntryEntity.LLM,
|
||||
ConversationEntryType.CONVERSACION,
|
||||
Instant.now(),
|
||||
text,
|
||||
null,
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
public static ConversationEntryDTO forLlmConversation(String text, Map<String, Object> parameters) {
|
||||
return new ConversationEntryDTO(
|
||||
ConversationEntryEntity.LLM,
|
||||
ConversationEntryType.CONVERSACION,
|
||||
Instant.now(),
|
||||
text,
|
||||
parameters,
|
||||
null
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -8,5 +8,6 @@ package com.example.dto.dialogflow.conversation;
|
||||
public enum ConversationEntryEntity {
|
||||
USUARIO,
|
||||
AGENTE,
|
||||
SISTEMA
|
||||
SISTEMA,
|
||||
LLM
|
||||
}
|
||||
@@ -7,5 +7,6 @@ package com.example.dto.dialogflow.conversation;
|
||||
|
||||
public enum ConversationEntryType {
|
||||
INICIO,
|
||||
CONVERSACION
|
||||
CONVERSACION,
|
||||
LLM
|
||||
}
|
||||
@@ -25,4 +25,10 @@ public record QueryParamsDTO(
|
||||
updatedParams.put(key, value);
|
||||
return new QueryParamsDTO(updatedParams);
|
||||
}
|
||||
|
||||
public QueryParamsDTO withSessionParameters(Map<String, Object> parameters) {
|
||||
Map<String, Object> updatedParams = new HashMap<>(this.parameters());
|
||||
updatedParams.putAll(parameters);
|
||||
return new QueryParamsDTO(updatedParams);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user