Files
lablesys_backend/src/main/java/com/labelsys/backend/entity/AnnotationAgentConfig.java

160 lines
4.5 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.labelsys.backend.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.databind.JsonNode;
import com.labelsys.backend.util.SM4Util;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("annotation_agent_configs")
public class AnnotationAgentConfig {
@TableId(type = IdType.AUTO)
private Long id;
@TableField("company_id")
private Long companyId; // 所属公司ID来源于annotation_task.company_id
@TableField("agent_type")
private String agentType; // Agent角色: extract(抽取/Analyzer+Regenerator) / verify(校验/Reviewer) / industry(行业识别) / hallucination(幻觉检测)
@TableField("model_config_id")
private Long modelConfigId; // 模型配置来源ID外键引用sys_config.id任务启动时从sys_config(config_type=MODEL, status=ENABLED)获取
@TableField("model_name")
private String modelName; // 模型名称快照,如: qwen-max / glm-4 / claude-3-opus
@TableField("model_url")
private String modelUrl; // 模型调用地址快照
@TableField("model_api_key")
private String modelApiKey; // 模型调用密钥快照(需要加密存储)
@TableField("prompt_config_id")
private Long promptConfigId; // Prompt配置来源ID外键引用sys_config.id任务启动时从sys_config(config_type=PROMPT, status=ENABLED)获取
@TableField("prompt_text")
private String promptText; // Prompt文本快照任务执行期间实际使用的提示词
@TableField(value = "config_snapshot", typeHandler = JacksonTypeHandler.class)
private JsonNode configSnapshot; // 完整配置快照JSON包含temperature、max_tokens等运行时参数
@TableField("created_at")
private LocalDateTime createdAt; // 快照创建时间
@TableField("llm_type")
private String llmType; // LLM类型text, audio, video, image等默认为'text'
// Getter和Setter方法
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getCompanyId() {
return companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public String getAgentType() {
return agentType;
}
public void setAgentType(String agentType) {
this.agentType = agentType;
}
public Long getModelConfigId() {
return modelConfigId;
}
public void setModelConfigId(Long modelConfigId) {
this.modelConfigId = modelConfigId;
}
public String getModelName() {
return modelName;
}
public void setModelName(String modelName) {
this.modelName = modelName;
}
public String getModelUrl() {
return modelUrl;
}
public void setModelUrl(String modelUrl) {
this.modelUrl = modelUrl;
}
public String getModelApiKey() {
if (this.modelApiKey != null) {
return SM4Util.decryptSafe(this.modelApiKey); // 解密返回
}
return null;
}
public void setModelApiKey(String modelApiKey) {
if (modelApiKey != null) {
this.modelApiKey = SM4Util.encrypt(modelApiKey); // 加密存储
}
}
public Long getPromptConfigId() {
return promptConfigId;
}
public void setPromptConfigId(Long promptConfigId) {
this.promptConfigId = promptConfigId;
}
public String getPromptText() {
return promptText;
}
public void setPromptText(String promptText) {
this.promptText = promptText;
}
public JsonNode getConfigSnapshot() {
return configSnapshot;
}
public void setConfigSnapshot(JsonNode configSnapshot) {
this.configSnapshot = configSnapshot;
}
public LocalDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(LocalDateTime createdAt) {
this.createdAt = createdAt;
}
public String getLlmType() {
return llmType;
}
public void setLlmType(String llmType) {
this.llmType = llmType;
}
}