package tech.easyflow.ai.rag;

import tech.easyflow.common.util.StringUtil;
import tech.easyflow.common.web.exceptions.BusinessException;

public enum KeywordEngineType {
    ES,
    LUCENE;

    public static KeywordEngineType from(String value) {
        if (StringUtil.noText(value)) {
            return ES;
        }
        for (KeywordEngineType type : values()) {
            if (type.name().equalsIgnoreCase(value.trim())) {
                return type;
            }
        }
        throw new BusinessException("不支持的关键词检索引擎: " + value);
    }
}
