package com.seer.teach.teacher.resolver;

import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@Component
public class PromptVariableResolverRegistry {

     private final Map<String, PromptVariableResolver> resolverMap = new ConcurrentHashMap<>();

    public PromptVariableResolverRegistry(List<PromptVariableResolver> resolvers) {
        resolvers.forEach(r -> resolverMap.put(r.supportKey(), r));
    }

    public PromptVariableResolver get(String key) {
        return resolverMap.get(key);
    }
}