Files
common_agent/src/main/java/com/bruce/modelprovider/entity/ModelConfig.java

89 lines
3.2 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.bruce.modelprovider.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bruce.common.domain.model.BaseEntity;
import com.bruce.rag.typehandler.PgJsonbStringTypeHandler;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* 模型配置实体。
* <p>
* 每条记录描述某个服务商下的一个具体模型,包含模型类型、能力、价格和默认参数。
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "model_config", autoResultMap = true)
/**
* ModelConfig负责模型平台对应层的职责。
*/
public class ModelConfig extends BaseEntity {
/** 数据库字段provider_id关联的服务商ID。 */
@TableField(value = "provider_id")
private Long providerId;
/** 数据库字段model_code模型编码在同一服务商下唯一。 */
@TableField(value = "model_code")
private String modelCode;
/** 数据库字段model_name模型展示名称。 */
@TableField(value = "model_name")
private String modelName;
/** 数据库字段upstream_model上游真实模型名例如 Qwen/Qwen3-Embedding-0.6B)。 */
@TableField(value = "upstream_model")
private String upstreamModel;
/** 数据库字段model_type模型类型例如 CHAT / EMBEDDING / RERANK / MULTIMODAL。 */
@TableField(value = "model_type")
private String modelType;
/** 数据库字段context_window上下文窗口大小。 */
@TableField(value = "context_window")
private Integer contextWindow;
/** 数据库字段max_output_tokens单次输出 token 上限)。 */
@TableField(value = "max_output_tokens")
private Integer maxOutputTokens;
/** 数据库字段embedding_dimension向量维度仅 EMBEDDING 模型使用)。 */
@TableField(value = "embedding_dimension")
private Integer embeddingDimension;
/** 数据库字段input_price_per_1k输入单价每 1k token。 */
@TableField(value = "input_price_per_1k")
private BigDecimal inputPricePer1k;
/** 数据库字段output_price_per_1k输出单价每 1k token。 */
@TableField(value = "output_price_per_1k")
private BigDecimal outputPricePer1k;
/** 数据库字段local_model是否本地模型如自建 Ollama。 */
@TableField(value = "local_model")
private Boolean localModel;
/** 数据库字段default_model是否该类型默认模型。 */
@TableField(value = "default_model")
private Boolean defaultModel;
/** 数据库字段capabilities_json能力标签JSON例如是否支持工具调用、视觉能力等。 */
@TableField(value = "capabilities_json", typeHandler = PgJsonbStringTypeHandler.class)
private String capabilitiesJson;
/** 数据库字段options_json默认调用参数JSON例如 temperature、dimensions。 */
@TableField(value = "options_json", typeHandler = PgJsonbStringTypeHandler.class)
private String optionsJson;
/** 是否启用该模型。 */
private Boolean enabled;
/** 备注信息。 */
private String remark;
}