/**
 * @ProjectName: 智慧评标-主观分助手
 * @Package: com.zhpb.gdyd_zhpb_zgf.config
 * @ClassName: AIModelConfig
 * @Description: AI模型配置类
 * @Author: 张志锋
 * @Date: 2025-11-05
 * @Version: 1.0
 * @Copyright: © 2025 智慧评标-主观分助手
 */
package com.zhpb.gdyd_zhpb_zgf.config;

import com.zhpb.gdyd_zhpb_zgf.service.AIModelService;
import com.zhpb.gdyd_zhpb_zgf.service.impl.DeepSeekServiceImpl;
import com.zhpb.gdyd_zhpb_zgf.service.impl.PrivateModelServiceImpl;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

/**
 * AI模型配置类
 */
@Configuration
public class AIModelConfig {

    @Value("${ai.model-type:public}")
    private String modelType;

    /**
     * 根据配置选择使用的AI模型服务
     */
    @Bean
    @Primary
    public AIModelService aiModelService(DeepSeekServiceImpl deepSeekService,
                                       PrivateModelServiceImpl privateModelService) {
        if ("private".equalsIgnoreCase(modelType)) {
            return privateModelService;
        } else {
            return deepSeekService;
        }
    }
}
