package org.dromara.knowledge.retrieval;

import lombok.RequiredArgsConstructor;
import org.dromara.knowledge.domain.vo.KnowledgeSearchResultVo;
import org.dromara.knowledge.service.KnowledgeVectorService;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@RequiredArgsConstructor
public class DefaultRetriever implements Retriever {
    private final KnowledgeVectorService knowledgeVectorService;

    @Override
    public List<KnowledgeSearchResultVo> search(String knowledgeId, String query, String model, int topK, double threshold) {
        return knowledgeVectorService.vectorSimilaritySearch(knowledgeId, query, model, topK, threshold);
    }
}

