Bug Rag Ranker (sometimes the Rank for a document is not only a number)
This commit is contained in:
@@ -31,7 +31,7 @@ public class RAGDocumentRanker {
|
|||||||
rankingPrompt +="Answer with a number between 1 and 10 and nothing else.";
|
rankingPrompt +="Answer with a number between 1 and 10 and nothing else.";
|
||||||
|
|
||||||
OlympusChatClientResponse resp = chatClient.getChatCompletion(rankingPrompt);
|
OlympusChatClientResponse resp = chatClient.getChatCompletion(rankingPrompt);
|
||||||
String rank = resp.getContent();
|
String rank = resp.getContent().substring(0, 1);
|
||||||
|
|
||||||
int rankInt = Integer.parseInt(rank);
|
int rankInt = Integer.parseInt(rank);
|
||||||
logger.info("Rank: " + rankInt);
|
logger.info("Rank: " + rankInt);
|
||||||
|
|||||||
Reference in New Issue
Block a user