You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
128 lines
2.8 KiB
128 lines
2.8 KiB
package com.wok.supportbot.entity;
|
|
|
|
import com.baomidou.mybatisplus.annotation.*;
|
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
|
import com.wok.supportbot.handler.PostgresJsonTypeHandler;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.Builder;
|
|
import lombok.Data;
|
|
import lombok.NoArgsConstructor;
|
|
|
|
import java.io.Serial;
|
|
import java.io.Serializable;
|
|
import java.util.Date;
|
|
import java.util.Map;
|
|
|
|
/**
|
|
* AI 大模型配置表 - 管理多套模型配置,支持不同 App 类型绑定
|
|
*/
|
|
@Data
|
|
@Builder
|
|
@AllArgsConstructor
|
|
@NoArgsConstructor
|
|
@TableName(value = "ai_model_config", autoResultMap = true)
|
|
public class AiModelConfig implements Serializable {
|
|
|
|
@Serial
|
|
@TableField(exist = false)
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
/**
|
|
* 主键ID(雪花算法)
|
|
*/
|
|
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
|
@JsonSerialize(using = ToStringSerializer.class)
|
|
private Long id;
|
|
|
|
/**
|
|
* 配置名称
|
|
*/
|
|
@TableField("name")
|
|
private String name;
|
|
|
|
/**
|
|
* 应用类型:CHAT / PRODUCT_EXTRACT / EMBEDDING / RAG_REWRITE
|
|
*/
|
|
@TableField("app_type")
|
|
private String appType;
|
|
|
|
/**
|
|
* 模型提供商(dashscope / openai / ...)
|
|
*/
|
|
@TableField("provider")
|
|
private String provider;
|
|
|
|
/**
|
|
* API Key
|
|
*/
|
|
@TableField("api_key")
|
|
private String apiKey;
|
|
|
|
/**
|
|
* 模型名称(如 qwen-turbo)
|
|
*/
|
|
@TableField("model_name")
|
|
private String modelName;
|
|
|
|
/**
|
|
* 温度参数
|
|
*/
|
|
@TableField("temperature")
|
|
private Double temperature;
|
|
|
|
/**
|
|
* 最大 Token 数
|
|
*/
|
|
@TableField("max_tokens")
|
|
private Integer maxTokens;
|
|
|
|
/**
|
|
* API 基础地址(可选,允许私有化部署)
|
|
*/
|
|
@TableField("base_url")
|
|
private String baseUrl;
|
|
|
|
/**
|
|
* 扩展配置(JSONB,存储 topP 等自定义参数)
|
|
*/
|
|
@TableField(value = "extra_config", typeHandler = PostgresJsonTypeHandler.class)
|
|
private Map<String, Object> extraConfig;
|
|
|
|
/**
|
|
* 是否为活跃配置(每种 App 类型只能有一个活跃)
|
|
*/
|
|
@TableField("is_active")
|
|
private Boolean isActive;
|
|
|
|
/**
|
|
* 优先级(数值越大越优先)
|
|
*/
|
|
@TableField("priority")
|
|
private Integer priority;
|
|
|
|
/**
|
|
* 描述说明
|
|
*/
|
|
@TableField("description")
|
|
private String description;
|
|
|
|
/**
|
|
* 创建时间
|
|
*/
|
|
@TableField(value = "create_time", fill = FieldFill.INSERT)
|
|
private Date createTime;
|
|
|
|
/**
|
|
* 更新时间
|
|
*/
|
|
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
|
|
private Date updateTime;
|
|
|
|
/**
|
|
* 删除标志 - false:未删除, true:已删除(逻辑删除)
|
|
*/
|
|
@TableField("is_delete")
|
|
@TableLogic
|
|
private boolean isDelete;
|
|
}
|