Compare commits

..

9 Commits

Author SHA1 Message Date
Amith Koujalgi
e43bd3acb4 Refactored the package structure to use io.github.ollama4j instead of the old naming io.github.amithkoujalgi.ollama4j.core
Signed-off-by: Amith Koujalgi <koujalgi.amith@gmail.com>
2024-07-27 16:37:47 +05:30
Amith Koujalgi
0b041f4340 updated README.md
Signed-off-by: Amith Koujalgi <koujalgi.amith@gmail.com>
2024-07-27 15:59:23 +05:30
Amith Koujalgi
6c6062b757 updated README.md
Signed-off-by: Amith Koujalgi <koujalgi.amith@gmail.com>
2024-07-27 15:58:24 +05:30
Amith Koujalgi
68fd8b7cc8 updated README.md
Signed-off-by: Amith Koujalgi <koujalgi.amith@gmail.com>
2024-07-27 15:57:38 +05:30
Amith Koujalgi
bb6f8aa343 updated README.md
Signed-off-by: Amith Koujalgi <koujalgi.amith@gmail.com>
2024-07-27 15:56:36 +05:30
Amith Koujalgi
12802be0bc updated README.md
Signed-off-by: Amith Koujalgi <koujalgi.amith@gmail.com>
2024-07-27 15:35:35 +05:30
Amith Koujalgi
bd56ccfef7 Update README.md 2024-07-27 02:45:36 +05:30
Amith Koujalgi
51563f276f updated README.md
Signed-off-by: Amith Koujalgi <koujalgi.amith@gmail.com>
2024-07-27 00:57:55 +05:30
Amith Koujalgi
6e282124bf updated README.md
Signed-off-by: Amith Koujalgi <koujalgi.amith@gmail.com>
2024-07-27 00:56:57 +05:30
80 changed files with 382 additions and 204 deletions

1
.gitignore vendored
View File

@@ -37,6 +37,5 @@ build/
### Mac OS ###
.DS_Store
/.idea/
/src/main/java/io/github/amithkoujalgi/ollama4j/core/localtests/
pom.xml.*
release.properties

View File

