Commit 266b6faa85dd79216886ec3fdc78c3aa572a05d6
1 parent
471968ea
【代码优化】AI:移除 AiModelEnum 枚举
Showing
5 changed files
with
2 additions
and
81 deletions
yudao-module-ai/yudao-module-ai-api/src/main/java/cn/iocoder/yudao/module/ai/enums/model/AiModelEnum.java deleted
| 1 | -package cn.iocoder.yudao.module.ai.enums.model; | ||
| 2 | - | ||
| 3 | -import lombok.AllArgsConstructor; | ||
| 4 | -import lombok.Getter; | ||
| 5 | - | ||
| 6 | -// TODO @芋艿:可以考虑清理掉 | ||
| 7 | -/** | ||
| 8 | - * ai 模型 | ||
| 9 | - * | ||
| 10 | - * @author: fansili | ||
| 11 | - * @time: 2024/3/4 12:36 | ||
| 12 | - */ | ||
| 13 | -@Getter | ||
| 14 | -@AllArgsConstructor | ||
| 15 | -public enum AiModelEnum { | ||
| 16 | - | ||
| 17 | - // open ai | ||
| 18 | - OPEN_AI_GPT_3_5( "GPT3.5", "gpt-3.5-turbo",null), | ||
| 19 | - OPEN_AI_GPT_4("GPT4", "gpt-4-turbo",null), | ||
| 20 | - | ||
| 21 | - // 千问付费模型 | ||
| 22 | - QWEN_TURBO("通义千问超大规模语言模型", "qwen-turbo", null), | ||
| 23 | - QWEN_PLUS("通义千问超大规模语言模型增强版", "qwen-plus", null), | ||
| 24 | - QWEN_MAX("通义千问千亿级别超大规模语言模型", "qwen-max", null), | ||
| 25 | - QWEN_MAX_0403("通义千问千亿级别超大规模语言模型-0403", "qwen-max-0403", null), | ||
| 26 | - QWEN_MAX_0107("通义千问千亿级别超大规模语言模型-0107", "qwen-max-0107", null), | ||
| 27 | - QWEN_MAX_1201("通义千问千亿级别超大规模语言模型-1201", "qwen-max-1201", null), | ||
| 28 | - QWEN_MAX_LONGCONTEXT("通义千问千亿级别超大规模语言模型-28k tokens", "qwen-max-longcontext", null), | ||
| 29 | - | ||
| 30 | - // 千问开源模型 | ||
| 31 | - // https://help.aliyun.com/document_detail/2666503.html?spm=a2c4g.2701795.0.0.26eb34dfKzcWN4 | ||
| 32 | - QWEN_72B_CHAT("通义千问1.5对外开源的72B规模参数量的经过人类指令对齐的chat模型", "qwen-72b-chat", null), | ||
| 33 | - | ||
| 34 | - // 一言模型 | ||
| 35 | - ERNIE4_0("ERNIE 4.0", "ERNIE 4.0", "/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions_pro"), | ||
| 36 | - ERNIE4_3_5_8K("ERNIE-3.5-8K", "ERNIE-3.5-8K", "/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions"), | ||
| 37 | - ERNIE4_3_5_8K_0205("ERNIE-3.5-8K-0205", "ERNIE-3.5-8K-0205", "/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/ernie-3.5-8k-0205"), | ||
| 38 | - | ||
| 39 | - ERNIE4_3_5_8K_1222("ERNIE-3.5-8K-1222", "ERNIE-3.5-8K-1222", "/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/ernie-3.5-8k-1222"), | ||
| 40 | - ERNIE4_BOT_8K("ERNIE-Bot-8K", "ERNIE-Bot-8K", "/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/ernie_bot_8k"), | ||
| 41 | - ERNIE4_3_5_4K_0205("ERNIE-3.5-4K-0205", "ERNIE-3.5-4K-0205", "/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/ernie-3.5-4k-0205"), | ||
| 42 | - | ||
| 43 | -// 文档地址:https://www.xfyun.cn/doc/spark/Web.html#_1-%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E | ||
| 44 | -// general指向V1.5版本; | ||
| 45 | -// generalv2指向V2版本; | ||
| 46 | -// generalv3指向V3版本; | ||
| 47 | -// generalv3.5指向V3.5版本; | ||
| 48 | - | ||
| 49 | - XING_HUO_1_5("星火大模型1.5", "general", "/v1.1/chat"), | ||
| 50 | - XING_HUO_2_0("星火大模型2.0", "generalv2", "/v2.1/chat"), | ||
| 51 | - XING_HUO_3_0("星火大模型3.0", "generalv3", "/v3.1/chat"), | ||
| 52 | - XING_HUO_3_5("星火大模型3.5", "generalv3.5", "/v3.5/chat"), | ||
| 53 | - | ||
| 54 | - // Suno 模型 | ||
| 55 | - SUNO_2( "SUNO-2", "chirp-v2-xxl-alpha",null), | ||
| 56 | - SUNO_3_0( "SUNO-3.0", "chirp-v3-0",null), | ||
| 57 | - SUNO_3_5( "SUNO-3.5", "chirp-v3-5",null), | ||
| 58 | - ; | ||
| 59 | - | ||
| 60 | - /** | ||
| 61 | - * 模型名字 - 用于展示 | ||
| 62 | - */ | ||
| 63 | - private final String name; | ||
| 64 | - /** | ||
| 65 | - * 模型标志 - 用于参数传递 | ||
| 66 | - */ | ||
| 67 | - private final String model; | ||
| 68 | - /** | ||
| 69 | - * uri地址 | ||
| 70 | - */ | ||
| 71 | - private final String uri; | ||
| 72 | - | ||
| 73 | -} |
yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/chat/vo/message/AiChatMessageRespVO.java
| @@ -28,7 +28,7 @@ public class AiChatMessageRespVO { | @@ -28,7 +28,7 @@ public class AiChatMessageRespVO { | ||
| 28 | private Long roleId; | 28 | private Long roleId; |
| 29 | 29 | ||
| 30 | @Schema(description = "模型标志", requiredMode = Schema.RequiredMode.REQUIRED, example = "gpt-3.5-turbo") | 30 | @Schema(description = "模型标志", requiredMode = Schema.RequiredMode.REQUIRED, example = "gpt-3.5-turbo") |
| 31 | - private String model; // 参见 AiOpenAiModelEnum 枚举类 | 31 | + private String model; |
| 32 | 32 | ||
| 33 | @Schema(description = "模型编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "123") | 33 | @Schema(description = "模型编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "123") |
| 34 | private Long modelId; | 34 | private Long modelId; |
yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/music/vo/AiSunoGenerateReqVO.java
| @@ -46,7 +46,7 @@ public class AiSunoGenerateReqVO { | @@ -46,7 +46,7 @@ public class AiSunoGenerateReqVO { | ||
| 46 | 46 | ||
| 47 | @Schema(description = "模型", requiredMode = Schema.RequiredMode.REQUIRED, example = "chirp-v3.5") | 47 | @Schema(description = "模型", requiredMode = Schema.RequiredMode.REQUIRED, example = "chirp-v3.5") |
| 48 | @NotEmpty(message = "模型不能为空") | 48 | @NotEmpty(message = "模型不能为空") |
| 49 | - private String model; // 参见 AiModelEnum 枚举 | 49 | + private String model; |
| 50 | 50 | ||
| 51 | @Schema(description = "音乐风格", example = "[\"pop\",\"jazz\",\"punk\"]") | 51 | @Schema(description = "音乐风格", example = "[\"pop\",\"jazz\",\"punk\"]") |
| 52 | private List<String> tags; | 52 | private List<String> tags; |
yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/chat/AiChatConversationDO.java
| @@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.ai.dal.dataobject.chat; | @@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.ai.dal.dataobject.chat; | ||
| 3 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | 3 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| 4 | import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiChatModelDO; | 4 | import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiChatModelDO; |
| 5 | import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiChatRoleDO; | 5 | import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiChatRoleDO; |
| 6 | -import cn.iocoder.yudao.module.ai.enums.model.AiModelEnum; | ||
| 7 | import com.baomidou.mybatisplus.annotation.KeySequence; | 6 | import com.baomidou.mybatisplus.annotation.KeySequence; |
| 8 | import com.baomidou.mybatisplus.annotation.TableId; | 7 | import com.baomidou.mybatisplus.annotation.TableId; |
| 9 | import com.baomidou.mybatisplus.annotation.TableName; | 8 | import com.baomidou.mybatisplus.annotation.TableName; |
| @@ -73,8 +72,6 @@ public class AiChatConversationDO extends BaseDO { | @@ -73,8 +72,6 @@ public class AiChatConversationDO extends BaseDO { | ||
| 73 | private Long modelId; | 72 | private Long modelId; |
| 74 | /** | 73 | /** |
| 75 | * 模型标志 | 74 | * 模型标志 |
| 76 | - * | ||
| 77 | - * 枚举 {@link AiModelEnum} | ||
| 78 | */ | 75 | */ |
| 79 | private String model; | 76 | private String model; |
| 80 | 77 |
yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/chat/AiChatMessageDO.java
| @@ -5,7 +5,6 @@ import org.springframework.ai.chat.messages.MessageType; | @@ -5,7 +5,6 @@ import org.springframework.ai.chat.messages.MessageType; | ||
| 5 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | 5 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| 6 | import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiChatModelDO; | 6 | import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiChatModelDO; |
| 7 | import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiChatRoleDO; | 7 | import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiChatRoleDO; |
| 8 | -import cn.iocoder.yudao.module.ai.enums.model.AiModelEnum; | ||
| 9 | import com.baomidou.mybatisplus.annotation.KeySequence; | 8 | import com.baomidou.mybatisplus.annotation.KeySequence; |
| 10 | import com.baomidou.mybatisplus.annotation.TableName; | 9 | import com.baomidou.mybatisplus.annotation.TableName; |
| 11 | import lombok.*; | 10 | import lombok.*; |
| @@ -69,8 +68,6 @@ public class AiChatMessageDO extends BaseDO { | @@ -69,8 +68,6 @@ public class AiChatMessageDO extends BaseDO { | ||
| 69 | 68 | ||
| 70 | /** | 69 | /** |
| 71 | * 模型标志 | 70 | * 模型标志 |
| 72 | - * | ||
| 73 | - * 枚举 {@link AiModelEnum} | ||
| 74 | */ | 71 | */ |
| 75 | private String model; | 72 | private String model; |
| 76 | /** | 73 | /** |