mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-13 04:57:28 +00:00
[feature][headless-chat]Introduce ChatApp to support more flexible chat model config.#1739
This commit is contained in:
@@ -1,19 +1,14 @@
|
||||
package com.tencent.supersonic.common.util;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.tencent.supersonic.common.pojo.ChatApp;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class ChatAppManager {
|
||||
private static final Map<String, ChatApp> chatApps = Maps.newConcurrentMap();
|
||||
|
||||
public static void register(ChatApp chatApp) {
|
||||
if (chatApps.containsKey(chatApp.getKey())) {
|
||||
throw new RuntimeException("Duplicate chat app key is disallowed.");
|
||||
}
|
||||
chatApps.put(chatApp.getKey(), chatApp);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user