From 4fc73b32cec6461094ab1a0526ec325450c4bcae Mon Sep 17 00:00:00 2001 From: oM <119602009+omcodedthis@users.noreply.github.com> Date: Tue, 19 Dec 2023 15:31:58 +0800 Subject: [PATCH] Update README.md --- README.md | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3ac83c6..ddb3166 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,17 @@ your `pom.xml`: ``` +You should also include [SL4J](https://www.slf4j.org/) in your `pom.xml` file if you encounter any errors related to this. + +```xml + + + org.slf4j + slf4j-jdk14 + 2.0.9 + +``` + #### Build: Build your project to resolve the dependencies: @@ -236,8 +247,8 @@ public class Main { public static void main(String[] args) { String host = "http://localhost:11434/"; OllamaAPI ollamaAPI = new OllamaAPI(host); - String response = ollamaAPI.ask(OllamaModelType.LLAMA2, "Who are you?"); - System.out.println(response); + OllamaResult response = ollamaAPI.ask(OllamaModelType.LLAMA2, "Who are you?"); + System.out.println(response.getResponse()); } } ``` @@ -285,8 +296,8 @@ public class Main { OllamaAPI ollamaAPI = new OllamaAPI(host); String prompt = "List all cricket world cup teams of 2019."; - String response = ollamaAPI.ask(OllamaModelType.LLAMA2, prompt); - System.out.println(response); + OllamaResult response = ollamaAPI.ask(OllamaModelType.LLAMA2, prompt); + System.out.println(response.getResponse()); } } ``` @@ -322,8 +333,8 @@ public class Main { String prompt = SamplePrompts.getSampleDatabasePromptWithQuestion( "List all customer names who have bought one or more products"); - String response = ollamaAPI.ask(OllamaModelType.SQLCODER, prompt); - System.out.println(response); + OllamaResult response = ollamaAPI.ask(OllamaModelType.SQLCODER, prompt); + System.out.println(response.getResponse()); } } ```