feat: Update GitRepositoryIngestor to use ingestion repository base path from application.properties

This commit is contained in:
andrea.terzani
2024-08-10 23:04:34 +02:00
parent 804153a833
commit ae444eced5
2 changed files with 9 additions and 1 deletions

View File

@@ -22,6 +22,7 @@ import org.springframework.ai.document.Document;
import org.springframework.ai.transformer.splitter.TokenTextSplitter;
import org.springframework.ai.vectorstore.VectorStore;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
@@ -33,6 +34,9 @@ import com.olympus.apollo.repository.KSGitInfoRepository;
@Service
public class GitRepositoryIngestor {
@Value("${ingestion.repository.basepath}")
private String ingestionRepositoryBasePath;
private final VectorStore vectorStore;
@Autowired
@@ -46,7 +50,7 @@ public class GitRepositoryIngestor {
@Async
public CompletableFuture<Void> ingestGitRepository(String repo) {
String repoPath = "C:\\Users\\vinayak.c.mishra\\dev\\olympus\\upload-dir\\" + repo + "\\";
String repoPath = ingestionRepositoryBasePath+"\\" + repo + "\\";
logger.info("Repository path : " + repoPath);
Optional<KSGitInfo> optionalDocument = ksGitInfoRepository.findByRepoName(repo);

View File

@@ -27,3 +27,7 @@ spring.ai.openai.api-key=sk-proj-j3TFJ0h348DIzMrYYfyUT3BlbkFJjk4HMc8A2ux2Asg8Y7H
spring.servlet.multipart.max-file-size=5000000MB
spring.servlet.multipart.max-request-size=500000MB
#path to the repository
ingestion.repository.basepath=C:\\Users\\andrea.terzani\\dev\\Olympus