package com.jeelowcode.framework.ai.service.factor;


import com.jeelowcode.framework.ai.platform.chat.deepseek.DeepSeekChatService;
import com.jeelowcode.framework.ai.platform.chat.kimi.KimiChatService;
import com.jeelowcode.framework.ai.service.Configuration;
import com.jeelowcode.framework.ai.service.IChatService;
import com.jeelowcode.framework.ai.service.PlatformType;
import com.jeelowcode.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);
        }
    }






}
