From 75e6576a1341857e4db96093a47cdf97a8063eee Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Tue, 6 Aug 2024 11:00:54 +0530 Subject: [PATCH] Updated docs Signed-off-by: Amith Koujalgi --- docs/docs/intro.md | 20 +++++++++++++++++++- docs/docusaurus.config.js | 6 ++++++ docs/package-lock.json | 1 + docs/package.json | 1 + 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/docs/docs/intro.md b/docs/docs/intro.md index 77ada7b..bd8284e 100644 --- a/docs/docs/intro.md +++ b/docs/docs/intro.md @@ -118,6 +118,24 @@ Create a new Java class in your project and add this code. ```java import io.github.ollama4j.OllamaAPI; +public class OllamaAPITest { + + public static void main(String[] args) { + OllamaAPI ollamaAPI = new OllamaAPI(); + + boolean isOllamaServerReachable = ollamaAPI.ping(); + + System.out.println("Is Ollama server running: " + isOllamaServerReachable); + } +} +``` +This uses the default Ollama host as `http://localhost:11434`. + +Specify a different Ollama host that you want to connect to. + +```java +import io.github.ollama4j.OllamaAPI; + public class OllamaAPITest { public static void main(String[] args) { @@ -129,7 +147,7 @@ public class OllamaAPITest { boolean isOllamaServerReachable = ollamaAPI.ping(); - System.out.println("Is Ollama server alive: " + isOllamaServerReachable); + System.out.println("Is Ollama server running: " + isOllamaServerReachable); } } ``` diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 341048c..0559d8f 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -37,6 +37,12 @@ const config = { presets: [ [ 'classic', + { + gtag: { + trackingID: 'G-G7FLH6FNDC', + anonymizeIP: false, + }, + }, /** @type {import('@docusaurus/preset-classic').Options} */ ({ docs: { diff --git a/docs/package-lock.json b/docs/package-lock.json index c8d9030..7b3b955 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -9,6 +9,7 @@ "version": "0.0.0", "dependencies": { "@docusaurus/core": "^3.4.0", + "@docusaurus/plugin-google-gtag": "^3.4.0", "@docusaurus/preset-classic": "^3.4.0", "@docusaurus/theme-mermaid": "^3.4.0", "@mdx-js/react": "^3.0.0", diff --git a/docs/package.json b/docs/package.json index f12e34e..1fb6854 100644 --- a/docs/package.json +++ b/docs/package.json @@ -15,6 +15,7 @@ }, "dependencies": { "@docusaurus/core": "^3.4.0", + "@docusaurus/plugin-google-gtag": "^3.4.0", "@docusaurus/preset-classic": "^3.4.0", "@docusaurus/theme-mermaid": "^3.4.0", "@mdx-js/react": "^3.0.0",