package com.lideeyunji.tool.framework.ai.service.factor;


import com.lideeyunji.tool.framework.ai.chat.deepseek.DeepSeekChatService;
import com.lideeyunji.tool.framework.ai.chat.kimi.KimiChatService;
import com.lideeyunji.tool.framework.ai.service.Configuration;
import com.lideeyunji.tool.framework.ai.service.IChatService;
import com.lideeyunji.tool.framework.ai.service.PlatformType;
import com.lideeyunji.tool.framework.ai.websearch.ChatWithWebSearchEnhance;


public class AiService {

    private final Configuration configuration;

    public AiService(Configuration configuration) {
        this.configuration = configuration;
    }

    public IChatService getChatService(PlatformType platform) {
        return createChatService(platform);
    }

    public IChatService webSearchEnhance(IChatService chatService) {
        return new ChatWithWebSearchEnhance(chatService, configuration);
    }

    private IChatService createChatService(PlatformType platform) {
        switch (platform) {
            case KIMI:
                return new KimiChatService(configuration);
            case DEEPSEEK:
                return new DeepSeekChatService(configuration);
            default:
                throw new IllegalArgumentException("Unknown platform: " + platform);
        }
    }






}
