| | |
| | | import dev.langchain4j.store.embedding.EmbeddingStore; |
| | | import io.pinecone.clients.Index; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.io.File; |
| | |
| | | private final FileProperties fileProperties; |
| | | private final Index pineconeIndex; |
| | | |
| | | @Value("${pinecone.namespace:knowledge-base}") |
| | | @org.springframework.beans.factory.annotation.Value("${pinecone.namespace:knowledge-base}") |
| | | private String namespace; |
| | | |
| | | public KnowledgeRagServiceImpl( |
| | |
| | | EmbeddingModel embeddingModel, |
| | | EmbeddingStore<TextSegment> embeddingStore, |
| | | FileProperties fileProperties, |
| | | Index pineconeIndex) { |
| | | @Lazy Index pineconeIndex) { |
| | | this.knowledgeBaseVectorService = knowledgeBaseVectorService; |
| | | this.storageBlobService = storageBlobService; |
| | | this.embeddingModel = embeddingModel; |
| | |
| | | metadata.put("namespace", vector.getNamespace()); |
| | | return metadata; |
| | | } |
| | | } |
| | | } |