20 小时以前 c9172960bda01fca866969cc6ec4ca126eb97104
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package cn.iocoder.yudao.module.ai.enums.model;
 
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
 
/**
 * AI 模型平台
 */
@Getter
@AllArgsConstructor
public enum AiPlatformEnum implements ArrayValuable<String> {
 
    TONG_YI("TongYi", "通义千问"),
    DEEP_SEEK("DeepSeek", "DeepSeek"),
    OPENAI("OpenAI", "OpenAI"),
    OLLAMA("Ollama", "Ollama");
 
    private final String platform;
    private final String name;
 
    public static final String[] ARRAYS = Arrays.stream(values()).map(AiPlatformEnum::getPlatform).toArray(String[]::new);
 
    public static AiPlatformEnum validatePlatform(String platform) {
        for (AiPlatformEnum e : values()) {
            if (e.getPlatform().equals(platform)) return e;
        }
        throw new IllegalArgumentException("非法平台:" + platform);
    }
 
    @Override
    public String[] array() { return ARRAYS; }
 
}