扫描
This commit is contained in:
144
src/main/java/com/senmesh/sdk/dify/dto/DifyChatResponse.java
Normal file
144
src/main/java/com/senmesh/sdk/dify/dto/DifyChatResponse.java
Normal file
@@ -0,0 +1,144 @@
|
||||
package com.senmesh.sdk.dify.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* Dify对话响应
|
||||
*
|
||||
* @author sr
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class DifyChatResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 消息ID */
|
||||
private String messageId;
|
||||
|
||||
/** 会话ID */
|
||||
private String conversationId;
|
||||
|
||||
/** 模式 */
|
||||
private String mode;
|
||||
|
||||
/** 回答内容 */
|
||||
private String answer;
|
||||
|
||||
/** 元数据 */
|
||||
private Metadata metadata;
|
||||
|
||||
/** 创建时间 */
|
||||
private Long createdAt;
|
||||
|
||||
/**
|
||||
* 元数据
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public static class Metadata implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 使用量 */
|
||||
private Usage usage;
|
||||
|
||||
/** 检索器资源 */
|
||||
private List<RetrieverResource> retrieverResources;
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用量
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public static class Usage implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 提示词token数 */
|
||||
private Integer promptTokens;
|
||||
|
||||
/** 提示词单位价格 */
|
||||
private String promptUnitPrice;
|
||||
|
||||
/** 提示词价格单位 */
|
||||
private String promptPriceUnit;
|
||||
|
||||
/** 提示词价格 */
|
||||
private String promptPrice;
|
||||
|
||||
/** 完成token数 */
|
||||
private Integer completionTokens;
|
||||
|
||||
/** 完成单位价格 */
|
||||
private String completionUnitPrice;
|
||||
|
||||
/** 完成价格单位 */
|
||||
private String completionPriceUnit;
|
||||
|
||||
/** 完成价格 */
|
||||
private String completionPrice;
|
||||
|
||||
/** 总token数 */
|
||||
private Integer totalTokens;
|
||||
|
||||
/** 总价格 */
|
||||
private String totalPrice;
|
||||
|
||||
/** 货币 */
|
||||
private String currency;
|
||||
|
||||
/** 延迟(毫秒) */
|
||||
private Double latency;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检索器资源
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public static class RetrieverResource implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 位置 */
|
||||
private Integer position;
|
||||
|
||||
/** 数据集ID */
|
||||
private String datasetId;
|
||||
|
||||
/** 数据集名称 */
|
||||
private String datasetName;
|
||||
|
||||
/** 文档ID */
|
||||
private String documentId;
|
||||
|
||||
/** 文档名称 */
|
||||
private String documentName;
|
||||
|
||||
/** 分段ID */
|
||||
private String segmentId;
|
||||
|
||||
/** 分数 */
|
||||
private Double score;
|
||||
|
||||
/** 内容 */
|
||||
private String content;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user