forked from Mirror/ollama4j
Updated docs
Signed-off-by: Amith Koujalgi <koujalgi.amith@gmail.com>
This commit is contained in:
parent
51dd3f3e1e
commit
75e6576a13
@ -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);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
@ -37,6 +37,12 @@ const config = {
|
||||
presets: [
|
||||
[
|
||||
'classic',
|
||||
{
|
||||
gtag: {
|
||||
trackingID: 'G-G7FLH6FNDC',
|
||||
anonymizeIP: false,
|
||||
},
|
||||
},
|
||||
/** @type {import('@docusaurus/preset-classic').Options} */
|
||||
({
|
||||
docs: {
|
||||
|
1
docs/package-lock.json
generated
1
docs/package-lock.json
generated
@ -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",
|
||||
|
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user