Updated docs

Signed-off-by: Amith Koujalgi <koujalgi.amith@gmail.com>
This commit is contained in:
Amith Koujalgi 2024-08-06 11:00:54 +05:30
parent 51dd3f3e1e
commit 75e6576a13
4 changed files with 27 additions and 1 deletions

View File

@ -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);
}
}
```

View File

@ -37,6 +37,12 @@ const config = {
presets: [
[
'classic',
{
gtag: {
trackingID: 'G-G7FLH6FNDC',
anonymizeIP: false,
},
},
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {

View File

@ -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",

View File

@ -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",