package com.easyagents.agent.runtime.knowledge;

import java.util.Objects;

/**
 * 知识库声明与检索器的运行时绑定。
 */
public final class AgentKnowledgeRegistration {

    private final AgentKnowledgeSpec knowledgeSpec;
    private final AgentKnowledgeRetriever retriever;

    /**
     * 创建知识库运行时绑定。
     *
     * @param knowledgeSpec 知识库声明
     * @param retriever 知识库检索器
     * @throws NullPointerException 声明或检索器为空时抛出
     */
    public AgentKnowledgeRegistration(AgentKnowledgeSpec knowledgeSpec,
                                      AgentKnowledgeRetriever retriever) {
        this.knowledgeSpec = Objects.requireNonNull(knowledgeSpec, "knowledgeSpec");
        this.retriever = Objects.requireNonNull(retriever, "retriever");
    }

    /**
     * 获取知识库声明。
     *
     * @return 知识库声明
     */
    public AgentKnowledgeSpec getKnowledgeSpec() {
        return knowledgeSpec;
    }

    /**
     * 获取知识库检索器。
     *
     * @return 知识库检索器
     */
    public AgentKnowledgeRetriever getRetriever() {
        return retriever;
    }
}
