UPDATE 12-sept
This commit is contained in:
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* 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.conversation.ConversationEntryEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.google.cloud.Timestamp;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public record ConversationEntrySummaryDTO(
|
||||
@JsonProperty("text") String text,
|
||||
@JsonProperty("timestamp") Timestamp timestamp,
|
||||
Optional<ConversationEntryEntity> type,
|
||||
@JsonProperty("intentDisplayName") String intentDisplayName,
|
||||
@JsonProperty("parameters") Map<String, Object> parameters,
|
||||
@JsonProperty("webhookStatus") String webhookStatus,
|
||||
@JsonProperty("canal") String canal
|
||||
) {
|
||||
@JsonCreator
|
||||
public ConversationEntrySummaryDTO(
|
||||
@JsonProperty("text") String text,
|
||||
@JsonProperty("timestamp") Timestamp timestamp,
|
||||
@JsonProperty("type") String typeString,
|
||||
@JsonProperty("intentDisplayName") String intentDisplayName,
|
||||
@JsonProperty("parameters") Map<String, Object> parameters,
|
||||
@JsonProperty("webhookStatus") String webhookStatus,
|
||||
@JsonProperty("canal") String canal
|
||||
) {
|
||||
this(
|
||||
text,
|
||||
timestamp,
|
||||
Optional.ofNullable(typeString).map(t -> {
|
||||
try {
|
||||
return ConversationEntryEntity.valueOf(t);
|
||||
} catch (IllegalArgumentException e) {
|
||||
System.err.println("Warning: Invalid ConversationEntryType string during deserialization: " + t);
|
||||
return null;
|
||||
}
|
||||
}),
|
||||
intentDisplayName,
|
||||
parameters,
|
||||
webhookStatus,
|
||||
canal
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.google.cloud.Timestamp;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public record ConversationSessionSummaryDTO(
|
||||
@JsonProperty("sessionId") String sessionId,
|
||||
@JsonProperty("userId") String userId,
|
||||
@JsonProperty("startTime") Timestamp startTime,
|
||||
@JsonProperty("lastUpdated") Timestamp lastUpdated,
|
||||
@JsonProperty("entries") List<ConversationEntrySummaryDTO> entries
|
||||
) {
|
||||
@JsonCreator
|
||||
public ConversationSessionSummaryDTO(
|
||||
@JsonProperty("sessionId") String sessionId,
|
||||
@JsonProperty("userId") String userId,
|
||||
@JsonProperty("startTime") Timestamp startTime,
|
||||
@JsonProperty("lastUpdated") Timestamp lastUpdated,
|
||||
@JsonProperty("entries") List<ConversationEntrySummaryDTO> entries
|
||||
) {
|
||||
this.sessionId = sessionId;
|
||||
this.userId = userId;
|
||||
this.startTime = startTime;
|
||||
this.lastUpdated = lastUpdated;
|
||||
this.entries = entries != null ? entries : Collections.emptyList();
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* 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.DecimalMax;
|
||||
import jakarta.validation.constraints.DecimalMin;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
|
||||
public record ConversationSummaryRequest(
|
||||
@NotBlank(message = "Session ID is required.")
|
||||
String sessionId,
|
||||
@NotBlank(message = "Prompt for summarization is required.")
|
||||
String prompt,
|
||||
@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,
|
||||
@DecimalMin(value = "0.1", message = "Max Output Tokens must be at least 1.")
|
||||
Integer maxOutputTokens,
|
||||
@NotBlank(message = "model is required.")
|
||||
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,13 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
public record ConversationSummaryResponse(
|
||||
@NotBlank
|
||||
String summaryText
|
||||
) {}
|
||||
Reference in New Issue
Block a user