From 434e4c58398367bbf37ad79565f919c6a947f8f5 Mon Sep 17 00:00:00 2001 From: Raja Kolli Date: Mon, 27 May 2024 06:01:40 +0000 Subject: [PATCH] tweak prompt for more data accuracy --- .../example/chatbot/ChatbotOllamaApplicationTests.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/chatbot-ollama-springai/src/test/java/com/example/chatbot/ChatbotOllamaApplicationTests.java b/chatbot-ollama-springai/src/test/java/com/example/chatbot/ChatbotOllamaApplicationTests.java index 30a0806..cf449a8 100644 --- a/chatbot-ollama-springai/src/test/java/com/example/chatbot/ChatbotOllamaApplicationTests.java +++ b/chatbot-ollama-springai/src/test/java/com/example/chatbot/ChatbotOllamaApplicationTests.java @@ -42,7 +42,9 @@ void contextLoads() { @Test void chat() { given().contentType(ContentType.JSON) - .body(new AIChatRequest("How many cricket centuries did Sachin Tendulkar scored ?")) + .body( + new AIChatRequest( + "As a cricketer, how many centuries did Sachin Tendulkar scored adding up both One Day International (ODI) and Test centuries ?")) .when() .post("/api/ai/chat") .then() @@ -51,12 +53,12 @@ void chat() { .body("answer", containsString("100")); given().contentType(ContentType.JSON) - .body(new AIChatRequest("What is his age ?")) + .body(new AIChatRequest("How many One Day International (ODI) centuries did he scored ?")) .when() .post("/api/ai/chat") .then() .statusCode(HttpStatus.SC_OK) .contentType(ContentType.JSON) - .body("answer", containsString("50")); + .body("answer", containsString("49")); } }