办学质量监测教学评价系统
ageerle
2025-04-11 37a8b7dad32dbbad4e28ecd15dabd3147be03665
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package org.ruoyi.chat.factory;
 
 
import lombok.extern.slf4j.Slf4j;
import org.ruoyi.chat.service.chat.IChatService;
import org.ruoyi.chat.service.chat.impl.OllamaServiceImpl;
import org.ruoyi.chat.service.chat.impl.OpenAIServiceImpl;
 
import org.springframework.stereotype.Component;
 
@Component
@Slf4j
public class SseServiceFactory {
 
    public IChatService getSseService(String type) {
        if ("openai".equals(type)) {
            return new OpenAIServiceImpl();
        } else if ("ollama".equals(type)) {
            return new OllamaServiceImpl();
        } else {
            throw new IllegalArgumentException("Unknown type: " + type);
        }
    }
}