Bug Rag Ranker (sometimes the Rank for a document is not only a number)

This commit is contained in:
2025-04-09 16:15:43 +02:00
parent 1e698db368
commit 7501a2d197

View File

@@ -31,7 +31,7 @@ public class RAGDocumentRanker {
rankingPrompt +="Answer with a number between 1 and 10 and nothing else.";
OlympusChatClientResponse resp = chatClient.getChatCompletion(rankingPrompt);
String rank = resp.getContent();
String rank = resp.getContent().substring(0, 1);
int rankInt = Integer.parseInt(rank);
logger.info("Rank: " + rankInt);