[feature][headless-chat]Introduce ChatApp to support more flexible chat model config.#1739

This commit is contained in:
jerryjzhang
2024-10-12 13:00:44 +08:00
parent 0cce0a76b4
commit 3501f592e7
11 changed files with 16 additions and 32 deletions

View File

@@ -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);
}