@@ -21,9 +21,12 @@ Find more details on the [website](https://ollama4j.github.io/ollama4j/).
[//]: # (![JitPack Downloads This Month Badge]&#40;https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fjitpack.io%2Fapi%2Fdownloads%2Fio.github.ollama4j%2Follama4j&query=%24.month&label=JitPack%20Downloads%20-%20This%20Month&#41;)
[//]: # (![JitPack Downloads This Week Badge]&#40;https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fjitpack.io%2Fapi%2Fdownloads%2Fio.github.ollama4j%2Follama4j&query=%24.week&label=JitPack%20Downloads%20-%20This%20Week&#41;)
[//]: # (![JitPack Downloads Per Month Badge]&#40;https://jitpack.io/v/ollama4j/ollama4j/month.svg&#41;)
![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/ollama4j/ollama4j/total?label=GitHub%20Package%20Downloads)
[//]: # (![GitHub Downloads &#40;all assets, all releases&#41;]&#40;https://img.shields.io/github/downloads/ollama4j/ollama4j/total?label=GitHub%20Package%20Downloads&#41;)
![GitHub last commit](https://img.shields.io/github/last-commit/ollama4j/ollama4j?color=green)
[![codecov](https://codecov.io/gh/ollama4j/ollama4j/graph/badge.svg?token=U0TE7BGP8L)](https://codecov.io/gh/ollama4j/ollama4j)
@@ -39,7 +42,7 @@ Find more details on the [website](https://ollama4j.github.io/ollama4j/).
- [How does it work?](#how-does-it-work)
- [Requirements](#requirements)
- [Installation](#installation)
- [API Spec](https://ollama4j.github.io/ollama4j/docs/category/apis---model-management)
- [API Spec](https://ollama4j.github.io/ollama4j/category/apis---model-management)
- [Javadoc](https://ollama4j.github.io/ollama4j/apidocs/)
- [Development](#development)
- [Contributions](#get-involved)
@@ -63,7 +66,68 @@ Find more details on the [website](https://ollama4j.github.io/ollama4j/).
![Java](https://img.shields.io/badge/Java-11_+-green.svg?style=for-the-badge&labelColor=gray&label=Java&color=orange)
[![][ollama-shield]][ollama-link] **Or** [![][ollama-docker-shield]][ollama-docker]
<table>
<tr>
<td>
[![][ollama-shield]][ollama-link]
</td>
<td>
[![][ollama-docker-shield]][ollama-docker]
</td>
</tr>
<tr>
<td>
macOS
https://ollama.com/download/Ollama-darwin.zip
Linux
```shell
curl -fsSL https://ollama.com/install.sh \| sh
```
Windows
https://ollama.com/download/OllamaSetup.exe
</td>
<td>
CPU only
```shell
docker run -d -p 11434:11434 \
-v ollama:/root/.ollama \
--name ollama \
ollama/ollama
```
NVIDIA GPU
```shell
docker run -d -p 11434:11434 \
--gpus=all \
-v ollama:/root/.ollama \
--name ollama \
ollama/ollama
```
</td>
</tr>
</table>
[ollama-link]: https://ollama.ai/
@@ -76,8 +140,7 @@ Find more details on the [website](https://ollama4j.github.io/ollama4j/).
## Installation
> [!NOTE]
> We have migrated the package repository from Maven Central to GitHub package repository due to technical issues with
> publishing. Please update your repository settings to get latest version of Ollama4j.
> We are now publishing the artifacts to both Maven Central and GitHub package repositories.
>
> Track the releases [here](https://github.com/ollama4j/ollama4j/releases) and update the dependency version
> according to your requirements.
@@ -88,11 +151,11 @@ Find more details on the [website](https://ollama4j.github.io/ollama4j/).
[![][ollama4j-mvn-releases-shield]][ollama4j-mvn-releases-link]
[ollama4j-mvn-releases-link]: https://github.com/ollama4j/ollama4j/releases
[ollama4j-mvn-releases-link]: https://central.sonatype.com/artifact/io.github.ollama4j/ollama4j/overview
[ollama4j-mvn-releases-shield]: https://img.shields.io/maven-central/v/io.github.ollama4j/ollama4j?display_name=release&style=for-the-badge&label=From%20Maven%20Central%20
[ollama4j-mvn-releases-shield]: https://img.shields.io/maven-central/v/io.github.ollama4j/ollama4j?display_name=release&style=for-the-badge&label=From%20Maven%20Central
1In your Maven project, add this dependency:
In your Maven project, add this dependency:
```xml
@@ -107,9 +170,9 @@ Find more details on the [website](https://ollama4j.github.io/ollama4j/).
[![][ollama4j-releases-shield]][ollama4j-releases-link]
[ollama4j-releases-link]: https://central.sonatype.com/artifact/io.github.ollama4j/ollama4j/overview
[ollama4j-releases-link]: https://github.com/ollama4j/ollama4j/releases
[ollama4j-releases-shield]: https://img.shields.io/github/v/release/ollama4j/ollama4j?display_name=release&style=for-the-badge&label=From%20GitHub%20Packages%20
[ollama4j-releases-shield]: https://img.shields.io/github/v/release/ollama4j/ollama4j?display_name=release&style=for-the-badge&label=From%20GitHub%20Packages
1. Add `GitHub Maven Packages` repository to your project's `pom.xml` or your `settings.xml`:
@@ -159,7 +222,7 @@ Find more details on the [website](https://ollama4j.github.io/ollama4j/).
</dependency>
```
##### For Gradle
### For Gradle
1. Add the dependency

View File

@@ -58,9 +58,9 @@ elevate your projects.
I look forward to seeing the incredible applications/projects you'll build with Ollama4j! 🌟
Find the full API spec here: https://amithkoujalgi.github.io/ollama4j/
Find the full API spec here: https://ollama4j.github.io/ollama4j/
Find the Javadoc here: https://amithkoujalgi.github.io/ollama4j/apidocs/
Find the Javadoc here: https://ollama4j.github.io/ollama4j/apidocs/
Ollama4j Docs is powered by [Docusaurus](https://docusaurus.io).

View File

@@ -10,6 +10,8 @@ Ollama server would be setup behind a gateway/reverse proxy with basic auth.
After configuring basic authentication, all subsequent requests will include the Basic Auth header.
```java
import io.github.ollama4j.OllamaAPI;
public class Main {
public static void main(String[] args) {

View File

@@ -36,8 +36,9 @@ from [javadoc](https://ollama4j.github.io/ollama4j/apidocs/io/github/ollama4j/ol
## Build an empty `Options` object
```java
import io.github.amithkoujalgi.ollama4j.core.utils.Options;
import io.github.amithkoujalgi.ollama4j.core.utils.OptionsBuilder;
import io.github.ollama4j.OllamaAPI;
import io.github.ollama4j.utils.Options;
import io.github.ollama4j.utils.OptionsBuilder;
public class Main {
@@ -55,8 +56,8 @@ public class Main {
## Build the `Options` object with values
```java
import io.github.amithkoujalgi.ollama4j.core.utils.Options;
import io.github.amithkoujalgi.ollama4j.core.utils.OptionsBuilder;
import io.github.ollama4j.utils.Options;
import io.github.ollama4j.utils.OptionsBuilder;
public class Main {

View File

@@ -7,6 +7,8 @@ sidebar_position: 3
This API lets you check the reachability of Ollama server.
```java
import io.github.ollama4j.OllamaAPI;
public class Main {
public static void main(String[] args) {

View File

@@ -7,6 +7,8 @@ sidebar_position: 2
This API lets you set the request timeout for the Ollama client.
```java
import io.github.ollama4j.OllamaAPI;
public class Main {
public static void main(String[] args) {

View File

@@ -9,6 +9,8 @@ This API lets you set the verbosity of the Ollama client.
## Try asking a question about the model.
```java
import io.github.ollama4j.OllamaAPI;
public class Main {
public static void main(String[] args) {

View File

@@ -10,6 +10,13 @@ information using the history of already asked questions and the respective answ
## Create a new conversation and use chat history to augment follow up questions
```java
import io.github.ollama4j.OllamaAPI;
import io.github.ollama4j.models.chat.OllamaChatMessageRole;
import io.github.ollama4j.models.chat.OllamaChatRequestBuilder;
import io.github.ollama4j.models.chat.OllamaChatRequestModel;
import io.github.ollama4j.models.chat.OllamaChatResult;
import io.github.ollama4j.types.OllamaModelType;
public class Main {
public static void main(String[] args) {
@@ -78,6 +85,14 @@ You will get a response similar to:
## Create a conversation where the answer is streamed
```java
import io.github.ollama4j.OllamaAPI;
import io.github.ollama4j.models.chat.OllamaChatMessageRole;
import io.github.ollama4j.models.chat.OllamaChatRequestBuilder;
import io.github.ollama4j.models.chat.OllamaChatRequestModel;
import io.github.ollama4j.models.chat.OllamaChatResult;
import io.github.ollama4j.models.generate.OllamaStreamHandler;
public class Main {
public static void main(String[] args) {
@@ -113,7 +128,13 @@ You will get a response similar to:
## Use a simple Console Output Stream Handler
```java
import io.github.amithkoujalgi.ollama4j.core.impl.ConsoleOutputStreamHandler;
import io.github.ollama4j.OllamaAPI;
import io.github.ollama4j.impl.ConsoleOutputStreamHandler;
import io.github.ollama4j.models.chat.OllamaChatMessageRole;
import io.github.ollama4j.models.chat.OllamaChatRequestBuilder;
import io.github.ollama4j.models.chat.OllamaChatRequestModel;
import io.github.ollama4j.models.generate.OllamaStreamHandler;
import io.github.ollama4j.types.OllamaModelType;
public class Main {
public static void main(String[] args) throws Exception {
@@ -132,6 +153,14 @@ public class Main {
## Create a new conversation with individual system prompt
```java
import io.github.ollama4j.OllamaAPI;
import io.github.ollama4j.models.chat.OllamaChatMessageRole;
import io.github.ollama4j.models.chat.OllamaChatRequestBuilder;
import io.github.ollama4j.models.chat.OllamaChatRequestModel;
import io.github.ollama4j.models.chat.OllamaChatResult;
import io.github.ollama4j.types.OllamaModelType;
public class Main {
public static void main(String[] args) {
@@ -162,6 +191,16 @@ You will get a response similar to:
## Create a conversation about an image (requires model with image recognition skills)
```java
import io.github.ollama4j.OllamaAPI;
import io.github.ollama4j.models.chat.OllamaChatMessageRole;
import io.github.ollama4j.models.chat.OllamaChatRequestBuilder;
import io.github.ollama4j.models.chat.OllamaChatRequestModel;
import io.github.ollama4j.models.chat.OllamaChatResult;
import io.github.ollama4j.types.OllamaModelType;
import java.io.File;
import java.util.List;
public class Main {
public static void main(String[] args) {
@@ -174,7 +213,8 @@ public class Main {
// Load Image from File and attach to user message (alternatively images could also be added via URL)
OllamaChatRequestModel requestModel =
builder.withMessage(OllamaChatMessageRole.USER, "What's in the picture?",
List.of(getImageFileFromClasspath("dog-on-a-boat.jpg"))).build();
List.of(
new File("/path/to/image"))).build();
OllamaChatResult chatResult = ollamaAPI.chat(requestModel);
System.out.println("First answer: " + chatResult.getResponse());

View File

@@ -12,6 +12,10 @@ This API corresponds to
the [completion](https://github.com/jmorganca/ollama/blob/main/docs/api.md#generate-a-completion) API.
```java
import io.github.ollama4j.OllamaAPI;
import io.github.ollama4j.models.OllamaAsyncResultStreamer;
import io.github.ollama4j.types.OllamaModelType;
public class Main {
public static void main(String[] args) throws Exception {
@@ -38,9 +42,7 @@ public class Main {
System.out.println("Complete Response:");
System.out.println("------------------------");
System.out.println(streamer.getResult());
System.out.println(streamer.getCompleteResponse());
}
}
```
You will get a steaming response.
```

View File

@@ -12,6 +12,10 @@ Parameters:
- `prompt`: text to generate embeddings for
```java
import io.github.ollama4j.OllamaAPI;
import io.github.ollama4j.types.OllamaModelType;
import java.util.List;
public class Main {
public static void main(String[] args) {

View File

@@ -22,6 +22,13 @@ If you have this image downloaded and you pass the path to the downloaded image
![Img](https://t3.ftcdn.net/jpg/02/96/63/80/360_F_296638053_0gUVA4WVBKceGsIr7LNqRWSnkusi07dq.jpg)
```java
import io.github.ollama4j.OllamaAPI;
import io.github.ollama4j.models.OllamaResult;
import io.github.ollama4j.types.OllamaModelType;
import io.github.ollama4j.utils.OptionsBuilder;
import java.io.File;
import java.util.List;
public class Main {
public static void main(String[] args) {
@@ -32,7 +39,9 @@ public class Main {
OllamaResult result = ollamaAPI.generateWithImageFiles(OllamaModelType.LLAVA,
"What's in this image?",
List.of(
new File("/path/to/image")));
new File("/path/to/image")),
new OptionsBuilder().build()
);
System.out.println(result.getResponse());
}
}

View File

@@ -22,6 +22,12 @@ Passing the link of this image the following code:
![Img](https://t3.ftcdn.net/jpg/02/96/63/80/360_F_296638053_0gUVA4WVBKceGsIr7LNqRWSnkusi07dq.jpg)
```java
import io.github.ollama4j.OllamaAPI;
import io.github.ollama4j.models.OllamaResult;
import io.github.ollama4j.types.OllamaModelType;
import io.github.ollama4j.utils.OptionsBuilder;
import java.util.List;
public class Main {
public static void main(String[] args) {
@@ -32,7 +38,9 @@ public class Main {
OllamaResult result = ollamaAPI.generateWithImageURLs(OllamaModelType.LLAVA,
"What's in this image?",
List.of(
"https://t3.ftcdn.net/jpg/02/96/63/80/360_F_296638053_0gUVA4WVBKceGsIr7LNqRWSnkusi07dq.jpg"));
"https://t3.ftcdn.net/jpg/02/96/63/80/360_F_296638053_0gUVA4WVBKceGsIr7LNqRWSnkusi07dq.jpg"),
new OptionsBuilder().build()
);
System.out.println(result.getResponse());
}
}

View File

@@ -29,6 +29,8 @@ You could do that with ease with the `function calling` capabilities of the mode
### Create Functions
We can create static functions as our tools.
This function takes the arguments `location` and `fuelType` and performs an operation with these arguments and returns
fuel price value.
@@ -50,6 +52,8 @@ public static String getCurrentWeather(Map<String, Object> arguments) {
}
```
Another way to create our tools is by creating classes by extending `ToolFunction`.
This function takes the argument `employee-name` and performs an operation with the argument and returns employee
details.
@@ -211,13 +215,13 @@ Rahul Kumar, Address: King St, Hyderabad, India, Phone: 9876543210}`
### Full Example
```java
import io.github.amithkoujalgi.ollama4j.core.OllamaAPI;
import io.github.amithkoujalgi.ollama4j.core.exceptions.OllamaBaseException;
import io.github.amithkoujalgi.ollama4j.core.exceptions.ToolInvocationException;
import io.github.amithkoujalgi.ollama4j.core.tools.OllamaToolsResult;
import io.github.amithkoujalgi.ollama4j.core.tools.ToolFunction;
import io.github.amithkoujalgi.ollama4j.core.tools.Tools;
import io.github.amithkoujalgi.ollama4j.core.utils.OptionsBuilder;
import io.github.ollama4j.OllamaAPI;
import io.github.ollama4j.exceptions.OllamaBaseException;
import io.github.ollama4j.exceptions.ToolInvocationException;
import io.github.ollama4j.tools.OllamaToolsResult;
import io.github.ollama4j.tools.ToolFunction;
import io.github.ollama4j.tools.Tools;
import io.github.ollama4j.utils.OptionsBuilder;
import java.io.IOException;
import java.util.Arrays;
@@ -341,7 +345,7 @@ Rahul Kumar, Address: King St, Hyderabad, India, Phone: 9876543210}`
::::
### Room for improvement
### Potential Improvements
Instead of explicitly registering `ollamaAPI.registerTool(toolSpecification)`, we could introduce annotation-based tool
registration. For example:

View File

@@ -16,6 +16,11 @@ to [this](/apis-extras/options-builder).
## Try asking a question about the model.
```java
import io.github.ollama4j.OllamaAPI;
import io.github.ollama4j.models.OllamaResult;
import io.github.ollama4j.types.OllamaModelType;
import io.github.ollama4j.utils.OptionsBuilder;
public class Main {
public static void main(String[] args) {
@@ -44,6 +49,11 @@ You will get a response similar to:
## Try asking a question, receiving the answer streamed
```java
import io.github.ollama4j.OllamaAPI;
import io.github.ollama4j.models.OllamaResult;
import io.github.ollama4j.models.generate.OllamaStreamHandler;
import io.github.ollama4j.utils.OptionsBuilder;
public class Main {
public static void main(String[] args) {
@@ -80,6 +90,11 @@ You will get a response similar to:
## Try asking a question from general topics.
```java
import io.github.ollama4j.OllamaAPI;
import io.github.ollama4j.models.OllamaResult;
import io.github.ollama4j.types.OllamaModelType;
import io.github.ollama4j.utils.OptionsBuilder;
public class Main {
public static void main(String[] args) {
@@ -123,6 +138,12 @@ You'd then get a response from the model:
## Try asking for a Database query for your data schema.
```java
import io.github.ollama4j.OllamaAPI;
import io.github.ollama4j.models.OllamaResult;
import io.github.ollama4j.types.OllamaModelType;
import io.github.ollama4j.utils.OptionsBuilder;
import io.github.ollama4j.utils.SamplePrompts;
public class Main {
public static void main(String[] args) {

View File

@@ -8,13 +8,13 @@ This is designed for prompt engineering. It allows you to easily build the promp
inferences.
```java
import io.github.ollama4j.OllamaAPI;
import io.github.ollama4j.models.OllamaResult;
import io.github.ollama4j.types.OllamaModelType;
import io.github.ollama4j.utils.OptionsBuilder;
import io.github.ollama4j.utils.PromptBuilder;
import io.github.amithkoujalgi.ollama4j.core.OllamaAPI;
import io.github.amithkoujalgi.ollama4j.core.models.OllamaResult;
import io.github.amithkoujalgi.ollama4j.core.types.OllamaModelType;
import io.github.amithkoujalgi.ollama4j.core.utils.PromptBuilder;
public class AskPhi {
public class Main {
public static void main(String[] args) throws Exception {
String host = "http://localhost:11434/";
@@ -42,7 +42,8 @@ public class AskPhi {
.addSeparator()
.add("How do I read a file in Go and print its contents to stdout?");
OllamaResult response = ollamaAPI.generate(model, promptBuilder.build(), new OptionsBuilder().build());
boolean raw = false;
OllamaResult response = ollamaAPI.generate(model, promptBuilder.build(), raw, new OptionsBuilder().build());
System.out.println(response.getResponse());
}
}

View File

@@ -9,6 +9,8 @@ This API lets you create a custom model on the Ollama server.
### Create a model from an existing Modelfile in the Ollama server
```java title="CreateModel.java"
import io.github.ollama4j.OllamaAPI;
public class CreateModel {
public static void main(String[] args) {

View File

@@ -7,6 +7,8 @@ sidebar_position: 5
This API lets you create a delete a model from the Ollama server.
```java title="DeleteModel.java"
import io.github.ollama4j.OllamaAPI;
public class Main {
public static void main(String[] args) {

View File

@@ -7,6 +7,10 @@ sidebar_position: 3
This API lets you get the details of a model on the Ollama server.
```java title="GetModelDetails.java"
import io.github.ollama4j.OllamaAPI;
import io.github.ollama4j.models.ModelDetail;
import io.github.ollama4j.types.OllamaModelType;
public class Main {
public static void main(String[] args) {

View File

@@ -7,6 +7,11 @@ sidebar_position: 1
This API lets you list available models on the Ollama server.
```java title="ListModels.java"
import io.github.ollama4j.OllamaAPI;
import io.github.ollama4j.models.Model;
import java.util.List;
public class ListModels {
public static void main(String[] args) {

View File

@@ -7,10 +7,13 @@ sidebar_position: 2
This API lets you pull a model on the Ollama server.
```java title="PullModel.java"
import io.github.ollama4j.OllamaAPI;
import io.github.ollama4j.types.OllamaModelType;
public class Main {
public static void main(String[] args) {
String host = "http://localhost:11434/";
OllamaAPI ollamaAPI = new OllamaAPI(host);

View File

@@ -78,9 +78,9 @@ Add the dependency to your project's `pom.xml`.
```xml
<dependency>
<groupId>io.github.amithkoujalgi</groupId>
<groupId>io.github.ollama4j</groupId>
<artifactId>ollama4j</artifactId>
<version>1.0.27</version>
<version>1.0.78</version>
</dependency>
```
@@ -116,6 +116,8 @@ or use other suitable implementations.
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) {

View File

@@ -1,21 +1,21 @@
package io.github.amithkoujalgi.ollama4j.core;
package io.github.ollama4j;
import io.github.amithkoujalgi.ollama4j.core.exceptions.OllamaBaseException;
import io.github.amithkoujalgi.ollama4j.core.exceptions.ToolInvocationException;
import io.github.amithkoujalgi.ollama4j.core.exceptions.ToolNotFoundException;
import io.github.amithkoujalgi.ollama4j.core.models.*;
import io.github.amithkoujalgi.ollama4j.core.models.chat.OllamaChatMessage;
import io.github.amithkoujalgi.ollama4j.core.models.chat.OllamaChatRequestBuilder;
import io.github.amithkoujalgi.ollama4j.core.models.chat.OllamaChatRequestModel;
import io.github.amithkoujalgi.ollama4j.core.models.chat.OllamaChatResult;
import io.github.amithkoujalgi.ollama4j.core.models.embeddings.OllamaEmbeddingResponseModel;
import io.github.amithkoujalgi.ollama4j.core.models.embeddings.OllamaEmbeddingsRequestModel;
import io.github.amithkoujalgi.ollama4j.core.models.generate.OllamaGenerateRequestModel;
import io.github.amithkoujalgi.ollama4j.core.models.generate.OllamaStreamHandler;
import io.github.amithkoujalgi.ollama4j.core.models.request.*;
import io.github.amithkoujalgi.ollama4j.core.tools.*;
import io.github.amithkoujalgi.ollama4j.core.utils.Options;
import io.github.amithkoujalgi.ollama4j.core.utils.Utils;
import io.github.ollama4j.exceptions.OllamaBaseException;
import io.github.ollama4j.exceptions.ToolInvocationException;
import io.github.ollama4j.exceptions.ToolNotFoundException;
import io.github.ollama4j.models.*;
import io.github.ollama4j.models.chat.OllamaChatMessage;
import io.github.ollama4j.models.chat.OllamaChatRequestBuilder;
import io.github.ollama4j.models.chat.OllamaChatRequestModel;
import io.github.ollama4j.models.chat.OllamaChatResult;
import io.github.ollama4j.models.embeddings.OllamaEmbeddingResponseModel;
import io.github.ollama4j.models.embeddings.OllamaEmbeddingsRequestModel;
import io.github.ollama4j.models.generate.OllamaGenerateRequestModel;
import io.github.ollama4j.models.generate.OllamaStreamHandler;
import io.github.ollama4j.models.request.*;
import io.github.ollama4j.tools.*;
import io.github.ollama4j.utils.Options;
import io.github.ollama4j.utils.Utils;
import lombok.Setter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.core;
package io.github.ollama4j;
import java.util.Iterator;
import java.util.LinkedList;

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.core.exceptions;
package io.github.ollama4j.exceptions;
public class OllamaBaseException extends Exception {

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.core.exceptions;
package io.github.ollama4j.exceptions;
public class ToolInvocationException extends Exception {

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.core.exceptions;
package io.github.ollama4j.exceptions;
public class ToolNotFoundException extends Exception {

View File

@@ -1,6 +1,6 @@
package io.github.amithkoujalgi.ollama4j.core.impl;
package io.github.ollama4j.impl;
import io.github.amithkoujalgi.ollama4j.core.models.generate.OllamaStreamHandler;
import io.github.ollama4j.models.generate.OllamaStreamHandler;
public class ConsoleOutputStreamHandler implements OllamaStreamHandler {
private final StringBuffer response = new StringBuffer();

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.core.models;
package io.github.ollama4j.models;
import lombok.AllArgsConstructor;
import lombok.Data;

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.core.models;
package io.github.ollama4j.models;
import java.util.List;
import lombok.Data;

View File

@@ -1,11 +1,10 @@
package io.github.amithkoujalgi.ollama4j.core.models;
package io.github.ollama4j.models;
import java.time.LocalDateTime;
import java.time.OffsetDateTime;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import io.github.amithkoujalgi.ollama4j.core.utils.Utils;
import io.github.ollama4j.utils.Utils;
import lombok.Data;
@Data

View File

@@ -1,9 +1,9 @@
package io.github.amithkoujalgi.ollama4j.core.models;
package io.github.ollama4j.models;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import io.github.amithkoujalgi.ollama4j.core.utils.Utils;
import io.github.ollama4j.utils.Utils;
import lombok.Data;
@Data

View File

@@ -1,9 +1,9 @@
package io.github.amithkoujalgi.ollama4j.core.models;
package io.github.ollama4j.models;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import io.github.amithkoujalgi.ollama4j.core.utils.Utils;
import io.github.ollama4j.utils.Utils;
import lombok.Data;
@Data

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.core.models;
package io.github.ollama4j.models;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

View File

@@ -1,10 +1,10 @@
package io.github.amithkoujalgi.ollama4j.core.models;
package io.github.ollama4j.models;
import io.github.amithkoujalgi.ollama4j.core.OllamaResultStream;
import io.github.amithkoujalgi.ollama4j.core.exceptions.OllamaBaseException;
import io.github.amithkoujalgi.ollama4j.core.models.generate.OllamaGenerateRequestModel;
import io.github.amithkoujalgi.ollama4j.core.models.generate.OllamaGenerateResponseModel;
import io.github.amithkoujalgi.ollama4j.core.utils.Utils;
import io.github.ollama4j.OllamaResultStream;
import io.github.ollama4j.exceptions.OllamaBaseException;
import io.github.ollama4j.models.generate.OllamaGenerateRequestModel;
import io.github.ollama4j.models.generate.OllamaGenerateResponseModel;
import io.github.ollama4j.utils.Utils;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.core.models;
package io.github.ollama4j.models;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonInclude;
@@ -6,8 +6,8 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.github.amithkoujalgi.ollama4j.core.utils.BooleanToJsonFormatFlagSerializer;
import io.github.amithkoujalgi.ollama4j.core.utils.Utils;
import io.github.ollama4j.utils.BooleanToJsonFormatFlagSerializer;
import io.github.ollama4j.utils.Utils;
import lombok.Data;
@Data

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.core.models;
package io.github.ollama4j.models;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

View File

@@ -1,6 +1,6 @@
package io.github.amithkoujalgi.ollama4j.core.models;
package io.github.ollama4j.models;
import static io.github.amithkoujalgi.ollama4j.core.utils.Utils.getObjectMapper;
import static io.github.ollama4j.utils.Utils.getObjectMapper;
import com.fasterxml.jackson.core.JsonProcessingException;
import lombok.Data;

View File

@@ -1,11 +1,11 @@
package io.github.amithkoujalgi.ollama4j.core.models.chat;
package io.github.ollama4j.models.chat;
import static io.github.amithkoujalgi.ollama4j.core.utils.Utils.getObjectMapper;
import static io.github.ollama4j.utils.Utils.getObjectMapper;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.github.amithkoujalgi.ollama4j.core.utils.FileToBase64Serializer;
import io.github.ollama4j.utils.FileToBase64Serializer;
import java.util.List;
import lombok.AllArgsConstructor;

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.core.models.chat;
package io.github.ollama4j.models.chat;
import com.fasterxml.jackson.annotation.JsonValue;

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.core.models.chat;
package io.github.ollama4j.models.chat;
import java.io.File;
import java.io.IOException;
@@ -11,8 +11,8 @@ import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.amithkoujalgi.ollama4j.core.utils.Options;
import io.github.amithkoujalgi.ollama4j.core.utils.Utils;
import io.github.ollama4j.utils.Options;
import io.github.ollama4j.utils.Utils;
/**
* Helper class for creating {@link OllamaChatRequestModel} objects using the builder-pattern.

View File

@@ -1,8 +1,9 @@
package io.github.amithkoujalgi.ollama4j.core.models.chat;
package io.github.ollama4j.models.chat;
import java.util.List;
import io.github.amithkoujalgi.ollama4j.core.models.OllamaCommonRequestModel;
import io.github.amithkoujalgi.ollama4j.core.utils.OllamaRequestBody;
import io.github.ollama4j.models.OllamaCommonRequestModel;
import io.github.ollama4j.utils.OllamaRequestBody;
import lombok.Getter;
import lombok.Setter;

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.core.models.chat;
package io.github.ollama4j.models.chat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

View File

@@ -1,8 +1,8 @@
package io.github.amithkoujalgi.ollama4j.core.models.chat;
package io.github.ollama4j.models.chat;
import java.util.List;
import io.github.amithkoujalgi.ollama4j.core.models.OllamaResult;
import io.github.ollama4j.models.OllamaResult;
/**
* Specific chat-API result that contains the chat history sent to the model and appends the answer as {@link OllamaChatResult} given by the

View File

@@ -1,6 +1,6 @@
package io.github.amithkoujalgi.ollama4j.core.models.chat;
package io.github.ollama4j.models.chat;
import io.github.amithkoujalgi.ollama4j.core.models.generate.OllamaStreamHandler;
import io.github.ollama4j.models.generate.OllamaStreamHandler;
import java.util.ArrayList;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.core.models.embeddings;
package io.github.ollama4j.models.embeddings;
import com.fasterxml.jackson.annotation.JsonProperty;

View File

@@ -1,6 +1,6 @@
package io.github.amithkoujalgi.ollama4j.core.models.embeddings;
package io.github.ollama4j.models.embeddings;
import io.github.amithkoujalgi.ollama4j.core.utils.Options;
import io.github.ollama4j.utils.Options;
public class OllamaEmbeddingsRequestBuilder {

View File

@@ -1,6 +1,6 @@
package io.github.amithkoujalgi.ollama4j.core.models.embeddings;
package io.github.ollama4j.models.embeddings;
import static io.github.amithkoujalgi.ollama4j.core.utils.Utils.getObjectMapper;
import static io.github.ollama4j.utils.Utils.getObjectMapper;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;

View File

@@ -1,9 +1,9 @@
package io.github.amithkoujalgi.ollama4j.core.models.generate;
package io.github.ollama4j.models.generate;
import io.github.amithkoujalgi.ollama4j.core.utils.Options;
import io.github.ollama4j.utils.Options;
/**
* Helper class for creating {@link io.github.amithkoujalgi.ollama4j.core.models.generate.OllamaGenerateRequestModel}
* Helper class for creating {@link OllamaGenerateRequestModel}
* objects using the builder-pattern.
*/
public class OllamaGenerateRequestBuilder {

View File

@@ -1,8 +1,8 @@
package io.github.amithkoujalgi.ollama4j.core.models.generate;
package io.github.ollama4j.models.generate;
import io.github.amithkoujalgi.ollama4j.core.models.OllamaCommonRequestModel;
import io.github.amithkoujalgi.ollama4j.core.utils.OllamaRequestBody;
import io.github.ollama4j.models.OllamaCommonRequestModel;
import io.github.ollama4j.utils.OllamaRequestBody;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.core.models.generate;
package io.github.ollama4j.models.generate;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.core.models.generate;
package io.github.ollama4j.models.generate;
import java.util.ArrayList;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.core.models.generate;
package io.github.ollama4j.models.generate;
import java.util.function.Consumer;

View File

@@ -1,6 +1,6 @@
package io.github.amithkoujalgi.ollama4j.core.models.request;
package io.github.ollama4j.models.request;
import static io.github.amithkoujalgi.ollama4j.core.utils.Utils.getObjectMapper;
import static io.github.ollama4j.utils.Utils.getObjectMapper;
import com.fasterxml.jackson.core.JsonProcessingException;
import lombok.AllArgsConstructor;

View File

@@ -1,6 +1,6 @@
package io.github.amithkoujalgi.ollama4j.core.models.request;
package io.github.ollama4j.models.request;
import static io.github.amithkoujalgi.ollama4j.core.utils.Utils.getObjectMapper;
import static io.github.ollama4j.utils.Utils.getObjectMapper;
import com.fasterxml.jackson.core.JsonProcessingException;
import lombok.AllArgsConstructor;

View File

@@ -1,6 +1,6 @@
package io.github.amithkoujalgi.ollama4j.core.models.request;
package io.github.ollama4j.models.request;
import static io.github.amithkoujalgi.ollama4j.core.utils.Utils.getObjectMapper;
import static io.github.ollama4j.utils.Utils.getObjectMapper;
import com.fasterxml.jackson.core.JsonProcessingException;
import lombok.AllArgsConstructor;

View File

@@ -1,14 +1,14 @@
package io.github.amithkoujalgi.ollama4j.core.models.request;
package io.github.ollama4j.models.request;
import com.fasterxml.jackson.core.JsonProcessingException;
import io.github.amithkoujalgi.ollama4j.core.exceptions.OllamaBaseException;
import io.github.amithkoujalgi.ollama4j.core.models.BasicAuth;
import io.github.amithkoujalgi.ollama4j.core.models.OllamaResult;
import io.github.amithkoujalgi.ollama4j.core.models.chat.OllamaChatResponseModel;
import io.github.amithkoujalgi.ollama4j.core.models.chat.OllamaChatStreamObserver;
import io.github.amithkoujalgi.ollama4j.core.models.generate.OllamaStreamHandler;
import io.github.amithkoujalgi.ollama4j.core.utils.OllamaRequestBody;
import io.github.amithkoujalgi.ollama4j.core.utils.Utils;
import io.github.ollama4j.exceptions.OllamaBaseException;
import io.github.ollama4j.models.BasicAuth;
import io.github.ollama4j.models.OllamaResult;
import io.github.ollama4j.models.chat.OllamaChatResponseModel;
import io.github.ollama4j.models.chat.OllamaChatStreamObserver;
import io.github.ollama4j.models.generate.OllamaStreamHandler;
import io.github.ollama4j.utils.OllamaRequestBody;
import io.github.ollama4j.utils.Utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@@ -1,12 +1,12 @@
package io.github.amithkoujalgi.ollama4j.core.models.request;
package io.github.ollama4j.models.request;
import io.github.amithkoujalgi.ollama4j.core.OllamaAPI;
import io.github.amithkoujalgi.ollama4j.core.exceptions.OllamaBaseException;
import io.github.amithkoujalgi.ollama4j.core.models.BasicAuth;
import io.github.amithkoujalgi.ollama4j.core.models.OllamaErrorResponseModel;
import io.github.amithkoujalgi.ollama4j.core.models.OllamaResult;
import io.github.amithkoujalgi.ollama4j.core.utils.OllamaRequestBody;
import io.github.amithkoujalgi.ollama4j.core.utils.Utils;
import io.github.ollama4j.OllamaAPI;
import io.github.ollama4j.exceptions.OllamaBaseException;
import io.github.ollama4j.models.BasicAuth;
import io.github.ollama4j.models.OllamaErrorResponseModel;
import io.github.ollama4j.models.OllamaResult;
import io.github.ollama4j.utils.OllamaRequestBody;
import io.github.ollama4j.utils.Utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@@ -1,14 +1,14 @@
package io.github.amithkoujalgi.ollama4j.core.models.request;
package io.github.ollama4j.models.request;
import com.fasterxml.jackson.core.JsonProcessingException;
import io.github.amithkoujalgi.ollama4j.core.exceptions.OllamaBaseException;
import io.github.amithkoujalgi.ollama4j.core.models.BasicAuth;
import io.github.amithkoujalgi.ollama4j.core.models.OllamaResult;
import io.github.amithkoujalgi.ollama4j.core.models.generate.OllamaGenerateResponseModel;
import io.github.amithkoujalgi.ollama4j.core.models.generate.OllamaGenerateStreamObserver;
import io.github.amithkoujalgi.ollama4j.core.models.generate.OllamaStreamHandler;
import io.github.amithkoujalgi.ollama4j.core.utils.OllamaRequestBody;
import io.github.amithkoujalgi.ollama4j.core.utils.Utils;
import io.github.ollama4j.exceptions.OllamaBaseException;
import io.github.ollama4j.models.BasicAuth;
import io.github.ollama4j.models.OllamaResult;
import io.github.ollama4j.models.generate.OllamaGenerateResponseModel;
import io.github.ollama4j.models.generate.OllamaGenerateStreamObserver;
import io.github.ollama4j.models.generate.OllamaStreamHandler;
import io.github.ollama4j.utils.OllamaRequestBody;
import io.github.ollama4j.utils.Utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@@ -1,6 +1,6 @@
package io.github.amithkoujalgi.ollama4j.core.tools;
package io.github.ollama4j.tools;
import io.github.amithkoujalgi.ollama4j.core.models.OllamaResult;
import io.github.ollama4j.models.OllamaResult;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.core.tools;
package io.github.ollama4j.tools;
import java.util.Map;

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.core.tools;
package io.github.ollama4j.tools;
import lombok.AllArgsConstructor;
import lombok.Data;

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.core.tools;
package io.github.ollama4j.tools;
import java.util.HashMap;
import java.util.Map;

View File

@@ -1,11 +1,11 @@
package io.github.amithkoujalgi.ollama4j.core.tools;
package io.github.ollama4j.tools;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import io.github.amithkoujalgi.ollama4j.core.utils.Utils;
import io.github.ollama4j.utils.Utils;
import lombok.Builder;
import lombok.Data;

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.core.types;
package io.github.ollama4j.types;
/**
* A class to provide constants for all the supported models by Ollama.

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.core.utils;
package io.github.ollama4j.utils;
import java.io.IOException;

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.core.utils;
package io.github.ollama4j.utils;
import java.io.IOException;
import java.util.Base64;

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.core.utils;
package io.github.ollama4j.utils;
import java.net.http.HttpRequest.BodyPublisher;
import java.net.http.HttpRequest.BodyPublishers;

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.core.utils;
package io.github.ollama4j.utils;
import java.util.Map;
import lombok.Data;

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.core.utils;
package io.github.ollama4j.utils;
import java.util.HashMap;

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.core.utils;
package io.github.ollama4j.utils;
/**
* The {@code PromptBuilder} class is used to construct prompt texts for language models (LLMs). It

View File

@@ -1,6 +1,6 @@
package io.github.amithkoujalgi.ollama4j.core.utils;
package io.github.ollama4j.utils;
import io.github.amithkoujalgi.ollama4j.core.OllamaAPI;
import io.github.ollama4j.OllamaAPI;
import java.io.InputStream;
import java.util.Scanner;

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.core.utils;
package io.github.ollama4j.utils;
import java.io.ByteArrayOutputStream;
import java.io.IOException;

View File

@@ -1,16 +1,16 @@
package io.github.amithkoujalgi.ollama4j.integrationtests;
package io.github.ollama4j.integrationtests;
import io.github.amithkoujalgi.ollama4j.core.OllamaAPI;
import io.github.amithkoujalgi.ollama4j.core.exceptions.OllamaBaseException;
import io.github.amithkoujalgi.ollama4j.core.models.ModelDetail;
import io.github.amithkoujalgi.ollama4j.core.models.OllamaResult;
import io.github.amithkoujalgi.ollama4j.core.models.chat.OllamaChatMessageRole;
import io.github.amithkoujalgi.ollama4j.core.models.chat.OllamaChatRequestBuilder;
import io.github.amithkoujalgi.ollama4j.core.models.chat.OllamaChatRequestModel;
import io.github.amithkoujalgi.ollama4j.core.models.chat.OllamaChatResult;
import io.github.amithkoujalgi.ollama4j.core.models.embeddings.OllamaEmbeddingsRequestBuilder;
import io.github.amithkoujalgi.ollama4j.core.models.embeddings.OllamaEmbeddingsRequestModel;
import io.github.amithkoujalgi.ollama4j.core.utils.OptionsBuilder;
import io.github.ollama4j.OllamaAPI;
import io.github.ollama4j.exceptions.OllamaBaseException;
import io.github.ollama4j.models.ModelDetail;
import io.github.ollama4j.models.OllamaResult;
import io.github.ollama4j.models.chat.OllamaChatMessageRole;
import io.github.ollama4j.models.chat.OllamaChatRequestBuilder;
import io.github.ollama4j.models.chat.OllamaChatRequestModel;
import io.github.ollama4j.models.chat.OllamaChatResult;
import io.github.ollama4j.models.embeddings.OllamaEmbeddingsRequestBuilder;
import io.github.ollama4j.models.embeddings.OllamaEmbeddingsRequestModel;
import io.github.ollama4j.utils.OptionsBuilder;
import lombok.Data;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Order;

View File

@@ -1,12 +1,12 @@
package io.github.amithkoujalgi.ollama4j.unittests;
package io.github.ollama4j.unittests;
import io.github.amithkoujalgi.ollama4j.core.OllamaAPI;
import io.github.amithkoujalgi.ollama4j.core.exceptions.OllamaBaseException;
import io.github.amithkoujalgi.ollama4j.core.models.ModelDetail;
import io.github.amithkoujalgi.ollama4j.core.models.OllamaAsyncResultStreamer;
import io.github.amithkoujalgi.ollama4j.core.models.OllamaResult;
import io.github.amithkoujalgi.ollama4j.core.types.OllamaModelType;
import io.github.amithkoujalgi.ollama4j.core.utils.OptionsBuilder;
import io.github.ollama4j.OllamaAPI;
import io.github.ollama4j.exceptions.OllamaBaseException;
import io.github.ollama4j.models.ModelDetail;
import io.github.ollama4j.models.OllamaAsyncResultStreamer;
import io.github.ollama4j.models.OllamaResult;
import io.github.ollama4j.types.OllamaModelType;
import io.github.ollama4j.utils.OptionsBuilder;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

View File

@@ -1,10 +1,10 @@
package io.github.amithkoujalgi.ollama4j.unittests.jackson;
package io.github.ollama4j.unittests.jackson;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.github.amithkoujalgi.ollama4j.core.utils.Utils;
import io.github.ollama4j.utils.Utils;
public abstract class AbstractSerializationTest<T> {

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.unittests.jackson;
package io.github.ollama4j.unittests.jackson;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -9,10 +9,10 @@ import org.json.JSONObject;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import io.github.amithkoujalgi.ollama4j.core.models.chat.OllamaChatMessageRole;
import io.github.amithkoujalgi.ollama4j.core.models.chat.OllamaChatRequestBuilder;
import io.github.amithkoujalgi.ollama4j.core.models.chat.OllamaChatRequestModel;
import io.github.amithkoujalgi.ollama4j.core.utils.OptionsBuilder;
import io.github.ollama4j.models.chat.OllamaChatMessageRole;
import io.github.ollama4j.models.chat.OllamaChatRequestBuilder;
import io.github.ollama4j.models.chat.OllamaChatRequestModel;
import io.github.ollama4j.utils.OptionsBuilder;
public class TestChatRequestSerialization extends AbstractSerializationTest<OllamaChatRequestModel> {

View File

@@ -1,11 +1,11 @@
package io.github.amithkoujalgi.ollama4j.unittests.jackson;
package io.github.ollama4j.unittests.jackson;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import io.github.amithkoujalgi.ollama4j.core.models.embeddings.OllamaEmbeddingsRequestModel;
import io.github.amithkoujalgi.ollama4j.core.models.embeddings.OllamaEmbeddingsRequestBuilder;
import io.github.amithkoujalgi.ollama4j.core.utils.OptionsBuilder;
import io.github.ollama4j.models.embeddings.OllamaEmbeddingsRequestModel;
import io.github.ollama4j.models.embeddings.OllamaEmbeddingsRequestBuilder;
import io.github.ollama4j.utils.OptionsBuilder;
public class TestEmbeddingsRequestSerialization extends AbstractSerializationTest<OllamaEmbeddingsRequestModel> {

View File

@@ -1,4 +1,4 @@
package io.github.amithkoujalgi.ollama4j.unittests.jackson;
package io.github.ollama4j.unittests.jackson;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -7,9 +7,9 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import io.github.amithkoujalgi.ollama4j.core.models.generate.OllamaGenerateRequestBuilder;
import io.github.amithkoujalgi.ollama4j.core.models.generate.OllamaGenerateRequestModel;
import io.github.amithkoujalgi.ollama4j.core.utils.OptionsBuilder;
import io.github.ollama4j.models.generate.OllamaGenerateRequestBuilder;
import io.github.ollama4j.models.generate.OllamaGenerateRequestModel;
import io.github.ollama4j.utils.OptionsBuilder;
public class TestGenerateRequestSerialization extends AbstractSerializationTest<OllamaGenerateRequestModel> {

View File

@@ -1,6 +1,6 @@
package io.github.amithkoujalgi.ollama4j.unittests.jackson;
package io.github.ollama4j.unittests.jackson;
import io.github.amithkoujalgi.ollama4j.core.models.Model;
import io.github.ollama4j.models.Model;
import org.junit.jupiter.api.Test;
public class TestModelRequestSerialization extends AbstractSerializationTest<Model> {