UPDATE 12-ago-2025
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
package com.example.dto.base;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
|
||||
@JsonTypeInfo(
|
||||
use = JsonTypeInfo.Id.NAME,
|
||||
include = JsonTypeInfo.As.PROPERTY,
|
||||
property = "type"
|
||||
)
|
||||
@JsonSubTypes({
|
||||
@JsonSubTypes.Type(value = NotificationRequest.class, name = "NOTIFICATION"),
|
||||
})
|
||||
public sealed interface BaseRequest
|
||||
permits NotificationRequest{
|
||||
String type();
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.example.dto.base;
|
||||
|
||||
public record ConversationContext(
|
||||
String userId,
|
||||
String sessionId,
|
||||
String userMessageText,
|
||||
String primaryPhoneNumber
|
||||
) {}
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.example.dto.base;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public record NotificationRequest(
|
||||
@JsonProperty("requestId") String requestId,
|
||||
@JsonProperty("sessionId") String sessionId,
|
||||
@JsonProperty("mensaje") String message,
|
||||
@JsonProperty("SIC") String SIC,
|
||||
@Valid Usuario usuario,
|
||||
@JsonProperty("pantalla_contexto") String pantallaContexto,
|
||||
@JsonProperty("canal") String canal
|
||||
) implements BaseRequest {
|
||||
@Override
|
||||
public String type() {
|
||||
return "NOTIFICATION";
|
||||
}
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public record Usuario(
|
||||
String telefono,
|
||||
String nickname
|
||||
) {
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package com.example.dto.dialogflow;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import java.time.Instant;
|
||||
import java.util.Map;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public record ConversationEntryDTO(
|
||||
ConversationEntryType type,
|
||||
Instant timestamp,
|
||||
String text,
|
||||
String intentDisplayName,
|
||||
Map<String, Object> parameters,
|
||||
String webhookStatus,
|
||||
String canal
|
||||
) {
|
||||
public static ConversationEntryDTO forUser(String text) {
|
||||
return new ConversationEntryDTO(ConversationEntryType.USER_MESSAGE, Instant.now(),
|
||||
text, null, null, null, null);
|
||||
}
|
||||
|
||||
public static ConversationEntryDTO forAgent(QueryResultDTO agentQueryResult) {
|
||||
String fulfillmentText = (agentQueryResult != null && agentQueryResult.responseText() != null) ? agentQueryResult.responseText() : "";
|
||||
|
||||
return new ConversationEntryDTO(
|
||||
ConversationEntryType.AGENT_RESPONSE,
|
||||
Instant.now(),
|
||||
fulfillmentText,
|
||||
null,
|
||||
agentQueryResult.parameters(),
|
||||
null,
|
||||
null
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
package com.example.dto.dialogflow;
|
||||
|
||||
public enum ConversationEntryType {
|
||||
USER_MESSAGE,
|
||||
AGENT_RESPONSE
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.example.dto.dialogflow;
|
||||
|
||||
import com.example.dto.base.UsuarioDTO;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public record DetectIntentRequestDTO(
|
||||
@JsonProperty("session") String sessionId,
|
||||
@JsonProperty("queryInput") QueryInputDTO queryInput,
|
||||
@JsonProperty("queryParams") QueryParamsDTO queryParams,
|
||||
@JsonProperty("usuario") UsuarioDTO usuario,
|
||||
String userId
|
||||
) {
|
||||
|
||||
public DetectIntentRequestDTO withSessionId(String newSessionId) {
|
||||
return new DetectIntentRequestDTO(
|
||||
newSessionId,
|
||||
this.queryInput(),
|
||||
this.queryParams(),
|
||||
this.usuario(),
|
||||
this.userId()
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.example.dto.dialogflow;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public record DetectIntentResponseDTO(
|
||||
@JsonProperty("responseId") String responseId,
|
||||
@JsonProperty("queryResult") QueryResultDTO queryResult
|
||||
) {}
|
||||
@@ -1,6 +0,0 @@
|
||||
package com.example.dto.dialogflow;
|
||||
|
||||
public record IntentDTO(
|
||||
String name,
|
||||
String displayName
|
||||
) {}
|
||||
@@ -1,3 +0,0 @@
|
||||
package com.example.dto.dialogflow;
|
||||
|
||||
public record QueryInputDTO(TextInputDTO text, String languageCode) {}
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.example.dto.dialogflow;
|
||||
|
||||
import java.util.Map;
|
||||
public record QueryParamsDTO(Map<String, Object> parameters) {}
|
||||
@@ -1,3 +0,0 @@
|
||||
package com.example.dto.dialogflow;
|
||||
|
||||
public record TextInputDTO(String text) {}
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* 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.dto.dialogflow.base;
|
||||
|
||||
import com.example.dto.dialogflow.conversation.QueryInputDTO;
|
||||
import com.example.dto.dialogflow.conversation.QueryParamsDTO;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public record DetectIntentRequestDTO(
|
||||
@JsonProperty("queryInput") QueryInputDTO queryInput,
|
||||
@JsonProperty("queryParams") QueryParamsDTO queryParams
|
||||
) {
|
||||
|
||||
public DetectIntentRequestDTO withParameter(String key, Object value) {
|
||||
// Create a new QueryParamsDTO with the updated session parameter
|
||||
QueryParamsDTO updatedQueryParams = this.queryParams().withSessionParameter(key, value);
|
||||
|
||||
// Return a new DetectIntentRequestDTO instance with the updated QueryParamsDTO
|
||||
return new DetectIntentRequestDTO(
|
||||
this.queryInput(),
|
||||
updatedQueryParams
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* 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.dto.dialogflow.base;
|
||||
|
||||
import com.example.dto.dialogflow.conversation.QueryResultDTO;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public record DetectIntentResponseDTO(
|
||||
@JsonProperty("responseId") String responseId,
|
||||
@JsonProperty("queryResult") QueryResultDTO queryResult
|
||||
) {}
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* 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.dto.dialogflow.conversation;
|
||||
|
||||
public record ConversationContext(
|
||||
String userId,
|
||||
String sessionId,
|
||||
String userMessageText,
|
||||
String primaryPhoneNumber
|
||||
) {}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.dto.dialogflow.conversation;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import java.time.Instant;
|
||||
import java.util.Map;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public record ConversationEntryDTO(
|
||||
ConversationEntryEntity entity,
|
||||
ConversationEntryType type,
|
||||
Instant timestamp,
|
||||
String text,
|
||||
Map<String, Object> parameters,
|
||||
String canal
|
||||
) {
|
||||
public static ConversationEntryDTO forUser(String text) {
|
||||
return new ConversationEntryDTO(
|
||||
ConversationEntryEntity.USUARIO,
|
||||
ConversationEntryType.CONVERSACION,
|
||||
Instant.now(),
|
||||
text,
|
||||
null,
|
||||
null);
|
||||
}
|
||||
|
||||
public static ConversationEntryDTO forAgent(QueryResultDTO agentQueryResult) {
|
||||
String fulfillmentText = (agentQueryResult != null && agentQueryResult.responseText() != null) ? agentQueryResult.responseText() : "";
|
||||
|
||||
return new ConversationEntryDTO(
|
||||
ConversationEntryEntity.AGENTE,
|
||||
ConversationEntryType.CONVERSACION,
|
||||
Instant.now(),
|
||||
fulfillmentText,
|
||||
agentQueryResult.parameters(),
|
||||
null
|
||||
);
|
||||
}
|
||||
public static ConversationEntryDTO forSystem(String text) {
|
||||
return new ConversationEntryDTO(
|
||||
ConversationEntryEntity.SISTEMA,
|
||||
ConversationEntryType.CONVERSACION,
|
||||
Instant.now(),
|
||||
text,
|
||||
null,
|
||||
null
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* 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.dto.dialogflow.conversation;
|
||||
|
||||
public enum ConversationEntryEntity {
|
||||
USUARIO,
|
||||
AGENTE,
|
||||
SISTEMA
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
* 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.dto.dialogflow.conversation;
|
||||
|
||||
public enum ConversationEntryType {
|
||||
INICIO,
|
||||
CONVERSACION
|
||||
}
|
||||
@@ -1,4 +1,9 @@
|
||||
package com.example.dto.dialogflow;
|
||||
/*
|
||||
* 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.dto.dialogflow.conversation;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import java.time.Instant;
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* 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.dto.dialogflow.conversation;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public record ExternalConvRequestDTO(
|
||||
@JsonProperty("mensaje") String message,
|
||||
@JsonProperty("usuario") UsuarioDTO user,
|
||||
@JsonProperty("canal") String channel,
|
||||
@JsonProperty("tipo") ConversationEntryType tipo
|
||||
) {
|
||||
public ExternalConvRequestDTO {}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* 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.dto.dialogflow.conversation;
|
||||
|
||||
import com.example.dto.dialogflow.notification.EventInputDTO;
|
||||
|
||||
public record QueryInputDTO(
|
||||
TextInputDTO text, // Can be null if using event
|
||||
EventInputDTO event,
|
||||
String languageCode // REQUIRED for both text and event inputs
|
||||
) {}
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* 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.dto.dialogflow.conversation;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public record QueryParamsDTO(
|
||||
@JsonProperty("parameters") Map<String, Object> parameters) {
|
||||
|
||||
public QueryParamsDTO {
|
||||
parameters = Objects.requireNonNullElseGet(parameters, HashMap::new);
|
||||
parameters = new HashMap<>(parameters);
|
||||
}
|
||||
|
||||
public QueryParamsDTO withSessionParameter(String key, Object value) {
|
||||
Map<String, Object> updatedParams = new HashMap<>(this.parameters());
|
||||
updatedParams.put(key, value);
|
||||
return new QueryParamsDTO(updatedParams);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,9 @@
|
||||
package com.example.dto.dialogflow;
|
||||
/*
|
||||
* 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.dto.dialogflow.conversation;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.util.Map;
|
||||
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
* 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.dto.dialogflow.conversation;
|
||||
|
||||
public record TextInputDTO(String text) {}
|
||||
@@ -1,4 +1,9 @@
|
||||
package com.example.dto.base;
|
||||
/*
|
||||
* 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.dto.dialogflow.conversation;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* 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.dto.dialogflow.notification;
|
||||
|
||||
public record EventInputDTO(
|
||||
String event
|
||||
) {}
|
||||
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* 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.dto.dialogflow.notification;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public record ExternalNotRequestDTO(
|
||||
@JsonProperty("texto") String text,
|
||||
@JsonProperty("telefono") String phoneNumber) {
|
||||
public ExternalNotRequestDTO {
|
||||
}
|
||||
}
|
||||
@@ -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.dto.dialogflow.notification;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import java.time.Instant;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Represents a notification record to be stored in Firestore and cached in
|
||||
* Redis.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true) // Ignorar campos adicionales durante la deserialización
|
||||
public record NotificationDTO(
|
||||
String idNotificacion, // ID único para esta notificación (ej. el sessionId usado con Dialogflow)
|
||||
String telefono,
|
||||
Instant timestampCreacion, // Momento en que la notificación fue procesada
|
||||
String texto, // 'texto' original de NotificationRequestDTO (si aplica)
|
||||
String nombreEventoDialogflow, // Nombre del evento enviado a Dialogflow (ej. "tu Estado de cuenta listo")
|
||||
String codigoIdiomaDialogflow, // Código de idioma usado para el evento
|
||||
Map<String, Object> parametros // Parámetros de sesión finales después del procesamiento de// Dialogflow
|
||||
) {
|
||||
public NotificationDTO {
|
||||
Objects.requireNonNull(idNotificacion, "Notification ID cannot be null.");
|
||||
Objects.requireNonNull(timestampCreacion, "Notification timestamp cannot be null.");
|
||||
Objects.requireNonNull(nombreEventoDialogflow, "Dialogflow event name cannot be null.");
|
||||
Objects.requireNonNull(codigoIdiomaDialogflow, "Dialogflow language code cannot be null.");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// src/main/java/com/example/dto/dialogflow/notification/NotificationSessionDTO.java
|
||||
package com.example.dto.dialogflow.notification;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public record NotificationSessionDTO(
|
||||
String sessionId, // The unique session identifier (e.g., the phone number)
|
||||
String telefono, // The phone number for this session
|
||||
Instant fechaCreacion, // When the session was first created
|
||||
Instant ultimaActualizacion, // When the session was last updated
|
||||
List<NotificationDTO> notificaciones // List of individual notification events
|
||||
) {
|
||||
public NotificationSessionDTO {
|
||||
Objects.requireNonNull(sessionId, "Session ID cannot be null.");
|
||||
Objects.requireNonNull(telefono, "Phone number cannot be null.");
|
||||
Objects.requireNonNull(fechaCreacion, "Creation timestamp cannot be null.");
|
||||
Objects.requireNonNull(ultimaActualizacion, "Last updated timestamp cannot be null.");
|
||||
Objects.requireNonNull(notificaciones, "Notifications list cannot be null.");
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,11 @@
|
||||
/*
|
||||
* 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.dto.gemini;
|
||||
|
||||
import com.example.dto.dialogflow.ConversationEntryType;
|
||||
import com.example.dto.dialogflow.conversation.ConversationEntryEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
@@ -12,7 +17,7 @@ import java.util.Optional;
|
||||
public record ConversationEntrySummaryDTO(
|
||||
@JsonProperty("text") String text,
|
||||
@JsonProperty("timestamp") Timestamp timestamp,
|
||||
Optional<ConversationEntryType> type,
|
||||
Optional<ConversationEntryEntity> type,
|
||||
@JsonProperty("intentDisplayName") String intentDisplayName,
|
||||
@JsonProperty("parameters") Map<String, Object> parameters,
|
||||
@JsonProperty("webhookStatus") String webhookStatus,
|
||||
@@ -33,7 +38,7 @@ public record ConversationEntrySummaryDTO(
|
||||
timestamp,
|
||||
Optional.ofNullable(typeString).map(t -> {
|
||||
try {
|
||||
return ConversationEntryType.valueOf(t);
|
||||
return ConversationEntryEntity.valueOf(t);
|
||||
} catch (IllegalArgumentException e) {
|
||||
System.err.println("Warning: Invalid ConversationEntryType string during deserialization: " + t);
|
||||
return null;
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
/*
|
||||
* 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.dto.gemini;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
/*
|
||||
* 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.dto.gemini;
|
||||
|
||||
import jakarta.validation.constraints.Max;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.DecimalMax;
|
||||
import jakarta.validation.constraints.DecimalMin;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
|
||||
public record ConversationSummaryRequest(
|
||||
@@ -9,11 +14,16 @@ public record ConversationSummaryRequest(
|
||||
String sessionId,
|
||||
@NotBlank(message = "Prompt for summarization is required.")
|
||||
String prompt,
|
||||
@Min(value = 0, message = "Temperature must be between 0.0 and 1.0.")
|
||||
@Max(value = 1, message = "Temperature must be between 0.0 and 1.0.")
|
||||
@DecimalMin(value = "0.0", message = "Temperature must be between 0.0 and 1.0.")
|
||||
@DecimalMax(value = "0.1", message = "Temperature must be between 0.0 and 1.0.")
|
||||
Float temperature,
|
||||
@Min(value = 1, message = "Max Output Tokens must be at least 1.")
|
||||
@DecimalMin(value = "0.1", message = "Max Output Tokens must be at least 1.")
|
||||
Integer maxOutputTokens,
|
||||
@NotBlank(message = "model is required.")
|
||||
String modelName
|
||||
String modelName,
|
||||
@NotBlank(message = "topP is required.")
|
||||
@DecimalMin(value = "0.0", message = "topP must be between 0.0 and 1.0.")
|
||||
Float top_P
|
||||
|
||||
|
||||
) {}
|
||||
@@ -1,3 +1,8 @@
|
||||
/*
|
||||
* 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.dto.gemini;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
|
||||
Reference in New Issue
Block a user