package com.agent.management.repository;

import com.agent.management.model.entity.RagQueryExample;
import com.agent.management.rag.model.RagSourceType;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
import java.util.Optional;

public interface RagQueryExampleRepository extends JpaRepository<RagQueryExample, Long> {
    List<RagQueryExample> findBySourceTypeAndSourceIdAndVerifiedTrue(RagSourceType sourceType, String sourceId);
    List<RagQueryExample> findBySourceTypeAndSourceId(RagSourceType sourceType, String sourceId);
    Optional<RagQueryExample> findFirstBySourceTypeAndSourceIdAndQuestionAndQueryText(
            RagSourceType sourceType, String sourceId, String question, String queryText);
}
