From 9224d2da06f49b61a64667357816567de6be6540 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Thu, 22 Feb 2024 11:50:41 +0530 Subject: [PATCH 001/101] Updated base route of docs --- docs/docs/apis-generate/generate.md | 15 ++++++++------- docs/docusaurus.config.js | 2 ++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/docs/apis-generate/generate.md b/docs/docs/apis-generate/generate.md index 6d1cf66..aed106e 100644 --- a/docs/docs/apis-generate/generate.md +++ b/docs/docs/apis-generate/generate.md @@ -11,7 +11,7 @@ the [completion](https://github.com/jmorganca/ollama/blob/main/docs/api.md#gener Use the `OptionBuilder` to build the `Options` object with [extra parameters](https://github.com/jmorganca/ollama/blob/main/docs/modelfile.md#valid-parameters-and-values). Refer -to [this](/docs/apis-extras/options-builder). +to [this](/apis-extras/options-builder). ## Try asking a question about the model. @@ -53,25 +53,26 @@ public class Main { OllamaAPI ollamaAPI = new OllamaAPI(host); // define a stream handler (Consumer) OllamaStreamHandler streamHandler = (s) -> { - System.out.println(s); + System.out.println(s); }; // Should be called using seperate thread to gain non blocking streaming effect. OllamaResult result = ollamaAPI.generate(config.getModel(), - "What is the capital of France? And what's France's connection with Mona Lisa?", - new OptionsBuilder().build(), streamHandler); - - System.out.println("Full response: " +result.getResponse()); + "What is the capital of France? And what's France's connection with Mona Lisa?", + new OptionsBuilder().build(), streamHandler); + + System.out.println("Full response: " + result.getResponse()); } } ``` + You will get a response similar to: > The > The capital > The capital of > The capital of France -> The capital of France is +> The capital of France is > The capital of France is Paris > The capital of France is Paris. > Full response: The capital of France is Paris. diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index eac9357..cc19285 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -40,6 +40,8 @@ const config = { /** @type {import('@docusaurus/preset-classic').Options} */ ({ docs: { + path: 'docs', + routeBasePath: '', // change this to any URL route you'd want. For example: `home` - if you want /home/intro. sidebarPath: './sidebars.js', // Please change this to your repo. // Remove this to remove the "edit this page" links. -- 2.47.2 From e39c47b8e13f51de2bc38c3cfce60ab4c63d71ff Mon Sep 17 00:00:00 2001 From: andrewtodd Date: Sun, 9 Jun 2024 16:43:46 +1000 Subject: [PATCH 002/101] Add codestral as a model. --- .../amithkoujalgi/ollama4j/core/types/OllamaModelType.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/types/OllamaModelType.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/types/OllamaModelType.java index d7984d0..5733979 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/types/OllamaModelType.java +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/types/OllamaModelType.java @@ -79,4 +79,5 @@ public class OllamaModelType { public static final String NOTUS = "notus"; public static final String DUCKDB_NSQL = "duckdb-nsql"; public static final String ALL_MINILM = "all-minilm"; + public static final String CODESTRAL = "codestral"; } -- 2.47.2 From 165d04b1bbf74f89b759cec2a0891dcc914a7c47 Mon Sep 17 00:00:00 2001 From: amithkoujalgi Date: Wed, 12 Jun 2024 03:22:49 +0000 Subject: [PATCH 003/101] [maven-release-plugin] prepare release v1.0.73 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index de40186..68f7047 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ io.github.amithkoujalgi ollama4j - 1.0.73-SNAPSHOT + 1.0.73 Ollama4j Java library for interacting with Ollama API. @@ -39,7 +39,7 @@ scm:git:git@github.com:amithkoujalgi/ollama4j.git scm:git:https://github.com/amithkoujalgi/ollama4j.git https://github.com/amithkoujalgi/ollama4j - v1.0.16 + v1.0.73 -- 2.47.2 From b5801d84e0c1c60ac9e689942bece4a484376f19 Mon Sep 17 00:00:00 2001 From: amithkoujalgi Date: Wed, 12 Jun 2024 03:22:50 +0000 Subject: [PATCH 004/101] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 68f7047..3e73414 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ io.github.amithkoujalgi ollama4j - 1.0.73 + 1.0.74-SNAPSHOT Ollama4j Java library for interacting with Ollama API. @@ -39,7 +39,7 @@ scm:git:git@github.com:amithkoujalgi/ollama4j.git scm:git:https://github.com/amithkoujalgi/ollama4j.git https://github.com/amithkoujalgi/ollama4j - v1.0.73 + v1.0.16 -- 2.47.2 From 8eea19a53987d5a99ac3f6d116bf58ec428a7498 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Thu, 11 Jul 2024 23:35:39 +0530 Subject: [PATCH 005/101] Added model types - `gemma2` and `qwen2` --- .../amithkoujalgi/ollama4j/core/types/OllamaModelType.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/types/OllamaModelType.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/types/OllamaModelType.java index 5733979..2613d86 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/types/OllamaModelType.java +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/types/OllamaModelType.java @@ -9,6 +9,9 @@ package io.github.amithkoujalgi.ollama4j.core.types; @SuppressWarnings("ALL") public class OllamaModelType { public static final String GEMMA = "gemma"; + public static final String GEMMA2 = "gemma2"; + + public static final String LLAMA2 = "llama2"; public static final String LLAMA3 = "llama3"; public static final String MISTRAL = "mistral"; @@ -30,6 +33,8 @@ public class OllamaModelType { public static final String ZEPHYR = "zephyr"; public static final String OPENHERMES = "openhermes"; public static final String QWEN = "qwen"; + + public static final String QWEN2 = "qwen2"; public static final String WIZARDCODER = "wizardcoder"; public static final String LLAMA2_CHINESE = "llama2-chinese"; public static final String TINYLLAMA = "tinyllama"; -- 2.47.2 From 4744315d454ea6f1599a04d6cfa20be8d6214f3f Mon Sep 17 00:00:00 2001 From: amithkoujalgi Date: Thu, 11 Jul 2024 18:06:59 +0000 Subject: [PATCH 006/101] [maven-release-plugin] prepare release v1.0.74 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 3e73414..d7680b1 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ io.github.amithkoujalgi ollama4j - 1.0.74-SNAPSHOT + 1.0.74 Ollama4j Java library for interacting with Ollama API. @@ -39,7 +39,7 @@ scm:git:git@github.com:amithkoujalgi/ollama4j.git scm:git:https://github.com/amithkoujalgi/ollama4j.git https://github.com/amithkoujalgi/ollama4j - v1.0.16 + v1.0.74 -- 2.47.2 From be549430c5e36c709cb29d9dce41523ff1990ff3 Mon Sep 17 00:00:00 2001 From: amithkoujalgi Date: Thu, 11 Jul 2024 18:07:00 +0000 Subject: [PATCH 007/101] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index d7680b1..cef549d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ io.github.amithkoujalgi ollama4j - 1.0.74 + 1.0.75-SNAPSHOT Ollama4j Java library for interacting with Ollama API. @@ -39,7 +39,7 @@ scm:git:git@github.com:amithkoujalgi/ollama4j.git scm:git:https://github.com/amithkoujalgi/ollama4j.git https://github.com/amithkoujalgi/ollama4j - v1.0.74 + v1.0.16 -- 2.47.2 From 515d1f039916adcb9ec620c8c33f72d7cba40d28 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Fri, 12 Jul 2024 01:05:56 +0530 Subject: [PATCH 008/101] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index e45b4a3..f111d6b 100644 --- a/README.md +++ b/README.md @@ -180,3 +180,8 @@ project. ### References - [Ollama REST APIs](https://github.com/jmorganca/ollama/blob/main/docs/api.md) + +## Appreciate my work? + +Buy Me A Coffee + -- 2.47.2 From d9e3860123742499b05de2a804ccdcd602626084 Mon Sep 17 00:00:00 2001 From: amithkoujalgi Date: Thu, 11 Jul 2024 19:37:03 +0000 Subject: [PATCH 009/101] [maven-release-plugin] prepare release v1.0.75 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index cef549d..2660b74 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ io.github.amithkoujalgi ollama4j - 1.0.75-SNAPSHOT + 1.0.75 Ollama4j Java library for interacting with Ollama API. @@ -39,7 +39,7 @@ scm:git:git@github.com:amithkoujalgi/ollama4j.git scm:git:https://github.com/amithkoujalgi/ollama4j.git https://github.com/amithkoujalgi/ollama4j - v1.0.16 + v1.0.75 -- 2.47.2 From 8ef6fac28effc28935cb224db7f1575b36637673 Mon Sep 17 00:00:00 2001 From: amithkoujalgi Date: Thu, 11 Jul 2024 19:37:04 +0000 Subject: [PATCH 010/101] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 2660b74..800ba57 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ io.github.amithkoujalgi ollama4j - 1.0.75 + 1.0.76-SNAPSHOT Ollama4j Java library for interacting with Ollama API. @@ -39,7 +39,7 @@ scm:git:git@github.com:amithkoujalgi/ollama4j.git scm:git:https://github.com/amithkoujalgi/ollama4j.git https://github.com/amithkoujalgi/ollama4j - v1.0.75 + v1.0.16 -- 2.47.2 From 91ee6cb4c1c807e681d21be774040c6020181d08 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Fri, 12 Jul 2024 17:06:41 +0530 Subject: [PATCH 011/101] Added support for tools/function calling - specifically for Mistral's latest model. --- docs/docs/apis-generate/generate-async.md | 2 +- .../generate-with-image-files.md | 2 +- .../apis-generate/generate-with-image-urls.md | 2 +- .../docs/apis-generate/generate-with-tools.md | 271 ++++++++ docs/docs/apis-generate/prompt-builder.md | 2 +- pom.xml | 3 +- .../ollama4j/core/OllamaAPI.java | 63 +- .../request/OllamaGenerateEndpointCaller.java | 42 +- .../ollama4j/core/tools/DynamicFunction.java | 8 + .../ollama4j/core/tools/MistralTools.java | 139 ++++ .../core/tools/OllamaToolsResult.java | 16 + .../ollama4j/core/tools/ToolDef.java | 18 + .../ollama4j/core/tools/ToolRegistry.java | 17 + .../integrationtests/TestRealAPIs.java | 652 +++++++++--------- .../ollama4j/unittests/TestMockedAPIs.java | 259 +++---- 15 files changed, 1006 insertions(+), 490 deletions(-) create mode 100644 docs/docs/apis-generate/generate-with-tools.md create mode 100644 src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/DynamicFunction.java create mode 100644 src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/MistralTools.java create mode 100644 src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/OllamaToolsResult.java create mode 100644 src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolDef.java create mode 100644 src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolRegistry.java diff --git a/docs/docs/apis-generate/generate-async.md b/docs/docs/apis-generate/generate-async.md index 7d8cc54..49f556f 100644 --- a/docs/docs/apis-generate/generate-async.md +++ b/docs/docs/apis-generate/generate-async.md @@ -1,5 +1,5 @@ --- -sidebar_position: 2 +sidebar_position: 3 --- # Generate - Async diff --git a/docs/docs/apis-generate/generate-with-image-files.md b/docs/docs/apis-generate/generate-with-image-files.md index 37f4f03..4406981 100644 --- a/docs/docs/apis-generate/generate-with-image-files.md +++ b/docs/docs/apis-generate/generate-with-image-files.md @@ -1,5 +1,5 @@ --- -sidebar_position: 3 +sidebar_position: 4 --- # Generate - With Image Files diff --git a/docs/docs/apis-generate/generate-with-image-urls.md b/docs/docs/apis-generate/generate-with-image-urls.md index 19d6cf1..587e8f0 100644 --- a/docs/docs/apis-generate/generate-with-image-urls.md +++ b/docs/docs/apis-generate/generate-with-image-urls.md @@ -1,5 +1,5 @@ --- -sidebar_position: 4 +sidebar_position: 5 --- # Generate - With Image URLs diff --git a/docs/docs/apis-generate/generate-with-tools.md b/docs/docs/apis-generate/generate-with-tools.md new file mode 100644 index 0000000..0ca142a --- /dev/null +++ b/docs/docs/apis-generate/generate-with-tools.md @@ -0,0 +1,271 @@ +--- +sidebar_position: 2 +--- + +# Generate - With Tools + +This API lets you perform [function calling](https://docs.mistral.ai/capabilities/function_calling/) using LLMs in a +synchronous way. +This API correlates to +the [generate](https://github.com/ollama/ollama/blob/main/docs/api.md#request-raw-mode) API with `raw` mode. + +:::note + +This is an only an experimental implementation and has a very basic design. + +Currently, built and tested for [Mistral's latest model](https://ollama.com/library/mistral) only. We could redesign +this +in the future if tooling is supported for more models with a generic interaction standard from Ollama. + +::: + +### Function Calling/Tools + +Assume you want to call a method in your code based on the response generated from the model. +For instance, let's say that based on a user's question, you'd want to identify a transaction and get the details of the +transaction from your database and respond to the user with the transaction details. + +You could do that with ease with the `function calling` capabilities of the models by registering your `tools`. + +### Create Functions + +This function takes the arguments `location` and `fuelType` and performs an operation with these arguments and returns a +value. + +```java +public static String getCurrentFuelPrice(Map arguments) { + String location = arguments.get("location").toString(); + String fuelType = arguments.get("fuelType").toString(); + return "Current price of " + fuelType + " in " + location + " is Rs.103/L"; +} +``` + +This function takes the argument `city` and performs an operation with the argument and returns a +value. + +```java +public static String getCurrentWeather(Map arguments) { + String location = arguments.get("city").toString(); + return "Currently " + location + "'s weather is nice."; +} +``` + +### Define Tool Specifications + +Lets define a sample tool specification called **Fuel Price Tool** for getting the current fuel price. + +- Specify the function `name`, `description`, and `required` properties (`location` and `fuelType`). +- Associate the `getCurrentFuelPrice` function you defined earlier with `SampleTools::getCurrentFuelPrice`. + +```java +MistralTools.ToolSpecification fuelPriceToolSpecification = MistralTools.ToolSpecification.builder() + .functionName("current-fuel-price") + .functionDesc("Get current fuel price") + .props( + new MistralTools.PropsBuilder() + .withProperty("location", MistralTools.PromptFuncDefinition.Property.builder().type("string").description("The city, e.g. New Delhi, India").required(true).build()) + .withProperty("fuelType", MistralTools.PromptFuncDefinition.Property.builder().type("string").description("The fuel type.").enumValues(Arrays.asList("petrol", "diesel")).required(true).build()) + .build() + ) + .toolDefinition(SampleTools::getCurrentFuelPrice) + .build(); +``` + +Lets also define a sample tool specification called **Weather Tool** for getting the current weather. + +- Specify the function `name`, `description`, and `required` property (`city`). +- Associate the `getCurrentWeather` function you defined earlier with `SampleTools::getCurrentWeather`. + +```java +MistralTools.ToolSpecification weatherToolSpecification = MistralTools.ToolSpecification.builder() + .functionName("current-weather") + .functionDesc("Get current weather") + .props( + new MistralTools.PropsBuilder() + .withProperty("city", MistralTools.PromptFuncDefinition.Property.builder().type("string").description("The city, e.g. New Delhi, India").required(true).build()) + .build() + ) + .toolDefinition(SampleTools::getCurrentWeather) + .build(); +``` + +### Register the Tools + +Register the defined tools (`fuel price` and `weather`) with the OllamaAPI. + +```shell +ollamaAPI.registerTool(fuelPriceToolSpecification); +ollamaAPI.registerTool(weatherToolSpecification); +``` + +### Create prompt with Tools + +`Prompt 1`: Create a prompt asking for the petrol price in Bengaluru using the defined fuel price and weather tools. + +```shell +String prompt1 = new MistralTools.PromptBuilder() + .withToolSpecification(fuelPriceToolSpecification) + .withToolSpecification(weatherToolSpecification) + .withPrompt("What is the petrol price in Bengaluru?") + .build(); +OllamaToolsResult toolsResult = ollamaAPI.generateWithTools(model, prompt1, false, new OptionsBuilder().build()); +for (Map.Entry r : toolsResult.getToolResults().entrySet()) { + System.out.printf("[Response from tool '%s']: %s%n", r.getKey().getName(), r.getValue().toString()); +} +``` + +Now, fire away your question to the model. + +You will get a response similar to: + +::::tip[LLM Response] + +[Response from tool 'current-fuel-price']: Current price of petrol in Bengaluru is Rs.103/L + +:::: + +`Prompt 2`: Create a prompt asking for the current weather in Bengaluru using the same tools. + +```shell +String prompt2 = new MistralTools.PromptBuilder() + .withToolSpecification(fuelPriceToolSpecification) + .withToolSpecification(weatherToolSpecification) + .withPrompt("What is the current weather in Bengaluru?") + .build(); +OllamaToolsResult toolsResult = ollamaAPI.generateWithTools(model, prompt2, false, new OptionsBuilder().build()); +for (Map.Entry r : toolsResult.getToolResults().entrySet()) { + System.out.printf("[Response from tool '%s']: %s%n", r.getKey().getName(), r.getValue().toString()); +} +``` + +Again, fire away your question to the model. + +You will get a response similar to: + +::::tip[LLM Response] + +[Response from tool 'current-weather']: Currently Bengaluru's weather is nice +:::: + +### Full Example + +```java + +import io.github.amithkoujalgi.ollama4j.core.OllamaAPI; +import io.github.amithkoujalgi.ollama4j.core.exceptions.OllamaBaseException; +import io.github.amithkoujalgi.ollama4j.core.tools.ToolDef; +import io.github.amithkoujalgi.ollama4j.core.tools.MistralTools; +import io.github.amithkoujalgi.ollama4j.core.tools.OllamaToolsResult; +import io.github.amithkoujalgi.ollama4j.core.utils.OptionsBuilder; + +import java.io.IOException; +import java.util.Arrays; +import java.util.Map; + +public class FunctionCallingWithMistral { + public static void main(String[] args) throws Exception { + String host = "http://localhost:11434/"; + OllamaAPI ollamaAPI = new OllamaAPI(host); + ollamaAPI.setRequestTimeoutSeconds(60); + + String model = "mistral"; + + + MistralTools.ToolSpecification fuelPriceToolSpecification = MistralTools.ToolSpecification.builder() + .functionName("current-fuel-price") + .functionDesc("Get current fuel price") + .props( + new MistralTools.PropsBuilder() + .withProperty("location", MistralTools.PromptFuncDefinition.Property.builder().type("string").description("The city, e.g. New Delhi, India").required(true).build()) + .withProperty("fuelType", MistralTools.PromptFuncDefinition.Property.builder().type("string").description("The fuel type.").enumValues(Arrays.asList("petrol", "diesel")).required(true).build()) + .build() + ) + .toolDefinition(SampleTools::getCurrentFuelPrice) + .build(); + + MistralTools.ToolSpecification weatherToolSpecification = MistralTools.ToolSpecification.builder() + .functionName("current-weather") + .functionDesc("Get current weather") + .props( + new MistralTools.PropsBuilder() + .withProperty("city", MistralTools.PromptFuncDefinition.Property.builder().type("string").description("The city, e.g. New Delhi, India").required(true).build()) + .build() + ) + .toolDefinition(SampleTools::getCurrentWeather) + .build(); + + ollamaAPI.registerTool(fuelPriceToolSpecification); + ollamaAPI.registerTool(weatherToolSpecification); + + String prompt1 = new MistralTools.PromptBuilder() + .withToolSpecification(fuelPriceToolSpecification) + .withToolSpecification(weatherToolSpecification) + .withPrompt("What is the petrol price in Bengaluru?") + .build(); + String prompt2 = new MistralTools.PromptBuilder() + .withToolSpecification(fuelPriceToolSpecification) + .withToolSpecification(weatherToolSpecification) + .withPrompt("What is the current weather in Bengaluru?") + .build(); + + ask(ollamaAPI, model, prompt1); + ask(ollamaAPI, model, prompt2); + } + + public static void ask(OllamaAPI ollamaAPI, String model, String prompt) throws OllamaBaseException, IOException, InterruptedException { + OllamaToolsResult toolsResult = ollamaAPI.generateWithTools(model, prompt, false, new OptionsBuilder().build()); + for (Map.Entry r : toolsResult.getToolResults().entrySet()) { + System.out.printf("[Response from tool '%s']: %s%n", r.getKey().getName(), r.getValue().toString()); + } + } +} + +class SampleTools { + public static String getCurrentFuelPrice(Map arguments) { + String location = arguments.get("location").toString(); + String fuelType = arguments.get("fuelType").toString(); + return "Current price of " + fuelType + " in " + location + " is Rs.103/L"; + } + + public static String getCurrentWeather(Map arguments) { + String location = arguments.get("city").toString(); + return "Currently " + location + "'s weather is nice."; + } +} + +``` + +Run this full example and you will get a response similar to: + +::::tip[LLM Response] + +[Response from tool 'current-fuel-price']: Current price of petrol in Bengaluru is Rs.103/L + +[Response from tool 'current-weather']: Currently Bengaluru's weather is nice +:::: + +### Room for improvement + +Instead of explicitly registering `ollamaAPI.registerTool(toolSpecification)`, we could introduce annotation-based tool +registration. For example: + +```java + +@ToolSpec(name = "current-fuel-price", desc = "Get current fuel price") +public String getCurrentFuelPrice(Map arguments) { + String location = arguments.get("location").toString(); + String fuelType = arguments.get("fuelType").toString(); + return "Current price of " + fuelType + " in " + location + " is Rs.103/L"; +} +``` + +Instead of passing a map of args `Map arguments` to the tool functions, we could support passing +specific args separately with their data types. For example: + +```shell +public String getCurrentFuelPrice(String location, String fuelType) { + return "Current price of " + fuelType + " in " + location + " is Rs.103/L"; +} +``` + +Updating async/chat APIs with support for tool-based generation. \ No newline at end of file diff --git a/docs/docs/apis-generate/prompt-builder.md b/docs/docs/apis-generate/prompt-builder.md index a798808..ffe57d7 100644 --- a/docs/docs/apis-generate/prompt-builder.md +++ b/docs/docs/apis-generate/prompt-builder.md @@ -1,5 +1,5 @@ --- -sidebar_position: 5 +sidebar_position: 6 --- # Prompt Builder diff --git a/pom.xml b/pom.xml index 800ba57..c2f3754 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 io.github.amithkoujalgi diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaAPI.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaAPI.java index 1f22210..80654ae 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaAPI.java +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaAPI.java @@ -10,6 +10,7 @@ import io.github.amithkoujalgi.ollama4j.core.models.embeddings.OllamaEmbeddingRe 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.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 org.slf4j.Logger; @@ -25,9 +26,7 @@ import java.net.http.HttpResponse; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.time.Duration; -import java.util.ArrayList; -import java.util.Base64; -import java.util.List; +import java.util.*; /** * The base Ollama API class. @@ -339,6 +338,7 @@ public class OllamaAPI { } } + /** * Generate response for a question to a model running on Ollama server. This is a sync/blocking * call. @@ -351,9 +351,10 @@ public class OllamaAPI { * @param streamHandler optional callback consumer that will be applied every time a streamed response is received. If not set, the stream parameter of the request is set to false. * @return OllamaResult that includes response text and time taken for response */ - public OllamaResult generate(String model, String prompt, Options options, OllamaStreamHandler streamHandler) + public OllamaResult generate(String model, String prompt, boolean raw, Options options, OllamaStreamHandler streamHandler) throws OllamaBaseException, IOException, InterruptedException { OllamaGenerateRequestModel ollamaRequestModel = new OllamaGenerateRequestModel(model, prompt); + ollamaRequestModel.setRaw(raw); ollamaRequestModel.setOptions(options.getOptionsMap()); return generateSyncForOllamaRequestModel(ollamaRequestModel, streamHandler); } @@ -361,13 +362,37 @@ public class OllamaAPI { /** * Convenience method to call Ollama API without streaming responses. *

- * Uses {@link #generate(String, String, Options, OllamaStreamHandler)} + * Uses {@link #generate(String, String, boolean, Options, OllamaStreamHandler)} + * + * @param model Model to use + * @param prompt Prompt text + * @param raw In some cases, you may wish to bypass the templating system and provide a full prompt. In this case, you can use the raw parameter to disable templating. Also note that raw mode will not return a context. + * @param options Additional Options + * @return OllamaResult */ - public OllamaResult generate(String model, String prompt, Options options) + public OllamaResult generate(String model, String prompt, boolean raw, Options options) throws OllamaBaseException, IOException, InterruptedException { - return generate(model, prompt, options, null); + return generate(model, prompt, raw, options, null); } + + public OllamaToolsResult generateWithTools(String model, String prompt, boolean raw, Options options) + throws OllamaBaseException, IOException, InterruptedException { + OllamaToolsResult toolResult = new OllamaToolsResult(); + Map toolResults = new HashMap<>(); + + OllamaResult result = generate(model, prompt, raw, options, null); + toolResult.setModelResult(result); + + List toolDefs = Utils.getObjectMapper().readValue(result.getResponse(), Utils.getObjectMapper().getTypeFactory().constructCollectionType(List.class, ToolDef.class)); + for (ToolDef toolDef : toolDefs) { + toolResults.put(toolDef, invokeTool(toolDef)); + } + toolResult.setToolResults(toolResults); + return toolResult; + } + + /** * Generate response for a question to a model running on Ollama server and get a callback handle * that can be used to check for status and get the response from the model later. This would be @@ -377,9 +402,9 @@ public class OllamaAPI { * @param prompt the prompt/question text * @return the ollama async result callback handle */ - public OllamaAsyncResultCallback generateAsync(String model, String prompt) { + public OllamaAsyncResultCallback generateAsync(String model, String prompt, boolean raw) { OllamaGenerateRequestModel ollamaRequestModel = new OllamaGenerateRequestModel(model, prompt); - + ollamaRequestModel.setRaw(raw); URI uri = URI.create(this.host + "/api/generate"); OllamaAsyncResultCallback ollamaAsyncResultCallback = new OllamaAsyncResultCallback( @@ -576,4 +601,24 @@ public class OllamaAPI { private boolean isBasicAuthCredentialsSet() { return basicAuth != null; } + + + public void registerTool(MistralTools.ToolSpecification toolSpecification) { + ToolRegistry.addFunction(toolSpecification.getFunctionName(), toolSpecification.getToolDefinition()); + } + + private Object invokeTool(ToolDef toolDef) { + try { + String methodName = toolDef.getName(); + Map arguments = toolDef.getArguments(); + DynamicFunction function = ToolRegistry.getFunction(methodName); + if (function == null) { + throw new IllegalArgumentException("No such tool: " + methodName); + } + return function.apply(arguments); + } catch (Exception e) { + e.printStackTrace(); + return "Error calling tool: " + e.getMessage(); + } + } } diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/OllamaGenerateEndpointCaller.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/OllamaGenerateEndpointCaller.java index fe7fbec..d3d71e4 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/OllamaGenerateEndpointCaller.java +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/OllamaGenerateEndpointCaller.java @@ -1,9 +1,5 @@ package io.github.amithkoujalgi.ollama4j.core.models.request; -import java.io.IOException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import com.fasterxml.jackson.core.JsonProcessingException; import io.github.amithkoujalgi.ollama4j.core.OllamaStreamHandler; import io.github.amithkoujalgi.ollama4j.core.exceptions.OllamaBaseException; @@ -13,15 +9,19 @@ import io.github.amithkoujalgi.ollama4j.core.models.generate.OllamaGenerateRespo import io.github.amithkoujalgi.ollama4j.core.models.generate.OllamaGenerateStreamObserver; import io.github.amithkoujalgi.ollama4j.core.utils.OllamaRequestBody; import io.github.amithkoujalgi.ollama4j.core.utils.Utils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; -public class OllamaGenerateEndpointCaller extends OllamaEndpointCaller{ +import java.io.IOException; + +public class OllamaGenerateEndpointCaller extends OllamaEndpointCaller { private static final Logger LOG = LoggerFactory.getLogger(OllamaGenerateEndpointCaller.class); private OllamaGenerateStreamObserver streamObserver; public OllamaGenerateEndpointCaller(String host, BasicAuth basicAuth, long requestTimeoutSeconds, boolean verbose) { - super(host, basicAuth, requestTimeoutSeconds, verbose); + super(host, basicAuth, requestTimeoutSeconds, verbose); } @Override @@ -31,24 +31,22 @@ public class OllamaGenerateEndpointCaller extends OllamaEndpointCaller{ @Override protected boolean parseResponseAndAddToBuffer(String line, StringBuilder responseBuffer) { - try { - OllamaGenerateResponseModel ollamaResponseModel = Utils.getObjectMapper().readValue(line, OllamaGenerateResponseModel.class); - responseBuffer.append(ollamaResponseModel.getResponse()); - if(streamObserver != null) { - streamObserver.notify(ollamaResponseModel); - } - return ollamaResponseModel.isDone(); - } catch (JsonProcessingException e) { - LOG.error("Error parsing the Ollama chat response!",e); - return true; - } + try { + OllamaGenerateResponseModel ollamaResponseModel = Utils.getObjectMapper().readValue(line, OllamaGenerateResponseModel.class); + responseBuffer.append(ollamaResponseModel.getResponse()); + if (streamObserver != null) { + streamObserver.notify(ollamaResponseModel); + } + return ollamaResponseModel.isDone(); + } catch (JsonProcessingException e) { + LOG.error("Error parsing the Ollama chat response!", e); + return true; + } } public OllamaResult call(OllamaRequestBody body, OllamaStreamHandler streamHandler) - throws OllamaBaseException, IOException, InterruptedException { - streamObserver = new OllamaGenerateStreamObserver(streamHandler); - return super.callSync(body); + throws OllamaBaseException, IOException, InterruptedException { + streamObserver = new OllamaGenerateStreamObserver(streamHandler); + return super.callSync(body); } - - } diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/DynamicFunction.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/DynamicFunction.java new file mode 100644 index 0000000..5b8f5e6 --- /dev/null +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/DynamicFunction.java @@ -0,0 +1,8 @@ +package io.github.amithkoujalgi.ollama4j.core.tools; + +import java.util.Map; + +@FunctionalInterface +public interface DynamicFunction { + Object apply(Map arguments); +} diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/MistralTools.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/MistralTools.java new file mode 100644 index 0000000..fff8071 --- /dev/null +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/MistralTools.java @@ -0,0 +1,139 @@ +package io.github.amithkoujalgi.ollama4j.core.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 lombok.Builder; +import lombok.Data; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class MistralTools { + @Data + @Builder + public static class ToolSpecification { + private String functionName; + private String functionDesc; + private Map props; + private DynamicFunction toolDefinition; + } + + @Data + @JsonIgnoreProperties(ignoreUnknown = true) + public static class PromptFuncDefinition { + private String type; + private PromptFuncSpec function; + + @Data + public static class PromptFuncSpec { + private String name; + private String description; + private Parameters parameters; + } + + @Data + public static class Parameters { + private String type; + private Map properties; + private List required; + } + + @Data + @Builder + public static class Property { + private String type; + private String description; + @JsonProperty("enum") + @JsonInclude(JsonInclude.Include.NON_NULL) + private List enumValues; + @JsonIgnore + private boolean required; + } + } + + public static class PropsBuilder { + private final Map props = new HashMap<>(); + + public PropsBuilder withProperty(String key, PromptFuncDefinition.Property property) { + props.put(key, property); + return this; + } + + public Map build() { + return props; + } + } + + public static class PromptBuilder { + private final List tools = new ArrayList<>(); + + private String promptText; + + public String build() throws JsonProcessingException { + return "[AVAILABLE_TOOLS] " + Utils.getObjectMapper().writeValueAsString(tools) + "[/AVAILABLE_TOOLS][INST] " + promptText + " [/INST]"; + } + + public PromptBuilder withPrompt(String prompt) throws JsonProcessingException { + promptText = prompt; + return this; + } + + public PromptBuilder withToolSpecification(ToolSpecification spec) { + PromptFuncDefinition def = new PromptFuncDefinition(); + def.setType("function"); + + PromptFuncDefinition.PromptFuncSpec functionDetail = new PromptFuncDefinition.PromptFuncSpec(); + functionDetail.setName(spec.getFunctionName()); + functionDetail.setDescription(spec.getFunctionDesc()); + + PromptFuncDefinition.Parameters parameters = new PromptFuncDefinition.Parameters(); + parameters.setType("object"); + parameters.setProperties(spec.getProps()); + + List requiredValues = new ArrayList<>(); + for (Map.Entry p : spec.getProps().entrySet()) { + if (p.getValue().isRequired()) { + requiredValues.add(p.getKey()); + } + } + parameters.setRequired(requiredValues); + functionDetail.setParameters(parameters); + def.setFunction(functionDetail); + + tools.add(def); + return this; + } +// +// public PromptBuilder withToolSpecification(String functionName, String functionDesc, Map props) { +// PromptFuncDefinition def = new PromptFuncDefinition(); +// def.setType("function"); +// +// PromptFuncDefinition.PromptFuncSpec functionDetail = new PromptFuncDefinition.PromptFuncSpec(); +// functionDetail.setName(functionName); +// functionDetail.setDescription(functionDesc); +// +// PromptFuncDefinition.Parameters parameters = new PromptFuncDefinition.Parameters(); +// parameters.setType("object"); +// parameters.setProperties(props); +// +// List requiredValues = new ArrayList<>(); +// for (Map.Entry p : props.entrySet()) { +// if (p.getValue().isRequired()) { +// requiredValues.add(p.getKey()); +// } +// } +// parameters.setRequired(requiredValues); +// functionDetail.setParameters(parameters); +// def.setFunction(functionDetail); +// +// tools.add(def); +// return this; +// } + } +} diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/OllamaToolsResult.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/OllamaToolsResult.java new file mode 100644 index 0000000..65ef3ac --- /dev/null +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/OllamaToolsResult.java @@ -0,0 +1,16 @@ +package io.github.amithkoujalgi.ollama4j.core.tools; + +import io.github.amithkoujalgi.ollama4j.core.models.OllamaResult; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Map; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class OllamaToolsResult { + private OllamaResult modelResult; + private Map toolResults; +} diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolDef.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolDef.java new file mode 100644 index 0000000..751d186 --- /dev/null +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolDef.java @@ -0,0 +1,18 @@ +package io.github.amithkoujalgi.ollama4j.core.tools; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Map; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ToolDef { + + private String name; + private Map arguments; + +} + diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolRegistry.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolRegistry.java new file mode 100644 index 0000000..0004c7f --- /dev/null +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolRegistry.java @@ -0,0 +1,17 @@ +package io.github.amithkoujalgi.ollama4j.core.tools; + +import java.util.HashMap; +import java.util.Map; + +public class ToolRegistry { + private static final Map functionMap = new HashMap<>(); + + + public static DynamicFunction getFunction(String name) { + return functionMap.get(name); + } + + public static void addFunction(String name, DynamicFunction function) { + functionMap.put(name, function); + } +} diff --git a/src/test/java/io/github/amithkoujalgi/ollama4j/integrationtests/TestRealAPIs.java b/src/test/java/io/github/amithkoujalgi/ollama4j/integrationtests/TestRealAPIs.java index d822077..58e55a1 100644 --- a/src/test/java/io/github/amithkoujalgi/ollama4j/integrationtests/TestRealAPIs.java +++ b/src/test/java/io/github/amithkoujalgi/ollama4j/integrationtests/TestRealAPIs.java @@ -1,7 +1,5 @@ package io.github.amithkoujalgi.ollama4j.integrationtests; -import static org.junit.jupiter.api.Assertions.*; - import io.github.amithkoujalgi.ollama4j.core.OllamaAPI; import io.github.amithkoujalgi.ollama4j.core.exceptions.OllamaBaseException; import io.github.amithkoujalgi.ollama4j.core.models.ModelDetail; @@ -10,9 +8,16 @@ 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.OllamaEmbeddingsRequestModel; 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 lombok.Data; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -22,372 +27,369 @@ import java.net.http.HttpConnectTimeoutException; import java.util.List; import java.util.Objects; import java.util.Properties; -import lombok.Data; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Order; -import org.junit.jupiter.api.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; + +import static org.junit.jupiter.api.Assertions.*; class TestRealAPIs { - private static final Logger LOG = LoggerFactory.getLogger(TestRealAPIs.class); + private static final Logger LOG = LoggerFactory.getLogger(TestRealAPIs.class); - OllamaAPI ollamaAPI; - Config config; + OllamaAPI ollamaAPI; + Config config; - private File getImageFileFromClasspath(String fileName) { - ClassLoader classLoader = getClass().getClassLoader(); - return new File(Objects.requireNonNull(classLoader.getResource(fileName)).getFile()); - } - - @BeforeEach - void setUp() { - config = new Config(); - ollamaAPI = new OllamaAPI(config.getOllamaURL()); - ollamaAPI.setRequestTimeoutSeconds(config.getRequestTimeoutSeconds()); - } - - @Test - @Order(1) - void testWrongEndpoint() { - OllamaAPI ollamaAPI = new OllamaAPI("http://wrong-host:11434"); - assertThrows(ConnectException.class, ollamaAPI::listModels); - } - - @Test - @Order(1) - void testEndpointReachability() { - try { - assertNotNull(ollamaAPI.listModels()); - } catch (HttpConnectTimeoutException e) { - fail(e.getMessage()); - } catch (Exception e) { - fail(e); + private File getImageFileFromClasspath(String fileName) { + ClassLoader classLoader = getClass().getClassLoader(); + return new File(Objects.requireNonNull(classLoader.getResource(fileName)).getFile()); } - } - @Test - @Order(2) - void testListModels() { - testEndpointReachability(); - try { - assertNotNull(ollamaAPI.listModels()); - ollamaAPI.listModels().forEach(System.out::println); - } catch (IOException | OllamaBaseException | InterruptedException | URISyntaxException e) { - fail(e); + @BeforeEach + void setUp() { + config = new Config(); + ollamaAPI = new OllamaAPI(config.getOllamaURL()); + ollamaAPI.setRequestTimeoutSeconds(config.getRequestTimeoutSeconds()); } - } - @Test - @Order(2) - void testPullModel() { - testEndpointReachability(); - try { - ollamaAPI.pullModel(config.getModel()); - boolean found = - ollamaAPI.listModels().stream() - .anyMatch(model -> model.getModel().equalsIgnoreCase(config.getModel())); - assertTrue(found); - } catch (IOException | OllamaBaseException | InterruptedException | URISyntaxException e) { - fail(e); + @Test + @Order(1) + void testWrongEndpoint() { + OllamaAPI ollamaAPI = new OllamaAPI("http://wrong-host:11434"); + assertThrows(ConnectException.class, ollamaAPI::listModels); } - } - @Test - @Order(3) - void testListDtails() { - testEndpointReachability(); - try { - ModelDetail modelDetails = ollamaAPI.getModelDetails(config.getModel()); - assertNotNull(modelDetails); - System.out.println(modelDetails); - } catch (IOException | OllamaBaseException | InterruptedException | URISyntaxException e) { - fail(e); + @Test + @Order(1) + void testEndpointReachability() { + try { + assertNotNull(ollamaAPI.listModels()); + } catch (HttpConnectTimeoutException e) { + fail(e.getMessage()); + } catch (Exception e) { + fail(e); + } } - } - @Test - @Order(3) - void testAskModelWithDefaultOptions() { - testEndpointReachability(); - try { - OllamaResult result = - ollamaAPI.generate( - config.getModel(), - "What is the capital of France? And what's France's connection with Mona Lisa?", - new OptionsBuilder().build()); - assertNotNull(result); - assertNotNull(result.getResponse()); - assertFalse(result.getResponse().isEmpty()); - } catch (IOException | OllamaBaseException | InterruptedException e) { - fail(e); + @Test + @Order(2) + void testListModels() { + testEndpointReachability(); + try { + assertNotNull(ollamaAPI.listModels()); + ollamaAPI.listModels().forEach(System.out::println); + } catch (IOException | OllamaBaseException | InterruptedException | URISyntaxException e) { + fail(e); + } } - } - @Test - @Order(3) - void testAskModelWithDefaultOptionsStreamed() { - testEndpointReachability(); - try { - - StringBuffer sb = new StringBuffer(""); - - OllamaResult result = ollamaAPI.generate(config.getModel(), - "What is the capital of France? And what's France's connection with Mona Lisa?", - new OptionsBuilder().build(), (s) -> { - LOG.info(s); - String substring = s.substring(sb.toString().length(), s.length()); - LOG.info(substring); - sb.append(substring); - }); - - assertNotNull(result); - assertNotNull(result.getResponse()); - assertFalse(result.getResponse().isEmpty()); - assertEquals(sb.toString().trim(), result.getResponse().trim()); - } catch (IOException | OllamaBaseException | InterruptedException e) { - fail(e); + @Test + @Order(2) + void testPullModel() { + testEndpointReachability(); + try { + ollamaAPI.pullModel(config.getModel()); + boolean found = + ollamaAPI.listModels().stream() + .anyMatch(model -> model.getModel().equalsIgnoreCase(config.getModel())); + assertTrue(found); + } catch (IOException | OllamaBaseException | InterruptedException | URISyntaxException e) { + fail(e); + } } - } - @Test - @Order(3) - void testAskModelWithOptions() { - testEndpointReachability(); - try { - OllamaResult result = - ollamaAPI.generate( - config.getModel(), - "What is the capital of France? And what's France's connection with Mona Lisa?", - new OptionsBuilder().setTemperature(0.9f).build()); - assertNotNull(result); - assertNotNull(result.getResponse()); - assertFalse(result.getResponse().isEmpty()); - } catch (IOException | OllamaBaseException | InterruptedException e) { - fail(e); + @Test + @Order(3) + void testListDtails() { + testEndpointReachability(); + try { + ModelDetail modelDetails = ollamaAPI.getModelDetails(config.getModel()); + assertNotNull(modelDetails); + System.out.println(modelDetails); + } catch (IOException | OllamaBaseException | InterruptedException | URISyntaxException e) { + fail(e); + } } - } - @Test - @Order(3) - void testChat() { - testEndpointReachability(); - try { - OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance(config.getModel()); - OllamaChatRequestModel requestModel = builder.withMessage(OllamaChatMessageRole.USER, "What is the capital of France?") - .withMessage(OllamaChatMessageRole.ASSISTANT, "Should be Paris!") - .withMessage(OllamaChatMessageRole.USER,"And what is the second larges city?") - .build(); - - OllamaChatResult chatResult = ollamaAPI.chat(requestModel); - assertNotNull(chatResult); - assertFalse(chatResult.getResponse().isBlank()); - assertEquals(4,chatResult.getChatHistory().size()); - } catch (IOException | OllamaBaseException | InterruptedException e) { - fail(e); + @Test + @Order(3) + void testAskModelWithDefaultOptions() { + testEndpointReachability(); + try { + OllamaResult result = + ollamaAPI.generate( + config.getModel(), + "What is the capital of France? And what's France's connection with Mona Lisa?", + false, + new OptionsBuilder().build()); + assertNotNull(result); + assertNotNull(result.getResponse()); + assertFalse(result.getResponse().isEmpty()); + } catch (IOException | OllamaBaseException | InterruptedException e) { + fail(e); + } } - } - @Test - @Order(3) - void testChatWithSystemPrompt() { - testEndpointReachability(); - try { - OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance(config.getModel()); - OllamaChatRequestModel requestModel = builder.withMessage(OllamaChatMessageRole.SYSTEM, - "You are a silent bot that only says 'NI'. Do not say anything else under any circumstances!") - .withMessage(OllamaChatMessageRole.USER, - "What is the capital of France? And what's France's connection with Mona Lisa?") - .build(); + @Test + @Order(3) + void testAskModelWithDefaultOptionsStreamed() { + testEndpointReachability(); + try { + StringBuffer sb = new StringBuffer(""); + OllamaResult result = ollamaAPI.generate(config.getModel(), + "What is the capital of France? And what's France's connection with Mona Lisa?", + false, + new OptionsBuilder().build(), (s) -> { + LOG.info(s); + String substring = s.substring(sb.toString().length(), s.length()); + LOG.info(substring); + sb.append(substring); + }); - OllamaChatResult chatResult = ollamaAPI.chat(requestModel); - assertNotNull(chatResult); - assertFalse(chatResult.getResponse().isBlank()); - assertTrue(chatResult.getResponse().startsWith("NI")); - assertEquals(3, chatResult.getChatHistory().size()); - } catch (IOException | OllamaBaseException | InterruptedException e) { - fail(e); + assertNotNull(result); + assertNotNull(result.getResponse()); + assertFalse(result.getResponse().isEmpty()); + assertEquals(sb.toString().trim(), result.getResponse().trim()); + } catch (IOException | OllamaBaseException | InterruptedException e) { + fail(e); + } } - } - @Test - @Order(3) - void testChatWithStream() { - testEndpointReachability(); - try { - OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance(config.getModel()); - OllamaChatRequestModel requestModel = builder.withMessage(OllamaChatMessageRole.USER, - "What is the capital of France? And what's France's connection with Mona Lisa?") - .build(); - - StringBuffer sb = new StringBuffer(""); - - OllamaChatResult chatResult = ollamaAPI.chat(requestModel,(s) -> { - LOG.info(s); - String substring = s.substring(sb.toString().length(), s.length()); - LOG.info(substring); - sb.append(substring); - }); - assertNotNull(chatResult); - assertEquals(sb.toString().trim(), chatResult.getResponse().trim()); - } catch (IOException | OllamaBaseException | InterruptedException e) { - fail(e); + @Test + @Order(3) + void testAskModelWithOptions() { + testEndpointReachability(); + try { + OllamaResult result = + ollamaAPI.generate( + config.getModel(), + "What is the capital of France? And what's France's connection with Mona Lisa?", + true, + new OptionsBuilder().setTemperature(0.9f).build()); + assertNotNull(result); + assertNotNull(result.getResponse()); + assertFalse(result.getResponse().isEmpty()); + } catch (IOException | OllamaBaseException | InterruptedException e) { + fail(e); + } } - } - @Test - @Order(3) - void testChatWithImageFromFileWithHistoryRecognition() { - testEndpointReachability(); - try { - OllamaChatRequestBuilder builder = - OllamaChatRequestBuilder.getInstance(config.getImageModel()); - OllamaChatRequestModel requestModel = - builder.withMessage(OllamaChatMessageRole.USER, "What's in the picture?", - List.of(getImageFileFromClasspath("dog-on-a-boat.jpg"))).build(); + @Test + @Order(3) + void testChat() { + testEndpointReachability(); + try { + OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance(config.getModel()); + OllamaChatRequestModel requestModel = builder.withMessage(OllamaChatMessageRole.USER, "What is the capital of France?") + .withMessage(OllamaChatMessageRole.ASSISTANT, "Should be Paris!") + .withMessage(OllamaChatMessageRole.USER, "And what is the second larges city?") + .build(); - OllamaChatResult chatResult = ollamaAPI.chat(requestModel); - assertNotNull(chatResult); - assertNotNull(chatResult.getResponse()); - - builder.reset(); - - requestModel = - builder.withMessages(chatResult.getChatHistory()) - .withMessage(OllamaChatMessageRole.USER, "What's the dogs breed?").build(); - - chatResult = ollamaAPI.chat(requestModel); - assertNotNull(chatResult); - assertNotNull(chatResult.getResponse()); - - - } catch (IOException | OllamaBaseException | InterruptedException e) { - fail(e); + OllamaChatResult chatResult = ollamaAPI.chat(requestModel); + assertNotNull(chatResult); + assertFalse(chatResult.getResponse().isBlank()); + assertEquals(4, chatResult.getChatHistory().size()); + } catch (IOException | OllamaBaseException | InterruptedException e) { + fail(e); + } } - } - @Test - @Order(3) - void testChatWithImageFromURL() { - testEndpointReachability(); - try { - OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance(config.getImageModel()); - OllamaChatRequestModel requestModel = builder.withMessage(OllamaChatMessageRole.USER, "What's in the picture?", - "https://t3.ftcdn.net/jpg/02/96/63/80/360_F_296638053_0gUVA4WVBKceGsIr7LNqRWSnkusi07dq.jpg") - .build(); + @Test + @Order(3) + void testChatWithSystemPrompt() { + testEndpointReachability(); + try { + OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance(config.getModel()); + OllamaChatRequestModel requestModel = builder.withMessage(OllamaChatMessageRole.SYSTEM, + "You are a silent bot that only says 'NI'. Do not say anything else under any circumstances!") + .withMessage(OllamaChatMessageRole.USER, + "What is the capital of France? And what's France's connection with Mona Lisa?") + .build(); - OllamaChatResult chatResult = ollamaAPI.chat(requestModel); - assertNotNull(chatResult); - } catch (IOException | OllamaBaseException | InterruptedException e) { - fail(e); + OllamaChatResult chatResult = ollamaAPI.chat(requestModel); + assertNotNull(chatResult); + assertFalse(chatResult.getResponse().isBlank()); + assertTrue(chatResult.getResponse().startsWith("NI")); + assertEquals(3, chatResult.getChatHistory().size()); + } catch (IOException | OllamaBaseException | InterruptedException e) { + fail(e); + } } - } - @Test - @Order(3) - void testAskModelWithOptionsAndImageFiles() { - testEndpointReachability(); - File imageFile = getImageFileFromClasspath("dog-on-a-boat.jpg"); - try { - OllamaResult result = - ollamaAPI.generateWithImageFiles( - config.getImageModel(), - "What is in this image?", - List.of(imageFile), - new OptionsBuilder().build()); - assertNotNull(result); - assertNotNull(result.getResponse()); - assertFalse(result.getResponse().isEmpty()); - } catch (IOException | OllamaBaseException | InterruptedException e) { - fail(e); + @Test + @Order(3) + void testChatWithStream() { + testEndpointReachability(); + try { + OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance(config.getModel()); + OllamaChatRequestModel requestModel = builder.withMessage(OllamaChatMessageRole.USER, + "What is the capital of France? And what's France's connection with Mona Lisa?") + .build(); + + StringBuffer sb = new StringBuffer(""); + + OllamaChatResult chatResult = ollamaAPI.chat(requestModel, (s) -> { + LOG.info(s); + String substring = s.substring(sb.toString().length(), s.length()); + LOG.info(substring); + sb.append(substring); + }); + assertNotNull(chatResult); + assertEquals(sb.toString().trim(), chatResult.getResponse().trim()); + } catch (IOException | OllamaBaseException | InterruptedException e) { + fail(e); + } } - } - @Test - @Order(3) - void testAskModelWithOptionsAndImageFilesStreamed() { - testEndpointReachability(); - File imageFile = getImageFileFromClasspath("dog-on-a-boat.jpg"); - try { - StringBuffer sb = new StringBuffer(""); + @Test + @Order(3) + void testChatWithImageFromFileWithHistoryRecognition() { + testEndpointReachability(); + try { + OllamaChatRequestBuilder builder = + OllamaChatRequestBuilder.getInstance(config.getImageModel()); + OllamaChatRequestModel requestModel = + builder.withMessage(OllamaChatMessageRole.USER, "What's in the picture?", + List.of(getImageFileFromClasspath("dog-on-a-boat.jpg"))).build(); - OllamaResult result = ollamaAPI.generateWithImageFiles(config.getImageModel(), - "What is in this image?", List.of(imageFile), new OptionsBuilder().build(), (s) -> { - LOG.info(s); - String substring = s.substring(sb.toString().length(), s.length()); - LOG.info(substring); - sb.append(substring); - }); - assertNotNull(result); - assertNotNull(result.getResponse()); - assertFalse(result.getResponse().isEmpty()); - assertEquals(sb.toString().trim(), result.getResponse().trim()); - } catch (IOException | OllamaBaseException | InterruptedException e) { - fail(e); + OllamaChatResult chatResult = ollamaAPI.chat(requestModel); + assertNotNull(chatResult); + assertNotNull(chatResult.getResponse()); + + builder.reset(); + + requestModel = + builder.withMessages(chatResult.getChatHistory()) + .withMessage(OllamaChatMessageRole.USER, "What's the dogs breed?").build(); + + chatResult = ollamaAPI.chat(requestModel); + assertNotNull(chatResult); + assertNotNull(chatResult.getResponse()); + + + } catch (IOException | OllamaBaseException | InterruptedException e) { + fail(e); + } } - } - @Test - @Order(3) - void testAskModelWithOptionsAndImageURLs() { - testEndpointReachability(); - try { - OllamaResult result = - ollamaAPI.generateWithImageURLs( - config.getImageModel(), - "What is in this image?", - List.of( - "https://t3.ftcdn.net/jpg/02/96/63/80/360_F_296638053_0gUVA4WVBKceGsIr7LNqRWSnkusi07dq.jpg"), - new OptionsBuilder().build()); - assertNotNull(result); - assertNotNull(result.getResponse()); - assertFalse(result.getResponse().isEmpty()); - } catch (IOException | OllamaBaseException | InterruptedException | URISyntaxException e) { - fail(e); + @Test + @Order(3) + void testChatWithImageFromURL() { + testEndpointReachability(); + try { + OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance(config.getImageModel()); + OllamaChatRequestModel requestModel = builder.withMessage(OllamaChatMessageRole.USER, "What's in the picture?", + "https://t3.ftcdn.net/jpg/02/96/63/80/360_F_296638053_0gUVA4WVBKceGsIr7LNqRWSnkusi07dq.jpg") + .build(); + + OllamaChatResult chatResult = ollamaAPI.chat(requestModel); + assertNotNull(chatResult); + } catch (IOException | OllamaBaseException | InterruptedException e) { + fail(e); + } } - } - @Test - @Order(3) - public void testEmbedding() { - testEndpointReachability(); - try { - OllamaEmbeddingsRequestModel request = OllamaEmbeddingsRequestBuilder - .getInstance(config.getModel(), "What is the capital of France?").build(); - - List embeddings = ollamaAPI.generateEmbeddings(request); - - assertNotNull(embeddings); - assertFalse(embeddings.isEmpty()); - } catch (IOException | OllamaBaseException | InterruptedException e) { - fail(e); + @Test + @Order(3) + void testAskModelWithOptionsAndImageFiles() { + testEndpointReachability(); + File imageFile = getImageFileFromClasspath("dog-on-a-boat.jpg"); + try { + OllamaResult result = + ollamaAPI.generateWithImageFiles( + config.getImageModel(), + "What is in this image?", + List.of(imageFile), + new OptionsBuilder().build()); + assertNotNull(result); + assertNotNull(result.getResponse()); + assertFalse(result.getResponse().isEmpty()); + } catch (IOException | OllamaBaseException | InterruptedException e) { + fail(e); + } + } + + @Test + @Order(3) + void testAskModelWithOptionsAndImageFilesStreamed() { + testEndpointReachability(); + File imageFile = getImageFileFromClasspath("dog-on-a-boat.jpg"); + try { + StringBuffer sb = new StringBuffer(""); + + OllamaResult result = ollamaAPI.generateWithImageFiles(config.getImageModel(), + "What is in this image?", List.of(imageFile), new OptionsBuilder().build(), (s) -> { + LOG.info(s); + String substring = s.substring(sb.toString().length(), s.length()); + LOG.info(substring); + sb.append(substring); + }); + assertNotNull(result); + assertNotNull(result.getResponse()); + assertFalse(result.getResponse().isEmpty()); + assertEquals(sb.toString().trim(), result.getResponse().trim()); + } catch (IOException | OllamaBaseException | InterruptedException e) { + fail(e); + } + } + + @Test + @Order(3) + void testAskModelWithOptionsAndImageURLs() { + testEndpointReachability(); + try { + OllamaResult result = + ollamaAPI.generateWithImageURLs( + config.getImageModel(), + "What is in this image?", + List.of( + "https://t3.ftcdn.net/jpg/02/96/63/80/360_F_296638053_0gUVA4WVBKceGsIr7LNqRWSnkusi07dq.jpg"), + new OptionsBuilder().build()); + assertNotNull(result); + assertNotNull(result.getResponse()); + assertFalse(result.getResponse().isEmpty()); + } catch (IOException | OllamaBaseException | InterruptedException | URISyntaxException e) { + fail(e); + } + } + + @Test + @Order(3) + public void testEmbedding() { + testEndpointReachability(); + try { + OllamaEmbeddingsRequestModel request = OllamaEmbeddingsRequestBuilder + .getInstance(config.getModel(), "What is the capital of France?").build(); + + List embeddings = ollamaAPI.generateEmbeddings(request); + + assertNotNull(embeddings); + assertFalse(embeddings.isEmpty()); + } catch (IOException | OllamaBaseException | InterruptedException e) { + fail(e); + } } - } } @Data class Config { - private String ollamaURL; - private String model; - private String imageModel; - private int requestTimeoutSeconds; + private String ollamaURL; + private String model; + private String imageModel; + private int requestTimeoutSeconds; - public Config() { - Properties properties = new Properties(); - try (InputStream input = - getClass().getClassLoader().getResourceAsStream("test-config.properties")) { - if (input == null) { - throw new RuntimeException("Sorry, unable to find test-config.properties"); - } - properties.load(input); - this.ollamaURL = properties.getProperty("ollama.url"); - this.model = properties.getProperty("ollama.model"); - this.imageModel = properties.getProperty("ollama.model.image"); - this.requestTimeoutSeconds = - Integer.parseInt(properties.getProperty("ollama.request-timeout-seconds")); - } catch (IOException e) { - throw new RuntimeException("Error loading properties", e); + public Config() { + Properties properties = new Properties(); + try (InputStream input = + getClass().getClassLoader().getResourceAsStream("test-config.properties")) { + if (input == null) { + throw new RuntimeException("Sorry, unable to find test-config.properties"); + } + properties.load(input); + this.ollamaURL = properties.getProperty("ollama.url"); + this.model = properties.getProperty("ollama.model"); + this.imageModel = properties.getProperty("ollama.model.image"); + this.requestTimeoutSeconds = + Integer.parseInt(properties.getProperty("ollama.request-timeout-seconds")); + } catch (IOException e) { + throw new RuntimeException("Error loading properties", e); + } } - } } diff --git a/src/test/java/io/github/amithkoujalgi/ollama4j/unittests/TestMockedAPIs.java b/src/test/java/io/github/amithkoujalgi/ollama4j/unittests/TestMockedAPIs.java index 879c67c..c5d60e1 100644 --- a/src/test/java/io/github/amithkoujalgi/ollama4j/unittests/TestMockedAPIs.java +++ b/src/test/java/io/github/amithkoujalgi/ollama4j/unittests/TestMockedAPIs.java @@ -1,7 +1,5 @@ package io.github.amithkoujalgi.ollama4j.unittests; -import static org.mockito.Mockito.*; - import io.github.amithkoujalgi.ollama4j.core.OllamaAPI; import io.github.amithkoujalgi.ollama4j.core.exceptions.OllamaBaseException; import io.github.amithkoujalgi.ollama4j.core.models.ModelDetail; @@ -9,155 +7,158 @@ import io.github.amithkoujalgi.ollama4j.core.models.OllamaAsyncResultCallback; 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 org.junit.jupiter.api.Test; +import org.mockito.Mockito; + import java.io.IOException; import java.net.URISyntaxException; import java.util.ArrayList; import java.util.Collections; -import org.junit.jupiter.api.Test; -import org.mockito.Mockito; + +import static org.mockito.Mockito.*; class TestMockedAPIs { - @Test - void testPullModel() { - OllamaAPI ollamaAPI = Mockito.mock(OllamaAPI.class); - String model = OllamaModelType.LLAMA2; - try { - doNothing().when(ollamaAPI).pullModel(model); - ollamaAPI.pullModel(model); - verify(ollamaAPI, times(1)).pullModel(model); - } catch (IOException | OllamaBaseException | InterruptedException | URISyntaxException e) { - throw new RuntimeException(e); + @Test + void testPullModel() { + OllamaAPI ollamaAPI = Mockito.mock(OllamaAPI.class); + String model = OllamaModelType.LLAMA2; + try { + doNothing().when(ollamaAPI).pullModel(model); + ollamaAPI.pullModel(model); + verify(ollamaAPI, times(1)).pullModel(model); + } catch (IOException | OllamaBaseException | InterruptedException | URISyntaxException e) { + throw new RuntimeException(e); + } } - } - @Test - void testListModels() { - OllamaAPI ollamaAPI = Mockito.mock(OllamaAPI.class); - try { - when(ollamaAPI.listModels()).thenReturn(new ArrayList<>()); - ollamaAPI.listModels(); - verify(ollamaAPI, times(1)).listModels(); - } catch (IOException | OllamaBaseException | InterruptedException | URISyntaxException e) { - throw new RuntimeException(e); + @Test + void testListModels() { + OllamaAPI ollamaAPI = Mockito.mock(OllamaAPI.class); + try { + when(ollamaAPI.listModels()).thenReturn(new ArrayList<>()); + ollamaAPI.listModels(); + verify(ollamaAPI, times(1)).listModels(); + } catch (IOException | OllamaBaseException | InterruptedException | URISyntaxException e) { + throw new RuntimeException(e); + } } - } - @Test - void testCreateModel() { - OllamaAPI ollamaAPI = Mockito.mock(OllamaAPI.class); - String model = OllamaModelType.LLAMA2; - String modelFilePath = "FROM llama2\nSYSTEM You are mario from Super Mario Bros."; - try { - doNothing().when(ollamaAPI).createModelWithModelFileContents(model, modelFilePath); - ollamaAPI.createModelWithModelFileContents(model, modelFilePath); - verify(ollamaAPI, times(1)).createModelWithModelFileContents(model, modelFilePath); - } catch (IOException | OllamaBaseException | InterruptedException | URISyntaxException e) { - throw new RuntimeException(e); + @Test + void testCreateModel() { + OllamaAPI ollamaAPI = Mockito.mock(OllamaAPI.class); + String model = OllamaModelType.LLAMA2; + String modelFilePath = "FROM llama2\nSYSTEM You are mario from Super Mario Bros."; + try { + doNothing().when(ollamaAPI).createModelWithModelFileContents(model, modelFilePath); + ollamaAPI.createModelWithModelFileContents(model, modelFilePath); + verify(ollamaAPI, times(1)).createModelWithModelFileContents(model, modelFilePath); + } catch (IOException | OllamaBaseException | InterruptedException | URISyntaxException e) { + throw new RuntimeException(e); + } } - } - @Test - void testDeleteModel() { - OllamaAPI ollamaAPI = Mockito.mock(OllamaAPI.class); - String model = OllamaModelType.LLAMA2; - try { - doNothing().when(ollamaAPI).deleteModel(model, true); - ollamaAPI.deleteModel(model, true); - verify(ollamaAPI, times(1)).deleteModel(model, true); - } catch (IOException | OllamaBaseException | InterruptedException | URISyntaxException e) { - throw new RuntimeException(e); + @Test + void testDeleteModel() { + OllamaAPI ollamaAPI = Mockito.mock(OllamaAPI.class); + String model = OllamaModelType.LLAMA2; + try { + doNothing().when(ollamaAPI).deleteModel(model, true); + ollamaAPI.deleteModel(model, true); + verify(ollamaAPI, times(1)).deleteModel(model, true); + } catch (IOException | OllamaBaseException | InterruptedException | URISyntaxException e) { + throw new RuntimeException(e); + } } - } - @Test - void testGetModelDetails() { - OllamaAPI ollamaAPI = Mockito.mock(OllamaAPI.class); - String model = OllamaModelType.LLAMA2; - try { - when(ollamaAPI.getModelDetails(model)).thenReturn(new ModelDetail()); - ollamaAPI.getModelDetails(model); - verify(ollamaAPI, times(1)).getModelDetails(model); - } catch (IOException | OllamaBaseException | InterruptedException | URISyntaxException e) { - throw new RuntimeException(e); + @Test + void testGetModelDetails() { + OllamaAPI ollamaAPI = Mockito.mock(OllamaAPI.class); + String model = OllamaModelType.LLAMA2; + try { + when(ollamaAPI.getModelDetails(model)).thenReturn(new ModelDetail()); + ollamaAPI.getModelDetails(model); + verify(ollamaAPI, times(1)).getModelDetails(model); + } catch (IOException | OllamaBaseException | InterruptedException | URISyntaxException e) { + throw new RuntimeException(e); + } } - } - @Test - void testGenerateEmbeddings() { - OllamaAPI ollamaAPI = Mockito.mock(OllamaAPI.class); - String model = OllamaModelType.LLAMA2; - String prompt = "some prompt text"; - try { - when(ollamaAPI.generateEmbeddings(model, prompt)).thenReturn(new ArrayList<>()); - ollamaAPI.generateEmbeddings(model, prompt); - verify(ollamaAPI, times(1)).generateEmbeddings(model, prompt); - } catch (IOException | OllamaBaseException | InterruptedException e) { - throw new RuntimeException(e); + @Test + void testGenerateEmbeddings() { + OllamaAPI ollamaAPI = Mockito.mock(OllamaAPI.class); + String model = OllamaModelType.LLAMA2; + String prompt = "some prompt text"; + try { + when(ollamaAPI.generateEmbeddings(model, prompt)).thenReturn(new ArrayList<>()); + ollamaAPI.generateEmbeddings(model, prompt); + verify(ollamaAPI, times(1)).generateEmbeddings(model, prompt); + } catch (IOException | OllamaBaseException | InterruptedException e) { + throw new RuntimeException(e); + } } - } - @Test - void testAsk() { - OllamaAPI ollamaAPI = Mockito.mock(OllamaAPI.class); - String model = OllamaModelType.LLAMA2; - String prompt = "some prompt text"; - OptionsBuilder optionsBuilder = new OptionsBuilder(); - try { - when(ollamaAPI.generate(model, prompt, optionsBuilder.build())) - .thenReturn(new OllamaResult("", 0, 200)); - ollamaAPI.generate(model, prompt, optionsBuilder.build()); - verify(ollamaAPI, times(1)).generate(model, prompt, optionsBuilder.build()); - } catch (IOException | OllamaBaseException | InterruptedException e) { - throw new RuntimeException(e); + @Test + void testAsk() { + OllamaAPI ollamaAPI = Mockito.mock(OllamaAPI.class); + String model = OllamaModelType.LLAMA2; + String prompt = "some prompt text"; + OptionsBuilder optionsBuilder = new OptionsBuilder(); + try { + when(ollamaAPI.generate(model, prompt, false, optionsBuilder.build())) + .thenReturn(new OllamaResult("", 0, 200)); + ollamaAPI.generate(model, prompt, false, optionsBuilder.build()); + verify(ollamaAPI, times(1)).generate(model, prompt, false, optionsBuilder.build()); + } catch (IOException | OllamaBaseException | InterruptedException e) { + throw new RuntimeException(e); + } } - } - @Test - void testAskWithImageFiles() { - OllamaAPI ollamaAPI = Mockito.mock(OllamaAPI.class); - String model = OllamaModelType.LLAMA2; - String prompt = "some prompt text"; - try { - when(ollamaAPI.generateWithImageFiles( - model, prompt, Collections.emptyList(), new OptionsBuilder().build())) - .thenReturn(new OllamaResult("", 0, 200)); - ollamaAPI.generateWithImageFiles( - model, prompt, Collections.emptyList(), new OptionsBuilder().build()); - verify(ollamaAPI, times(1)) - .generateWithImageFiles( - model, prompt, Collections.emptyList(), new OptionsBuilder().build()); - } catch (IOException | OllamaBaseException | InterruptedException e) { - throw new RuntimeException(e); + @Test + void testAskWithImageFiles() { + OllamaAPI ollamaAPI = Mockito.mock(OllamaAPI.class); + String model = OllamaModelType.LLAMA2; + String prompt = "some prompt text"; + try { + when(ollamaAPI.generateWithImageFiles( + model, prompt, Collections.emptyList(), new OptionsBuilder().build())) + .thenReturn(new OllamaResult("", 0, 200)); + ollamaAPI.generateWithImageFiles( + model, prompt, Collections.emptyList(), new OptionsBuilder().build()); + verify(ollamaAPI, times(1)) + .generateWithImageFiles( + model, prompt, Collections.emptyList(), new OptionsBuilder().build()); + } catch (IOException | OllamaBaseException | InterruptedException e) { + throw new RuntimeException(e); + } } - } - @Test - void testAskWithImageURLs() { - OllamaAPI ollamaAPI = Mockito.mock(OllamaAPI.class); - String model = OllamaModelType.LLAMA2; - String prompt = "some prompt text"; - try { - when(ollamaAPI.generateWithImageURLs( - model, prompt, Collections.emptyList(), new OptionsBuilder().build())) - .thenReturn(new OllamaResult("", 0, 200)); - ollamaAPI.generateWithImageURLs( - model, prompt, Collections.emptyList(), new OptionsBuilder().build()); - verify(ollamaAPI, times(1)) - .generateWithImageURLs( - model, prompt, Collections.emptyList(), new OptionsBuilder().build()); - } catch (IOException | OllamaBaseException | InterruptedException | URISyntaxException e) { - throw new RuntimeException(e); + @Test + void testAskWithImageURLs() { + OllamaAPI ollamaAPI = Mockito.mock(OllamaAPI.class); + String model = OllamaModelType.LLAMA2; + String prompt = "some prompt text"; + try { + when(ollamaAPI.generateWithImageURLs( + model, prompt, Collections.emptyList(), new OptionsBuilder().build())) + .thenReturn(new OllamaResult("", 0, 200)); + ollamaAPI.generateWithImageURLs( + model, prompt, Collections.emptyList(), new OptionsBuilder().build()); + verify(ollamaAPI, times(1)) + .generateWithImageURLs( + model, prompt, Collections.emptyList(), new OptionsBuilder().build()); + } catch (IOException | OllamaBaseException | InterruptedException | URISyntaxException e) { + throw new RuntimeException(e); + } } - } - @Test - void testAskAsync() { - OllamaAPI ollamaAPI = Mockito.mock(OllamaAPI.class); - String model = OllamaModelType.LLAMA2; - String prompt = "some prompt text"; - when(ollamaAPI.generateAsync(model, prompt)) - .thenReturn(new OllamaAsyncResultCallback(null, null, 3)); - ollamaAPI.generateAsync(model, prompt); - verify(ollamaAPI, times(1)).generateAsync(model, prompt); - } + @Test + void testAskAsync() { + OllamaAPI ollamaAPI = Mockito.mock(OllamaAPI.class); + String model = OllamaModelType.LLAMA2; + String prompt = "some prompt text"; + when(ollamaAPI.generateAsync(model, prompt, false)) + .thenReturn(new OllamaAsyncResultCallback(null, null, 3)); + ollamaAPI.generateAsync(model, prompt, false); + verify(ollamaAPI, times(1)).generateAsync(model, prompt, false); + } } -- 2.47.2 From 30bfdd9c6df10297841c8ebf5d0e0563f341ed0d Mon Sep 17 00:00:00 2001 From: amithkoujalgi Date: Fri, 12 Jul 2024 11:38:02 +0000 Subject: [PATCH 012/101] [maven-release-plugin] prepare release v1.0.76 --- pom.xml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index c2f3754..2edc7fd 100644 --- a/pom.xml +++ b/pom.xml @@ -1,11 +1,10 @@ - + 4.0.0 io.github.amithkoujalgi ollama4j - 1.0.76-SNAPSHOT + 1.0.76 Ollama4j Java library for interacting with Ollama API. @@ -40,7 +39,7 @@ scm:git:git@github.com:amithkoujalgi/ollama4j.git scm:git:https://github.com/amithkoujalgi/ollama4j.git https://github.com/amithkoujalgi/ollama4j - v1.0.16 + v1.0.76 -- 2.47.2 From 953605fa7394f72c8e864202cb05b2cd050c8556 Mon Sep 17 00:00:00 2001 From: amithkoujalgi Date: Fri, 12 Jul 2024 11:38:03 +0000 Subject: [PATCH 013/101] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 2edc7fd..391f89e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ io.github.amithkoujalgi ollama4j - 1.0.76 + 1.0.77-SNAPSHOT Ollama4j Java library for interacting with Ollama API. @@ -39,7 +39,7 @@ scm:git:git@github.com:amithkoujalgi/ollama4j.git scm:git:https://github.com/amithkoujalgi/ollama4j.git https://github.com/amithkoujalgi/ollama4j - v1.0.76 + v1.0.16 -- 2.47.2 From 51fbedad69f869c97ea4ffc89087eb1b13622cd2 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Fri, 12 Jul 2024 17:35:41 +0530 Subject: [PATCH 014/101] Updated README.md --- README.md | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f111d6b..46c77da 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +

+ ### Ollama4j ollama4j-icon @@ -9,16 +11,28 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). ![GitHub stars](https://img.shields.io/github/stars/amithkoujalgi/ollama4j) ![GitHub forks](https://img.shields.io/github/forks/amithkoujalgi/ollama4j) ![GitHub watchers](https://img.shields.io/github/watchers/amithkoujalgi/ollama4j) +![Contributors](https://img.shields.io/github/contributors/amithkoujalgi/ollama4j) +![GitHub License](https://img.shields.io/github/license/amithkoujalgi/ollama4j) + ![GitHub repo size](https://img.shields.io/github/repo-size/amithkoujalgi/ollama4j) -![GitHub language count](https://img.shields.io/github/languages/count/amithkoujalgi/ollama4j) ![GitHub top language](https://img.shields.io/github/languages/top/amithkoujalgi/ollama4j) ![GitHub last commit](https://img.shields.io/github/last-commit/amithkoujalgi/ollama4j?color=green) -![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Famithkoujalgi%2Follama4j&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false) - [![codecov](https://codecov.io/gh/amithkoujalgi/ollama4j/graph/badge.svg?token=U0TE7BGP8L)](https://codecov.io/gh/amithkoujalgi/ollama4j) +![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-raw/amithkoujalgi/ollama4j) +![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-closed-raw/amithkoujalgi/ollama4j) +![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-pr-raw/amithkoujalgi/ollama4j) +![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-pr-closed-raw/amithkoujalgi/ollama4j) +![GitHub Discussions](https://img.shields.io/github/discussions/amithkoujalgi/ollama4j) + ![Build Status](https://github.com/amithkoujalgi/ollama4j/actions/workflows/maven-publish.yml/badge.svg) +
+ +[//]: # (![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Famithkoujalgi%2Follama4j&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false)) + +[//]: # (![GitHub language count](https://img.shields.io/github/languages/count/amithkoujalgi/ollama4j)) + ## Table of Contents - [How does it work?](#how-does-it-work) @@ -172,16 +186,28 @@ Contributions are most welcome! Whether it's reporting a bug, proposing an enhan with code - any sort of contribution is much appreciated. +### References + +- [Ollama REST APIs](https://github.com/jmorganca/ollama/blob/main/docs/api.md) + ### Credits The nomenclature and the icon have been adopted from the incredible [Ollama](https://ollama.ai/) project. -### References -- [Ollama REST APIs](https://github.com/jmorganca/ollama/blob/main/docs/api.md) +
-## Appreciate my work? +**Thanks to the amazing contributors** + + + + + +### Appreciate my work? Buy Me A Coffee + +
+ -- 2.47.2 From e8d709e99a5accb3e119c664d6bc81e624d94696 Mon Sep 17 00:00:00 2001 From: amithkoujalgi Date: Fri, 12 Jul 2024 12:07:00 +0000 Subject: [PATCH 015/101] [maven-release-plugin] prepare release v1.0.77 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 391f89e..818ed5f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ io.github.amithkoujalgi ollama4j - 1.0.77-SNAPSHOT + 1.0.77 Ollama4j Java library for interacting with Ollama API. @@ -39,7 +39,7 @@ scm:git:git@github.com:amithkoujalgi/ollama4j.git scm:git:https://github.com/amithkoujalgi/ollama4j.git https://github.com/amithkoujalgi/ollama4j - v1.0.16 + v1.0.77 -- 2.47.2 From cf52c9610c2cc6538b112add5cbb825aa5deaa5d Mon Sep 17 00:00:00 2001 From: amithkoujalgi Date: Fri, 12 Jul 2024 12:07:01 +0000 Subject: [PATCH 016/101] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 818ed5f..2892ed2 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ io.github.amithkoujalgi ollama4j - 1.0.77 + 1.0.78-SNAPSHOT Ollama4j Java library for interacting with Ollama API. @@ -39,7 +39,7 @@ scm:git:git@github.com:amithkoujalgi/ollama4j.git scm:git:https://github.com/amithkoujalgi/ollama4j.git https://github.com/amithkoujalgi/ollama4j - v1.0.77 + v1.0.16 -- 2.47.2 From dd9ba7c937d014da9c832cc8ac1ad5a577e921a5 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 13 Jul 2024 11:50:52 +0530 Subject: [PATCH 017/101] discarded outdated GH workflows Signed-off-by: Amith Koujalgi --- .github/workflows/maven-publish.yml | 134 +++++++++++++------------- .github/workflows/publish-javadoc.yml | 104 ++++++++++---------- 2 files changed, 119 insertions(+), 119 deletions(-) diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index e1ac127..430c375 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -1,68 +1,68 @@ -# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created -# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path - -name: Test and Publish Package - +## This workflow will build a package using Maven and then publish it to GitHub packages when a release is created +## For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path +# +#name: Test and Publish Package +# +##on: +## release: +## types: [ "created" ] +# #on: -# release: -# types: [ "created" ] - -on: - push: - branches: [ "main" ] - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: write - packages: write - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: '11' - distribution: 'adopt-hotspot' - server-id: github # Value of the distributionManagement/repository/id field of the pom.xml - settings-path: ${{ github.workspace }} # location for the settings.xml file - - name: Build with Maven - run: mvn --file pom.xml -U clean package -Punit-tests - - name: Set up Apache Maven Central (Overwrite settings.xml) - uses: actions/setup-java@v3 - with: # running setup-java again overwrites the settings.xml - java-version: '11' - distribution: 'adopt-hotspot' - cache: 'maven' - server-id: ossrh - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD - gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} - gpg-passphrase: MAVEN_GPG_PASSPHRASE - - name: Set up Maven cache - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - name: Build - run: mvn -B -ntp clean install - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - - name: Publish to GitHub Packages Apache Maven - # if: > - # github.event_name != 'pull_request' && - # github.ref_name == 'main' && - # contains(github.event.head_commit.message, 'release') - run: | - git config --global user.email "koujalgi.amith@gmail.com" - git config --global user.name "amithkoujalgi" - mvn -B -ntp -DskipTests -Pci-cd -Darguments="-DskipTests -Pci-cd" release:clean release:prepare release:perform - env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} \ No newline at end of file +# push: +# branches: [ "main" ] +# workflow_dispatch: +# +#jobs: +# build: +# runs-on: ubuntu-latest +# permissions: +# contents: write +# packages: write +# steps: +# - uses: actions/checkout@v3 +# - name: Set up JDK 11 +# uses: actions/setup-java@v3 +# with: +# java-version: '11' +# distribution: 'adopt-hotspot' +# server-id: github # Value of the distributionManagement/repository/id field of the pom.xml +# settings-path: ${{ github.workspace }} # location for the settings.xml file +# - name: Build with Maven +# run: mvn --file pom.xml -U clean package -Punit-tests +# - name: Set up Apache Maven Central (Overwrite settings.xml) +# uses: actions/setup-java@v3 +# with: # running setup-java again overwrites the settings.xml +# java-version: '11' +# distribution: 'adopt-hotspot' +# cache: 'maven' +# server-id: ossrh +# server-username: MAVEN_USERNAME +# server-password: MAVEN_PASSWORD +# gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} +# gpg-passphrase: MAVEN_GPG_PASSPHRASE +# - name: Set up Maven cache +# uses: actions/cache@v3 +# with: +# path: ~/.m2/repository +# key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} +# restore-keys: | +# ${{ runner.os }}-maven- +# - name: Build +# run: mvn -B -ntp clean install +# - name: Upload coverage reports to Codecov +# uses: codecov/codecov-action@v3 +# env: +# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} +# - name: Publish to GitHub Packages Apache Maven +# # if: > +# # github.event_name != 'pull_request' && +# # github.ref_name == 'main' && +# # contains(github.event.head_commit.message, 'release') +# run: | +# git config --global user.email "koujalgi.amith@gmail.com" +# git config --global user.name "amithkoujalgi" +# mvn -B -ntp -DskipTests -Pci-cd -Darguments="-DskipTests -Pci-cd" release:clean release:prepare release:perform +# env: +# MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} +# MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} +# MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} \ No newline at end of file diff --git a/.github/workflows/publish-javadoc.yml b/.github/workflows/publish-javadoc.yml index a346dbf..2eba051 100644 --- a/.github/workflows/publish-javadoc.yml +++ b/.github/workflows/publish-javadoc.yml @@ -1,52 +1,52 @@ -# Simple workflow for deploying static content to GitHub Pages -name: Deploy Javadoc content to Pages - -on: - # Runs on pushes targeting the default branch - push: - branches: [ "none" ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write - packages: write -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. -concurrency: - group: "pages" - cancel-in-progress: false - -jobs: - # Single deploy job since we're just deploying - deploy: - runs-on: ubuntu-latest - - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: '11' - distribution: 'adopt-hotspot' - server-id: github # Value of the distributionManagement/repository/id field of the pom.xml - settings-path: ${{ github.workspace }} # location for the settings.xml file - - name: Build with Maven - run: mvn --file pom.xml -U clean package - - name: Setup Pages - uses: actions/configure-pages@v3 - - name: Upload artifact - uses: actions/upload-pages-artifact@v2 - with: - # Upload entire repository - path: './target/apidocs/.' - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v2 +## Simple workflow for deploying static content to GitHub Pages +#name: Deploy Javadoc content to Pages +# +#on: +# # Runs on pushes targeting the default branch +# push: +# branches: [ "none" ] +# +# # Allows you to run this workflow manually from the Actions tab +# workflow_dispatch: +# +## Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +#permissions: +# contents: read +# pages: write +# id-token: write +# packages: write +## Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +## However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +#concurrency: +# group: "pages" +# cancel-in-progress: false +# +#jobs: +# # Single deploy job since we're just deploying +# deploy: +# runs-on: ubuntu-latest +# +# environment: +# name: github-pages +# url: ${{ steps.deployment.outputs.page_url }} +# steps: +# - uses: actions/checkout@v3 +# - name: Set up JDK 11 +# uses: actions/setup-java@v3 +# with: +# java-version: '11' +# distribution: 'adopt-hotspot' +# server-id: github # Value of the distributionManagement/repository/id field of the pom.xml +# settings-path: ${{ github.workspace }} # location for the settings.xml file +# - name: Build with Maven +# run: mvn --file pom.xml -U clean package +# - name: Setup Pages +# uses: actions/configure-pages@v3 +# - name: Upload artifact +# uses: actions/upload-pages-artifact@v2 +# with: +# # Upload entire repository +# path: './target/apidocs/.' +# - name: Deploy to GitHub Pages +# id: deployment +# uses: actions/deploy-pages@v2 -- 2.47.2 From c528fef5fcc2d66223bc6e95dfbd4839e5afaaf5 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 13 Jul 2024 17:38:03 +0530 Subject: [PATCH 018/101] Updated GH action to publish maven pkg Signed-off-by: Amith Koujalgi --- .github/workflows/maven-publish.yml | 109 ++++++++++---------------- .github/workflows/publish-javadoc.yml | 52 ------------ maven-publish.yml | 68 ++++++++++++++++ pom.xml | 5 +- 4 files changed, 112 insertions(+), 122 deletions(-) delete mode 100644 .github/workflows/publish-javadoc.yml create mode 100644 maven-publish.yml diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 430c375..9ecfc2d 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -1,68 +1,41 @@ -## This workflow will build a package using Maven and then publish it to GitHub packages when a release is created -## For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path -# -#name: Test and Publish Package -# -##on: -## release: -## types: [ "created" ] -# -#on: -# push: -# branches: [ "main" ] -# workflow_dispatch: -# -#jobs: -# build: -# runs-on: ubuntu-latest -# permissions: -# contents: write -# packages: write -# steps: -# - uses: actions/checkout@v3 -# - name: Set up JDK 11 -# uses: actions/setup-java@v3 -# with: -# java-version: '11' -# distribution: 'adopt-hotspot' -# server-id: github # Value of the distributionManagement/repository/id field of the pom.xml -# settings-path: ${{ github.workspace }} # location for the settings.xml file -# - name: Build with Maven -# run: mvn --file pom.xml -U clean package -Punit-tests -# - name: Set up Apache Maven Central (Overwrite settings.xml) -# uses: actions/setup-java@v3 -# with: # running setup-java again overwrites the settings.xml -# java-version: '11' -# distribution: 'adopt-hotspot' -# cache: 'maven' -# server-id: ossrh -# server-username: MAVEN_USERNAME -# server-password: MAVEN_PASSWORD -# gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} -# gpg-passphrase: MAVEN_GPG_PASSPHRASE -# - name: Set up Maven cache -# uses: actions/cache@v3 -# with: -# path: ~/.m2/repository -# key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} -# restore-keys: | -# ${{ runner.os }}-maven- -# - name: Build -# run: mvn -B -ntp clean install -# - name: Upload coverage reports to Codecov -# uses: codecov/codecov-action@v3 -# env: -# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} -# - name: Publish to GitHub Packages Apache Maven -# # if: > -# # github.event_name != 'pull_request' && -# # github.ref_name == 'main' && -# # contains(github.event.head_commit.message, 'release') -# run: | -# git config --global user.email "koujalgi.amith@gmail.com" -# git config --global user.name "amithkoujalgi" -# mvn -B -ntp -DskipTests -Pci-cd -Darguments="-DskipTests -Pci-cd" release:clean release:prepare release:perform -# env: -# MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} -# MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} -# MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} \ No newline at end of file +# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created +# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path + +name: Release Artifacts + +on: + release: + types: [ created ] + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + settings-path: ${{ github.workspace }} # location for the settings.xml file + + - name: Find and Replace + uses: jacobtomlinson/gha-find-replace@v3 + with: + find: "ollama4j-revision" + replace: ${{ github.ref_name }} + regex: false + + - name: Build with Maven + run: mvn -B package --file pom.xml + + - name: Publish to GitHub Packages Apache Maven + run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml --file pom.xml + env: + GITHUB_TOKEN: ${{ github.token }} \ No newline at end of file diff --git a/.github/workflows/publish-javadoc.yml b/.github/workflows/publish-javadoc.yml deleted file mode 100644 index 2eba051..0000000 --- a/.github/workflows/publish-javadoc.yml +++ /dev/null @@ -1,52 +0,0 @@ -## Simple workflow for deploying static content to GitHub Pages -#name: Deploy Javadoc content to Pages -# -#on: -# # Runs on pushes targeting the default branch -# push: -# branches: [ "none" ] -# -# # Allows you to run this workflow manually from the Actions tab -# workflow_dispatch: -# -## Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -#permissions: -# contents: read -# pages: write -# id-token: write -# packages: write -## Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. -## However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. -#concurrency: -# group: "pages" -# cancel-in-progress: false -# -#jobs: -# # Single deploy job since we're just deploying -# deploy: -# runs-on: ubuntu-latest -# -# environment: -# name: github-pages -# url: ${{ steps.deployment.outputs.page_url }} -# steps: -# - uses: actions/checkout@v3 -# - name: Set up JDK 11 -# uses: actions/setup-java@v3 -# with: -# java-version: '11' -# distribution: 'adopt-hotspot' -# server-id: github # Value of the distributionManagement/repository/id field of the pom.xml -# settings-path: ${{ github.workspace }} # location for the settings.xml file -# - name: Build with Maven -# run: mvn --file pom.xml -U clean package -# - name: Setup Pages -# uses: actions/configure-pages@v3 -# - name: Upload artifact -# uses: actions/upload-pages-artifact@v2 -# with: -# # Upload entire repository -# path: './target/apidocs/.' -# - name: Deploy to GitHub Pages -# id: deployment -# uses: actions/deploy-pages@v2 diff --git a/maven-publish.yml b/maven-publish.yml new file mode 100644 index 0000000..430c375 --- /dev/null +++ b/maven-publish.yml @@ -0,0 +1,68 @@ +## This workflow will build a package using Maven and then publish it to GitHub packages when a release is created +## For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path +# +#name: Test and Publish Package +# +##on: +## release: +## types: [ "created" ] +# +#on: +# push: +# branches: [ "main" ] +# workflow_dispatch: +# +#jobs: +# build: +# runs-on: ubuntu-latest +# permissions: +# contents: write +# packages: write +# steps: +# - uses: actions/checkout@v3 +# - name: Set up JDK 11 +# uses: actions/setup-java@v3 +# with: +# java-version: '11' +# distribution: 'adopt-hotspot' +# server-id: github # Value of the distributionManagement/repository/id field of the pom.xml +# settings-path: ${{ github.workspace }} # location for the settings.xml file +# - name: Build with Maven +# run: mvn --file pom.xml -U clean package -Punit-tests +# - name: Set up Apache Maven Central (Overwrite settings.xml) +# uses: actions/setup-java@v3 +# with: # running setup-java again overwrites the settings.xml +# java-version: '11' +# distribution: 'adopt-hotspot' +# cache: 'maven' +# server-id: ossrh +# server-username: MAVEN_USERNAME +# server-password: MAVEN_PASSWORD +# gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} +# gpg-passphrase: MAVEN_GPG_PASSPHRASE +# - name: Set up Maven cache +# uses: actions/cache@v3 +# with: +# path: ~/.m2/repository +# key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} +# restore-keys: | +# ${{ runner.os }}-maven- +# - name: Build +# run: mvn -B -ntp clean install +# - name: Upload coverage reports to Codecov +# uses: codecov/codecov-action@v3 +# env: +# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} +# - name: Publish to GitHub Packages Apache Maven +# # if: > +# # github.event_name != 'pull_request' && +# # github.ref_name == 'main' && +# # contains(github.event.head_commit.message, 'release') +# run: | +# git config --global user.email "koujalgi.amith@gmail.com" +# git config --global user.name "amithkoujalgi" +# mvn -B -ntp -DskipTests -Pci-cd -Darguments="-DskipTests -Pci-cd" release:clean release:prepare release:perform +# env: +# MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} +# MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} +# MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 2892ed2..fa66d1c 100644 --- a/pom.xml +++ b/pom.xml @@ -1,10 +1,11 @@ - + 4.0.0 io.github.amithkoujalgi ollama4j - 1.0.78-SNAPSHOT + ollama4j-revision Ollama4j Java library for interacting with Ollama API. -- 2.47.2 From ecc295f484be6d3ac691099319d763c095e1905c Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 13 Jul 2024 17:46:09 +0530 Subject: [PATCH 019/101] Updated GH action to publish maven pkg Signed-off-by: Amith Koujalgi --- .github/workflows/maven-publish.yml | 2 +- pom.xml | 105 +++++++++++++++------------- 2 files changed, 58 insertions(+), 49 deletions(-) diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 9ecfc2d..7b2466a 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -33,7 +33,7 @@ jobs: regex: false - name: Build with Maven - run: mvn -B package --file pom.xml + run: mvn --file pom.xml -U clean package -Punit-tests - name: Publish to GitHub Packages Apache Maven run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml --file pom.xml diff --git a/pom.xml b/pom.xml index fa66d1c..6fd4d9e 100644 --- a/pom.xml +++ b/pom.xml @@ -10,6 +10,7 @@ Ollama4j Java library for interacting with Ollama API. https://github.com/amithkoujalgi/ollama4j + jar 11 @@ -128,15 +129,15 @@ - - org.apache.maven.plugins - maven-release-plugin - 3.0.1 - - - v@{project.version} - - + + + + + + + + + @@ -188,14 +189,22 @@ + + + + + + + + + + + - - ossrh - https://s01.oss.sonatype.org/content/repositories/snapshots - - ossrh - https://s01.oss.sonatype.org/service/local/staging/deploy/maven2 + github + GitHub Packages + https://maven.pkg.github.com/amithkoujalgi/NetWatch @@ -251,39 +260,39 @@ - - org.apache.maven.plugins - maven-gpg-plugin - 3.1.0 - - - sign-artifacts - verify - - sign - - - - - --pinentry-mode - loopback - - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.13 - true - - ossrh - https://s01.oss.sonatype.org/ - true - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + org.jacoco -- 2.47.2 From ee21f7fdd8184de9ca3e0e7e69e63fe768746cf4 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 13 Jul 2024 17:55:25 +0530 Subject: [PATCH 020/101] Updated GH action to publish maven pkg Signed-off-by: Amith Koujalgi --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6fd4d9e..e3cda09 100644 --- a/pom.xml +++ b/pom.xml @@ -204,7 +204,7 @@ github GitHub Packages - https://maven.pkg.github.com/amithkoujalgi/NetWatch + https://maven.pkg.github.com/amithkoujalgi/ollama4j -- 2.47.2 From 9e6503d84b5631897f306567de8aecb400281e54 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 13 Jul 2024 18:01:53 +0530 Subject: [PATCH 021/101] clean up Signed-off-by: Amith Koujalgi --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index e3cda09..fdaab96 100644 --- a/pom.xml +++ b/pom.xml @@ -200,6 +200,7 @@ + github -- 2.47.2 From fd3a989a4960bda1b9054ba513bed11110c48c66 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 13 Jul 2024 18:08:38 +0530 Subject: [PATCH 022/101] Updated GH action to publish docs on release creation Signed-off-by: Amith Koujalgi --- .github/workflows/publish-docs.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index b421c1e..7e2d351 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -2,9 +2,8 @@ name: Deploy Docs to GH Pages on: - # Runs on pushes targeting the default branch - push: - branches: [ "main" ] + release: + types: [ created ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: -- 2.47.2 From 88f6d007636450b10b284c30350472d832dfc627 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 13 Jul 2024 18:24:48 +0530 Subject: [PATCH 023/101] Docs fixes Signed-off-by: Amith Koujalgi --- docs/docusaurus.config.js | 2 +- docs/package-lock.json | 1947 ++++++++++++++++++------------------- docs/package.json | 10 +- docs/src/pages/index.js | 2 +- 4 files changed, 941 insertions(+), 1020 deletions(-) diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index cc19285..f675c8a 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -98,7 +98,7 @@ const config = { items: [ { label: 'Tutorial', - to: '/docs/intro', + to: '/intro', }, ], }, diff --git a/docs/package-lock.json b/docs/package-lock.json index 6fa0119..c8d9030 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -8,9 +8,9 @@ "name": "ollama-4-j", "version": "0.0.0", "dependencies": { - "@docusaurus/core": "3.0.1", - "@docusaurus/preset-classic": "3.0.1", - "@docusaurus/theme-mermaid": "^3.0.1", + "@docusaurus/core": "^3.4.0", + "@docusaurus/preset-classic": "^3.4.0", + "@docusaurus/theme-mermaid": "^3.4.0", "@mdx-js/react": "^3.0.0", "clsx": "^2.0.0", "prism-react-renderer": "^2.3.0", @@ -18,8 +18,8 @@ "react-dom": "^18.0.0" }, "devDependencies": { - "@docusaurus/module-type-aliases": "3.0.1", - "@docusaurus/types": "3.0.1" + "@docusaurus/module-type-aliases": "^3.4.0", + "@docusaurus/types": "^3.4.0" }, "engines": { "node": ">=18.0" @@ -67,74 +67,74 @@ } }, "node_modules/@algolia/cache-browser-local-storage": { - "version": "4.22.0", - "resolved": "https://registry.npmjs.org/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.22.0.tgz", - "integrity": "sha512-uZ1uZMLDZb4qODLfTSNHxSi4fH9RdrQf7DXEzW01dS8XK7QFtFh29N5NGKa9S+Yudf1vUMIF+/RiL4i/J0pWlQ==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.24.0.tgz", + "integrity": "sha512-t63W9BnoXVrGy9iYHBgObNXqYXM3tYXCjDSHeNwnsc324r4o5UiVKUiAB4THQ5z9U5hTj6qUvwg/Ez43ZD85ww==", "dependencies": { - "@algolia/cache-common": "4.22.0" + "@algolia/cache-common": "4.24.0" } }, "node_modules/@algolia/cache-common": { - "version": "4.22.0", - "resolved": "https://registry.npmjs.org/@algolia/cache-common/-/cache-common-4.22.0.tgz", - "integrity": "sha512-TPwUMlIGPN16eW67qamNQUmxNiGHg/WBqWcrOoCddhqNTqGDPVqmgfaM85LPbt24t3r1z0zEz/tdsmuq3Q6oaA==" + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@algolia/cache-common/-/cache-common-4.24.0.tgz", + "integrity": "sha512-emi+v+DmVLpMGhp0V9q9h5CdkURsNmFC+cOS6uK9ndeJm9J4TiqSvPYVu+THUP8P/S08rxf5x2P+p3CfID0Y4g==" }, "node_modules/@algolia/cache-in-memory": { - "version": "4.22.0", - "resolved": "https://registry.npmjs.org/@algolia/cache-in-memory/-/cache-in-memory-4.22.0.tgz", - "integrity": "sha512-kf4Cio9NpPjzp1+uXQgL4jsMDeck7MP89BYThSvXSjf2A6qV/0KeqQf90TL2ECS02ovLOBXkk98P7qVarM+zGA==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@algolia/cache-in-memory/-/cache-in-memory-4.24.0.tgz", + "integrity": "sha512-gDrt2so19jW26jY3/MkFg5mEypFIPbPoXsQGQWAi6TrCPsNOSEYepBMPlucqWigsmEy/prp5ug2jy/N3PVG/8w==", "dependencies": { - "@algolia/cache-common": "4.22.0" + "@algolia/cache-common": "4.24.0" } }, "node_modules/@algolia/client-account": { - "version": "4.22.0", - "resolved": "https://registry.npmjs.org/@algolia/client-account/-/client-account-4.22.0.tgz", - "integrity": "sha512-Bjb5UXpWmJT+yGWiqAJL0prkENyEZTBzdC+N1vBuHjwIJcjLMjPB6j1hNBRbT12Lmwi55uzqeMIKS69w+0aPzA==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@algolia/client-account/-/client-account-4.24.0.tgz", + "integrity": "sha512-adcvyJ3KjPZFDybxlqnf+5KgxJtBjwTPTeyG2aOyoJvx0Y8dUQAEOEVOJ/GBxX0WWNbmaSrhDURMhc+QeevDsA==", "dependencies": { - "@algolia/client-common": "4.22.0", - "@algolia/client-search": "4.22.0", - "@algolia/transporter": "4.22.0" + "@algolia/client-common": "4.24.0", + "@algolia/client-search": "4.24.0", + "@algolia/transporter": "4.24.0" } }, "node_modules/@algolia/client-analytics": { - "version": "4.22.0", - "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-4.22.0.tgz", - "integrity": "sha512-os2K+kHUcwwRa4ArFl5p/3YbF9lN3TLOPkbXXXxOvDpqFh62n9IRZuzfxpHxMPKAQS3Et1s0BkKavnNP02E9Hg==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-4.24.0.tgz", + "integrity": "sha512-y8jOZt1OjwWU4N2qr8G4AxXAzaa8DBvyHTWlHzX/7Me1LX8OayfgHexqrsL4vSBcoMmVw2XnVW9MhL+Y2ZDJXg==", "dependencies": { - "@algolia/client-common": "4.22.0", - "@algolia/client-search": "4.22.0", - "@algolia/requester-common": "4.22.0", - "@algolia/transporter": "4.22.0" + "@algolia/client-common": "4.24.0", + "@algolia/client-search": "4.24.0", + "@algolia/requester-common": "4.24.0", + "@algolia/transporter": "4.24.0" } }, "node_modules/@algolia/client-common": { - "version": "4.22.0", - "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-4.22.0.tgz", - "integrity": "sha512-BlbkF4qXVWuwTmYxVWvqtatCR3lzXwxx628p1wj1Q7QP2+LsTmGt1DiUYRuy9jG7iMsnlExby6kRMOOlbhv2Ag==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-4.24.0.tgz", + "integrity": "sha512-bc2ROsNL6w6rqpl5jj/UywlIYC21TwSSoFHKl01lYirGMW+9Eek6r02Tocg4gZ8HAw3iBvu6XQiM3BEbmEMoiA==", "dependencies": { - "@algolia/requester-common": "4.22.0", - "@algolia/transporter": "4.22.0" + "@algolia/requester-common": "4.24.0", + "@algolia/transporter": "4.24.0" } }, "node_modules/@algolia/client-personalization": { - "version": "4.22.0", - "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-4.22.0.tgz", - "integrity": "sha512-pEOftCxeBdG5pL97WngOBi9w5Vxr5KCV2j2D+xMVZH8MuU/JX7CglDSDDb0ffQWYqcUN+40Ry+xtXEYaGXTGow==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-4.24.0.tgz", + "integrity": "sha512-l5FRFm/yngztweU0HdUzz1rC4yoWCFo3IF+dVIVTfEPg906eZg5BOd1k0K6rZx5JzyyoP4LdmOikfkfGsKVE9w==", "dependencies": { - "@algolia/client-common": "4.22.0", - "@algolia/requester-common": "4.22.0", - "@algolia/transporter": "4.22.0" + "@algolia/client-common": "4.24.0", + "@algolia/requester-common": "4.24.0", + "@algolia/transporter": "4.24.0" } }, "node_modules/@algolia/client-search": { - "version": "4.22.0", - "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-4.22.0.tgz", - "integrity": "sha512-bn4qQiIdRPBGCwsNuuqB8rdHhGKKWIij9OqidM1UkQxnSG8yzxHdb7CujM30pvp5EnV7jTqDZRbxacbjYVW20Q==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-4.24.0.tgz", + "integrity": "sha512-uRW6EpNapmLAD0mW47OXqTP8eiIx5F6qN9/x/7HHO6owL3N1IXqydGwW5nhDFBrV+ldouro2W1VX3XlcUXEFCA==", "dependencies": { - "@algolia/client-common": "4.22.0", - "@algolia/requester-common": "4.22.0", - "@algolia/transporter": "4.22.0" + "@algolia/client-common": "4.24.0", + "@algolia/requester-common": "4.24.0", + "@algolia/transporter": "4.24.0" } }, "node_modules/@algolia/events": { @@ -143,47 +143,65 @@ "integrity": "sha512-FQzvOCgoFXAbf5Y6mYozw2aj5KCJoA3m4heImceldzPSMbdyS4atVjJzXKMsfX3wnZTFYwkkt8/z8UesLHlSBQ==" }, "node_modules/@algolia/logger-common": { - "version": "4.22.0", - "resolved": "https://registry.npmjs.org/@algolia/logger-common/-/logger-common-4.22.0.tgz", - "integrity": "sha512-HMUQTID0ucxNCXs5d1eBJ5q/HuKg8rFVE/vOiLaM4Abfeq1YnTtGV3+rFEhOPWhRQxNDd+YHa4q864IMc0zHpQ==" + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@algolia/logger-common/-/logger-common-4.24.0.tgz", + "integrity": "sha512-LLUNjkahj9KtKYrQhFKCzMx0BY3RnNP4FEtO+sBybCjJ73E8jNdaKJ/Dd8A/VA4imVHP5tADZ8pn5B8Ga/wTMA==" }, "node_modules/@algolia/logger-console": { - "version": "4.22.0", - "resolved": "https://registry.npmjs.org/@algolia/logger-console/-/logger-console-4.22.0.tgz", - "integrity": "sha512-7JKb6hgcY64H7CRm3u6DRAiiEVXMvCJV5gRE672QFOUgDxo4aiDpfU61g6Uzy8NKjlEzHMmgG4e2fklELmPXhQ==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@algolia/logger-console/-/logger-console-4.24.0.tgz", + "integrity": "sha512-X4C8IoHgHfiUROfoRCV+lzSy+LHMgkoEEU1BbKcsfnV0i0S20zyy0NLww9dwVHUWNfPPxdMU+/wKmLGYf96yTg==", "dependencies": { - "@algolia/logger-common": "4.22.0" + "@algolia/logger-common": "4.24.0" + } + }, + "node_modules/@algolia/recommend": { + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@algolia/recommend/-/recommend-4.24.0.tgz", + "integrity": "sha512-P9kcgerfVBpfYHDfVZDvvdJv0lEoCvzNlOy2nykyt5bK8TyieYyiD0lguIJdRZZYGre03WIAFf14pgE+V+IBlw==", + "dependencies": { + "@algolia/cache-browser-local-storage": "4.24.0", + "@algolia/cache-common": "4.24.0", + "@algolia/cache-in-memory": "4.24.0", + "@algolia/client-common": "4.24.0", + "@algolia/client-search": "4.24.0", + "@algolia/logger-common": "4.24.0", + "@algolia/logger-console": "4.24.0", + "@algolia/requester-browser-xhr": "4.24.0", + "@algolia/requester-common": "4.24.0", + "@algolia/requester-node-http": "4.24.0", + "@algolia/transporter": "4.24.0" } }, "node_modules/@algolia/requester-browser-xhr": { - "version": "4.22.0", - "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.22.0.tgz", - "integrity": "sha512-BHfv1h7P9/SyvcDJDaRuIwDu2yrDLlXlYmjvaLZTtPw6Ok/ZVhBR55JqW832XN/Fsl6k3LjdkYHHR7xnsa5Wvg==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.24.0.tgz", + "integrity": "sha512-Z2NxZMb6+nVXSjF13YpjYTdvV3032YTBSGm2vnYvYPA6mMxzM3v5rsCiSspndn9rzIW4Qp1lPHBvuoKJV6jnAA==", "dependencies": { - "@algolia/requester-common": "4.22.0" + "@algolia/requester-common": "4.24.0" } }, "node_modules/@algolia/requester-common": { - "version": "4.22.0", - "resolved": "https://registry.npmjs.org/@algolia/requester-common/-/requester-common-4.22.0.tgz", - "integrity": "sha512-Y9cEH/cKjIIZgzvI1aI0ARdtR/xRrOR13g5psCxkdhpgRN0Vcorx+zePhmAa4jdQNqexpxtkUdcKYugBzMZJgQ==" + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@algolia/requester-common/-/requester-common-4.24.0.tgz", + "integrity": "sha512-k3CXJ2OVnvgE3HMwcojpvY6d9kgKMPRxs/kVohrwF5WMr2fnqojnycZkxPoEg+bXm8fi5BBfFmOqgYztRtHsQA==" }, "node_modules/@algolia/requester-node-http": { - "version": "4.22.0", - "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-4.22.0.tgz", - "integrity": "sha512-8xHoGpxVhz3u2MYIieHIB6MsnX+vfd5PS4REgglejJ6lPigftRhTdBCToe6zbwq4p0anZXjjPDvNWMlgK2+xYA==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-4.24.0.tgz", + "integrity": "sha512-JF18yTjNOVYvU/L3UosRcvbPMGT9B+/GQWNWnenIImglzNVGpyzChkXLnrSf6uxwVNO6ESGu6oN8MqcGQcjQJw==", "dependencies": { - "@algolia/requester-common": "4.22.0" + "@algolia/requester-common": "4.24.0" } }, "node_modules/@algolia/transporter": { - "version": "4.22.0", - "resolved": "https://registry.npmjs.org/@algolia/transporter/-/transporter-4.22.0.tgz", - "integrity": "sha512-ieO1k8x2o77GNvOoC+vAkFKppydQSVfbjM3YrSjLmgywiBejPTvU1R1nEvG59JIIUvtSLrZsLGPkd6vL14zopA==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@algolia/transporter/-/transporter-4.24.0.tgz", + "integrity": "sha512-86nI7w6NzWxd1Zp9q3413dRshDqAzSbsQjhcDhPIatEFiZrL1/TjnHL8S7jVKFePlIMzDsZWXAXwXzcok9c5oA==", "dependencies": { - "@algolia/cache-common": "4.22.0", - "@algolia/logger-common": "4.22.0", - "@algolia/requester-common": "4.22.0" + "@algolia/cache-common": "4.24.0", + "@algolia/logger-common": "4.24.0", + "@algolia/requester-common": "4.24.0" } }, "node_modules/@ampproject/remapping": { @@ -530,9 +548,9 @@ } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", - "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.8.tgz", + "integrity": "sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg==", "engines": { "node": ">=6.9.0" } @@ -1608,11 +1626,11 @@ } }, "node_modules/@babel/plugin-transform-react-constant-elements": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-constant-elements/-/plugin-transform-react-constant-elements-7.23.3.tgz", - "integrity": "sha512-zP0QKq/p6O42OL94udMgSfKXyse4RyJ0JqbQ34zDAONWjyrEsghYEyTSK5FIpmXmCpB55SHokL1cRRKHv8L2Qw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-constant-elements/-/plugin-transform-react-constant-elements-7.24.7.tgz", + "integrity": "sha512-7LidzZfUXyfZ8/buRW6qIIHBY8wAZ1OrY9c/wTr8YhZ6vMPo+Uc/CVFLYY1spZrEQlD4w5u8wjqk5NQ3OVqQKA==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -2133,18 +2151,18 @@ } }, "node_modules/@docsearch/css": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/@docsearch/css/-/css-3.5.2.tgz", - "integrity": "sha512-SPiDHaWKQZpwR2siD0KQUwlStvIAnEyK6tAE2h2Wuoq8ue9skzhlyVQ1ddzOxX6khULnAALDiR/isSF3bnuciA==" + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@docsearch/css/-/css-3.6.0.tgz", + "integrity": "sha512-+sbxb71sWre+PwDK7X2T8+bhS6clcVMLwBPznX45Qu6opJcgRjAp7gYSDzVFp187J+feSj5dNBN1mJoi6ckkUQ==" }, "node_modules/@docsearch/react": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/@docsearch/react/-/react-3.5.2.tgz", - "integrity": "sha512-9Ahcrs5z2jq/DcAvYtvlqEBHImbm4YJI8M9y0x6Tqg598P40HTEkX7hsMcIuThI+hTFxRGZ9hll0Wygm2yEjng==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@docsearch/react/-/react-3.6.0.tgz", + "integrity": "sha512-HUFut4ztcVNmqy9gp/wxNbC7pTOHhgVVkHVGCACTuLhUKUhKAF9KYHJtMiLUJxEqiFLQiuri1fWF8zqwM/cu1w==", "dependencies": { "@algolia/autocomplete-core": "1.9.3", "@algolia/autocomplete-preset-algolia": "1.9.3", - "@docsearch/css": "3.5.2", + "@docsearch/css": "3.6.0", "algoliasearch": "^4.19.1" }, "peerDependencies": { @@ -2169,9 +2187,9 @@ } }, "node_modules/@docusaurus/core": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@docusaurus/core/-/core-3.0.1.tgz", - "integrity": "sha512-CXrLpOnW+dJdSv8M5FAJ3JBwXtL6mhUWxFA8aS0ozK6jBG/wgxERk5uvH28fCeFxOGbAT9v1e9dOMo1X2IEVhQ==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/core/-/core-3.4.0.tgz", + "integrity": "sha512-g+0wwmN2UJsBqy2fQRQ6fhXruoEa62JDeEa5d8IdTJlMoaDaEDfHh7WjwGRn4opuTQWpjAwP/fbcgyHKlE+64w==", "dependencies": { "@babel/core": "^7.23.3", "@babel/generator": "^7.23.3", @@ -2183,15 +2201,12 @@ "@babel/runtime": "^7.22.6", "@babel/runtime-corejs3": "^7.22.6", "@babel/traverse": "^7.22.8", - "@docusaurus/cssnano-preset": "3.0.1", - "@docusaurus/logger": "3.0.1", - "@docusaurus/mdx-loader": "3.0.1", - "@docusaurus/react-loadable": "5.5.2", - "@docusaurus/utils": "3.0.1", - "@docusaurus/utils-common": "3.0.1", - "@docusaurus/utils-validation": "3.0.1", - "@slorber/static-site-generator-webpack-plugin": "^4.0.7", - "@svgr/webpack": "^6.5.1", + "@docusaurus/cssnano-preset": "3.4.0", + "@docusaurus/logger": "3.4.0", + "@docusaurus/mdx-loader": "3.4.0", + "@docusaurus/utils": "3.4.0", + "@docusaurus/utils-common": "3.4.0", + "@docusaurus/utils-validation": "3.4.0", "autoprefixer": "^10.4.14", "babel-loader": "^9.1.3", "babel-plugin-dynamic-import-node": "^2.3.3", @@ -2205,12 +2220,13 @@ "copy-webpack-plugin": "^11.0.0", "core-js": "^3.31.1", "css-loader": "^6.8.1", - "css-minimizer-webpack-plugin": "^4.2.2", - "cssnano": "^5.1.15", + "css-minimizer-webpack-plugin": "^5.0.1", + "cssnano": "^6.1.2", "del": "^6.1.1", "detect-port": "^1.5.1", "escape-html": "^1.0.3", "eta": "^2.2.0", + "eval": "^0.1.8", "file-loader": "^6.2.0", "fs-extra": "^11.1.1", "html-minifier-terser": "^7.2.0", @@ -2219,12 +2235,13 @@ "leven": "^3.1.0", "lodash": "^4.17.21", "mini-css-extract-plugin": "^2.7.6", + "p-map": "^4.0.0", "postcss": "^8.4.26", "postcss-loader": "^7.3.3", "prompts": "^2.4.2", "react-dev-utils": "^12.0.1", "react-helmet-async": "^1.3.0", - "react-loadable": "npm:@docusaurus/react-loadable@5.5.2", + "react-loadable": "npm:@docusaurus/react-loadable@6.0.0", "react-loadable-ssr-addon-v5-slorber": "^1.0.1", "react-router": "^5.3.4", "react-router-config": "^5.1.1", @@ -2255,13 +2272,13 @@ } }, "node_modules/@docusaurus/cssnano-preset": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@docusaurus/cssnano-preset/-/cssnano-preset-3.0.1.tgz", - "integrity": "sha512-wjuXzkHMW+ig4BD6Ya1Yevx9UJadO4smNZCEljqBoQfIQrQskTswBs7lZ8InHP7mCt273a/y/rm36EZhqJhknQ==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/cssnano-preset/-/cssnano-preset-3.4.0.tgz", + "integrity": "sha512-qwLFSz6v/pZHy/UP32IrprmH5ORce86BGtN0eBtG75PpzQJAzp9gefspox+s8IEOr0oZKuQ/nhzZ3xwyc3jYJQ==", "dependencies": { - "cssnano-preset-advanced": "^5.3.10", - "postcss": "^8.4.26", - "postcss-sort-media-queries": "^4.4.1", + "cssnano-preset-advanced": "^6.1.2", + "postcss": "^8.4.38", + "postcss-sort-media-queries": "^5.2.0", "tslib": "^2.6.0" }, "engines": { @@ -2269,9 +2286,9 @@ } }, "node_modules/@docusaurus/logger": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@docusaurus/logger/-/logger-3.0.1.tgz", - "integrity": "sha512-I5L6Nk8OJzkVA91O2uftmo71LBSxe1vmOn9AMR6JRCzYeEBrqneWMH02AqMvjJ2NpMiviO+t0CyPjyYV7nxCWQ==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/logger/-/logger-3.4.0.tgz", + "integrity": "sha512-bZwkX+9SJ8lB9kVRkXw+xvHYSMGG4bpYHKGXeXFvyVc79NMeeBSGgzd4TQLHH+DYeOJoCdl8flrFJVxlZ0wo/Q==", "dependencies": { "chalk": "^4.1.2", "tslib": "^2.6.0" @@ -2281,15 +2298,13 @@ } }, "node_modules/@docusaurus/mdx-loader": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@docusaurus/mdx-loader/-/mdx-loader-3.0.1.tgz", - "integrity": "sha512-ldnTmvnvlrONUq45oKESrpy+lXtbnTcTsFkOTIDswe5xx5iWJjt6eSa0f99ZaWlnm24mlojcIGoUWNCS53qVlQ==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/mdx-loader/-/mdx-loader-3.4.0.tgz", + "integrity": "sha512-kSSbrrk4nTjf4d+wtBA9H+FGauf2gCax89kV8SUSJu3qaTdSIKdWERlngsiHaCFgZ7laTJ8a67UFf+xlFPtuTw==", "dependencies": { - "@babel/parser": "^7.22.7", - "@babel/traverse": "^7.22.8", - "@docusaurus/logger": "3.0.1", - "@docusaurus/utils": "3.0.1", - "@docusaurus/utils-validation": "3.0.1", + "@docusaurus/logger": "3.4.0", + "@docusaurus/utils": "3.4.0", + "@docusaurus/utils-validation": "3.4.0", "@mdx-js/mdx": "^3.0.0", "@slorber/remark-comment": "^1.0.0", "escape-html": "^1.0.3", @@ -2321,18 +2336,17 @@ } }, "node_modules/@docusaurus/module-type-aliases": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@docusaurus/module-type-aliases/-/module-type-aliases-3.0.1.tgz", - "integrity": "sha512-DEHpeqUDsLynl3AhQQiO7AbC7/z/lBra34jTcdYuvp9eGm01pfH1wTVq8YqWZq6Jyx0BgcVl/VJqtE9StRd9Ag==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/module-type-aliases/-/module-type-aliases-3.4.0.tgz", + "integrity": "sha512-A1AyS8WF5Bkjnb8s+guTDuYmUiwJzNrtchebBHpc0gz0PyHJNMaybUlSrmJjHVcGrya0LKI4YcR3lBDQfXRYLw==", "dependencies": { - "@docusaurus/react-loadable": "5.5.2", - "@docusaurus/types": "3.0.1", + "@docusaurus/types": "3.4.0", "@types/history": "^4.7.11", "@types/react": "*", "@types/react-router-config": "*", "@types/react-router-dom": "*", "react-helmet-async": "*", - "react-loadable": "npm:@docusaurus/react-loadable@5.5.2" + "react-loadable": "npm:@docusaurus/react-loadable@6.0.0" }, "peerDependencies": { "react": "*", @@ -2340,17 +2354,17 @@ } }, "node_modules/@docusaurus/plugin-content-blog": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-blog/-/plugin-content-blog-3.0.1.tgz", - "integrity": "sha512-cLOvtvAyaMQFLI8vm4j26svg3ktxMPSXpuUJ7EERKoGbfpJSsgtowNHcRsaBVmfuCsRSk1HZ/yHBsUkTmHFEsg==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-blog/-/plugin-content-blog-3.4.0.tgz", + "integrity": "sha512-vv6ZAj78ibR5Jh7XBUT4ndIjmlAxkijM3Sx5MAAzC1gyv0vupDQNhzuFg1USQmQVj3P5I6bquk12etPV3LJ+Xw==", "dependencies": { - "@docusaurus/core": "3.0.1", - "@docusaurus/logger": "3.0.1", - "@docusaurus/mdx-loader": "3.0.1", - "@docusaurus/types": "3.0.1", - "@docusaurus/utils": "3.0.1", - "@docusaurus/utils-common": "3.0.1", - "@docusaurus/utils-validation": "3.0.1", + "@docusaurus/core": "3.4.0", + "@docusaurus/logger": "3.4.0", + "@docusaurus/mdx-loader": "3.4.0", + "@docusaurus/types": "3.4.0", + "@docusaurus/utils": "3.4.0", + "@docusaurus/utils-common": "3.4.0", + "@docusaurus/utils-validation": "3.4.0", "cheerio": "^1.0.0-rc.12", "feed": "^4.2.2", "fs-extra": "^11.1.1", @@ -2371,17 +2385,18 @@ } }, "node_modules/@docusaurus/plugin-content-docs": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-docs/-/plugin-content-docs-3.0.1.tgz", - "integrity": "sha512-dRfAOA5Ivo+sdzzJGXEu33yAtvGg8dlZkvt/NEJ7nwi1F2j4LEdsxtfX2GKeETB2fP6XoGNSQnFXqa2NYGrHFg==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-docs/-/plugin-content-docs-3.4.0.tgz", + "integrity": "sha512-HkUCZffhBo7ocYheD9oZvMcDloRnGhBMOZRyVcAQRFmZPmNqSyISlXA1tQCIxW+r478fty97XXAGjNYzBjpCsg==", "dependencies": { - "@docusaurus/core": "3.0.1", - "@docusaurus/logger": "3.0.1", - "@docusaurus/mdx-loader": "3.0.1", - "@docusaurus/module-type-aliases": "3.0.1", - "@docusaurus/types": "3.0.1", - "@docusaurus/utils": "3.0.1", - "@docusaurus/utils-validation": "3.0.1", + "@docusaurus/core": "3.4.0", + "@docusaurus/logger": "3.4.0", + "@docusaurus/mdx-loader": "3.4.0", + "@docusaurus/module-type-aliases": "3.4.0", + "@docusaurus/types": "3.4.0", + "@docusaurus/utils": "3.4.0", + "@docusaurus/utils-common": "3.4.0", + "@docusaurus/utils-validation": "3.4.0", "@types/react-router-config": "^5.0.7", "combine-promises": "^1.1.0", "fs-extra": "^11.1.1", @@ -2400,15 +2415,15 @@ } }, "node_modules/@docusaurus/plugin-content-pages": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-pages/-/plugin-content-pages-3.0.1.tgz", - "integrity": "sha512-oP7PoYizKAXyEttcvVzfX3OoBIXEmXTMzCdfmC4oSwjG4SPcJsRge3mmI6O8jcZBgUPjIzXD21bVGWEE1iu8gg==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-pages/-/plugin-content-pages-3.4.0.tgz", + "integrity": "sha512-h2+VN/0JjpR8fIkDEAoadNjfR3oLzB+v1qSXbIAKjQ46JAHx3X22n9nqS+BWSQnTnp1AjkjSvZyJMekmcwxzxg==", "dependencies": { - "@docusaurus/core": "3.0.1", - "@docusaurus/mdx-loader": "3.0.1", - "@docusaurus/types": "3.0.1", - "@docusaurus/utils": "3.0.1", - "@docusaurus/utils-validation": "3.0.1", + "@docusaurus/core": "3.4.0", + "@docusaurus/mdx-loader": "3.4.0", + "@docusaurus/types": "3.4.0", + "@docusaurus/utils": "3.4.0", + "@docusaurus/utils-validation": "3.4.0", "fs-extra": "^11.1.1", "tslib": "^2.6.0", "webpack": "^5.88.1" @@ -2422,13 +2437,13 @@ } }, "node_modules/@docusaurus/plugin-debug": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-debug/-/plugin-debug-3.0.1.tgz", - "integrity": "sha512-09dxZMdATky4qdsZGzhzlUvvC+ilQ2hKbYF+wez+cM2mGo4qHbv8+qKXqxq0CQZyimwlAOWQLoSozIXU0g0i7g==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-debug/-/plugin-debug-3.4.0.tgz", + "integrity": "sha512-uV7FDUNXGyDSD3PwUaf5YijX91T5/H9SX4ErEcshzwgzWwBtK37nUWPU3ZLJfeTavX3fycTOqk9TglpOLaWkCg==", "dependencies": { - "@docusaurus/core": "3.0.1", - "@docusaurus/types": "3.0.1", - "@docusaurus/utils": "3.0.1", + "@docusaurus/core": "3.4.0", + "@docusaurus/types": "3.4.0", + "@docusaurus/utils": "3.4.0", "fs-extra": "^11.1.1", "react-json-view-lite": "^1.2.0", "tslib": "^2.6.0" @@ -2442,13 +2457,13 @@ } }, "node_modules/@docusaurus/plugin-google-analytics": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-analytics/-/plugin-google-analytics-3.0.1.tgz", - "integrity": "sha512-jwseSz1E+g9rXQwDdr0ZdYNjn8leZBnKPjjQhMBEiwDoenL3JYFcNW0+p0sWoVF/f2z5t7HkKA+cYObrUh18gg==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-analytics/-/plugin-google-analytics-3.4.0.tgz", + "integrity": "sha512-mCArluxEGi3cmYHqsgpGGt3IyLCrFBxPsxNZ56Mpur0xSlInnIHoeLDH7FvVVcPJRPSQ9/MfRqLsainRw+BojA==", "dependencies": { - "@docusaurus/core": "3.0.1", - "@docusaurus/types": "3.0.1", - "@docusaurus/utils-validation": "3.0.1", + "@docusaurus/core": "3.4.0", + "@docusaurus/types": "3.4.0", + "@docusaurus/utils-validation": "3.4.0", "tslib": "^2.6.0" }, "engines": { @@ -2460,13 +2475,13 @@ } }, "node_modules/@docusaurus/plugin-google-gtag": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-gtag/-/plugin-google-gtag-3.0.1.tgz", - "integrity": "sha512-UFTDvXniAWrajsulKUJ1DB6qplui1BlKLQZjX4F7qS/qfJ+qkKqSkhJ/F4VuGQ2JYeZstYb+KaUzUzvaPK1aRQ==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-gtag/-/plugin-google-gtag-3.4.0.tgz", + "integrity": "sha512-Dsgg6PLAqzZw5wZ4QjUYc8Z2KqJqXxHxq3vIoyoBWiLEEfigIs7wHR+oiWUQy3Zk9MIk6JTYj7tMoQU0Jm3nqA==", "dependencies": { - "@docusaurus/core": "3.0.1", - "@docusaurus/types": "3.0.1", - "@docusaurus/utils-validation": "3.0.1", + "@docusaurus/core": "3.4.0", + "@docusaurus/types": "3.4.0", + "@docusaurus/utils-validation": "3.4.0", "@types/gtag.js": "^0.0.12", "tslib": "^2.6.0" }, @@ -2479,13 +2494,13 @@ } }, "node_modules/@docusaurus/plugin-google-tag-manager": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-tag-manager/-/plugin-google-tag-manager-3.0.1.tgz", - "integrity": "sha512-IPFvuz83aFuheZcWpTlAdiiX1RqWIHM+OH8wS66JgwAKOiQMR3+nLywGjkLV4bp52x7nCnwhNk1rE85Cpy/CIw==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-tag-manager/-/plugin-google-tag-manager-3.4.0.tgz", + "integrity": "sha512-O9tX1BTwxIhgXpOLpFDueYA9DWk69WCbDRrjYoMQtFHSkTyE7RhNgyjSPREUWJb9i+YUg3OrsvrBYRl64FCPCQ==", "dependencies": { - "@docusaurus/core": "3.0.1", - "@docusaurus/types": "3.0.1", - "@docusaurus/utils-validation": "3.0.1", + "@docusaurus/core": "3.4.0", + "@docusaurus/types": "3.4.0", + "@docusaurus/utils-validation": "3.4.0", "tslib": "^2.6.0" }, "engines": { @@ -2497,16 +2512,16 @@ } }, "node_modules/@docusaurus/plugin-sitemap": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-sitemap/-/plugin-sitemap-3.0.1.tgz", - "integrity": "sha512-xARiWnjtVvoEniZudlCq5T9ifnhCu/GAZ5nA7XgyLfPcNpHQa241HZdsTlLtVcecEVVdllevBKOp7qknBBaMGw==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-sitemap/-/plugin-sitemap-3.4.0.tgz", + "integrity": "sha512-+0VDvx9SmNrFNgwPoeoCha+tRoAjopwT0+pYO1xAbyLcewXSemq+eLxEa46Q1/aoOaJQ0qqHELuQM7iS2gp33Q==", "dependencies": { - "@docusaurus/core": "3.0.1", - "@docusaurus/logger": "3.0.1", - "@docusaurus/types": "3.0.1", - "@docusaurus/utils": "3.0.1", - "@docusaurus/utils-common": "3.0.1", - "@docusaurus/utils-validation": "3.0.1", + "@docusaurus/core": "3.4.0", + "@docusaurus/logger": "3.4.0", + "@docusaurus/types": "3.4.0", + "@docusaurus/utils": "3.4.0", + "@docusaurus/utils-common": "3.4.0", + "@docusaurus/utils-validation": "3.4.0", "fs-extra": "^11.1.1", "sitemap": "^7.1.1", "tslib": "^2.6.0" @@ -2520,23 +2535,23 @@ } }, "node_modules/@docusaurus/preset-classic": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@docusaurus/preset-classic/-/preset-classic-3.0.1.tgz", - "integrity": "sha512-il9m9xZKKjoXn6h0cRcdnt6wce0Pv1y5t4xk2Wx7zBGhKG1idu4IFHtikHlD0QPuZ9fizpXspXcTzjL5FXc1Gw==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/preset-classic/-/preset-classic-3.4.0.tgz", + "integrity": "sha512-Ohj6KB7siKqZaQhNJVMBBUzT3Nnp6eTKqO+FXO3qu/n1hJl3YLwVKTWBg28LF7MWrKu46UuYavwMRxud0VyqHg==", "dependencies": { - "@docusaurus/core": "3.0.1", - "@docusaurus/plugin-content-blog": "3.0.1", - "@docusaurus/plugin-content-docs": "3.0.1", - "@docusaurus/plugin-content-pages": "3.0.1", - "@docusaurus/plugin-debug": "3.0.1", - "@docusaurus/plugin-google-analytics": "3.0.1", - "@docusaurus/plugin-google-gtag": "3.0.1", - "@docusaurus/plugin-google-tag-manager": "3.0.1", - "@docusaurus/plugin-sitemap": "3.0.1", - "@docusaurus/theme-classic": "3.0.1", - "@docusaurus/theme-common": "3.0.1", - "@docusaurus/theme-search-algolia": "3.0.1", - "@docusaurus/types": "3.0.1" + "@docusaurus/core": "3.4.0", + "@docusaurus/plugin-content-blog": "3.4.0", + "@docusaurus/plugin-content-docs": "3.4.0", + "@docusaurus/plugin-content-pages": "3.4.0", + "@docusaurus/plugin-debug": "3.4.0", + "@docusaurus/plugin-google-analytics": "3.4.0", + "@docusaurus/plugin-google-gtag": "3.4.0", + "@docusaurus/plugin-google-tag-manager": "3.4.0", + "@docusaurus/plugin-sitemap": "3.4.0", + "@docusaurus/theme-classic": "3.4.0", + "@docusaurus/theme-common": "3.4.0", + "@docusaurus/theme-search-algolia": "3.4.0", + "@docusaurus/types": "3.4.0" }, "engines": { "node": ">=18.0" @@ -2546,35 +2561,23 @@ "react-dom": "^18.0.0" } }, - "node_modules/@docusaurus/react-loadable": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/@docusaurus/react-loadable/-/react-loadable-5.5.2.tgz", - "integrity": "sha512-A3dYjdBGuy0IGT+wyLIGIKLRE+sAk1iNk0f1HjNDysO7u8lhL4N3VEm+FAubmJbAztn94F7MxBTPmnixbiyFdQ==", - "dependencies": { - "@types/react": "*", - "prop-types": "^15.6.2" - }, - "peerDependencies": { - "react": "*" - } - }, "node_modules/@docusaurus/theme-classic": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-classic/-/theme-classic-3.0.1.tgz", - "integrity": "sha512-XD1FRXaJiDlmYaiHHdm27PNhhPboUah9rqIH0lMpBt5kYtsGjJzhqa27KuZvHLzOP2OEpqd2+GZ5b6YPq7Q05Q==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/theme-classic/-/theme-classic-3.4.0.tgz", + "integrity": "sha512-0IPtmxsBYv2adr1GnZRdMkEQt1YW6tpzrUPj02YxNpvJ5+ju4E13J5tB4nfdaen/tfR1hmpSPlTFPvTf4kwy8Q==", "dependencies": { - "@docusaurus/core": "3.0.1", - "@docusaurus/mdx-loader": "3.0.1", - "@docusaurus/module-type-aliases": "3.0.1", - "@docusaurus/plugin-content-blog": "3.0.1", - "@docusaurus/plugin-content-docs": "3.0.1", - "@docusaurus/plugin-content-pages": "3.0.1", - "@docusaurus/theme-common": "3.0.1", - "@docusaurus/theme-translations": "3.0.1", - "@docusaurus/types": "3.0.1", - "@docusaurus/utils": "3.0.1", - "@docusaurus/utils-common": "3.0.1", - "@docusaurus/utils-validation": "3.0.1", + "@docusaurus/core": "3.4.0", + "@docusaurus/mdx-loader": "3.4.0", + "@docusaurus/module-type-aliases": "3.4.0", + "@docusaurus/plugin-content-blog": "3.4.0", + "@docusaurus/plugin-content-docs": "3.4.0", + "@docusaurus/plugin-content-pages": "3.4.0", + "@docusaurus/theme-common": "3.4.0", + "@docusaurus/theme-translations": "3.4.0", + "@docusaurus/types": "3.4.0", + "@docusaurus/utils": "3.4.0", + "@docusaurus/utils-common": "3.4.0", + "@docusaurus/utils-validation": "3.4.0", "@mdx-js/react": "^3.0.0", "clsx": "^2.0.0", "copy-text-to-clipboard": "^3.2.0", @@ -2598,17 +2601,17 @@ } }, "node_modules/@docusaurus/theme-common": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-common/-/theme-common-3.0.1.tgz", - "integrity": "sha512-cr9TOWXuIOL0PUfuXv6L5lPlTgaphKP+22NdVBOYah5jSq5XAAulJTjfe+IfLsEG4L7lJttLbhW7LXDFSAI7Ag==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/theme-common/-/theme-common-3.4.0.tgz", + "integrity": "sha512-0A27alXuv7ZdCg28oPE8nH/Iz73/IUejVaCazqu9elS4ypjiLhK3KfzdSQBnL/g7YfHSlymZKdiOHEo8fJ0qMA==", "dependencies": { - "@docusaurus/mdx-loader": "3.0.1", - "@docusaurus/module-type-aliases": "3.0.1", - "@docusaurus/plugin-content-blog": "3.0.1", - "@docusaurus/plugin-content-docs": "3.0.1", - "@docusaurus/plugin-content-pages": "3.0.1", - "@docusaurus/utils": "3.0.1", - "@docusaurus/utils-common": "3.0.1", + "@docusaurus/mdx-loader": "3.4.0", + "@docusaurus/module-type-aliases": "3.4.0", + "@docusaurus/plugin-content-blog": "3.4.0", + "@docusaurus/plugin-content-docs": "3.4.0", + "@docusaurus/plugin-content-pages": "3.4.0", + "@docusaurus/utils": "3.4.0", + "@docusaurus/utils-common": "3.4.0", "@types/history": "^4.7.11", "@types/react": "*", "@types/react-router-config": "*", @@ -2627,15 +2630,15 @@ } }, "node_modules/@docusaurus/theme-mermaid": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-mermaid/-/theme-mermaid-3.0.1.tgz", - "integrity": "sha512-jquSDnZfazABnC5i+02GzRIvufXKruKgvbYkQjKbI7/LWo0XvBs0uKAcCDGgHhth0t/ON5+Sn27joRfpeSk3Lw==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/theme-mermaid/-/theme-mermaid-3.4.0.tgz", + "integrity": "sha512-3w5QW0HEZ2O6x2w6lU3ZvOe1gNXP2HIoKDMJBil1VmLBc9PmpAG17VmfhI/p3L2etNmOiVs5GgniUqvn8AFEGQ==", "dependencies": { - "@docusaurus/core": "3.0.1", - "@docusaurus/module-type-aliases": "3.0.1", - "@docusaurus/theme-common": "3.0.1", - "@docusaurus/types": "3.0.1", - "@docusaurus/utils-validation": "3.0.1", + "@docusaurus/core": "3.4.0", + "@docusaurus/module-type-aliases": "3.4.0", + "@docusaurus/theme-common": "3.4.0", + "@docusaurus/types": "3.4.0", + "@docusaurus/utils-validation": "3.4.0", "mermaid": "^10.4.0", "tslib": "^2.6.0" }, @@ -2648,18 +2651,18 @@ } }, "node_modules/@docusaurus/theme-search-algolia": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-search-algolia/-/theme-search-algolia-3.0.1.tgz", - "integrity": "sha512-DDiPc0/xmKSEdwFkXNf1/vH1SzJPzuJBar8kMcBbDAZk/SAmo/4lf6GU2drou4Ae60lN2waix+jYWTWcJRahSA==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/theme-search-algolia/-/theme-search-algolia-3.4.0.tgz", + "integrity": "sha512-aiHFx7OCw4Wck1z6IoShVdUWIjntC8FHCw9c5dR8r3q4Ynh+zkS8y2eFFunN/DL6RXPzpnvKCg3vhLQYJDmT9Q==", "dependencies": { "@docsearch/react": "^3.5.2", - "@docusaurus/core": "3.0.1", - "@docusaurus/logger": "3.0.1", - "@docusaurus/plugin-content-docs": "3.0.1", - "@docusaurus/theme-common": "3.0.1", - "@docusaurus/theme-translations": "3.0.1", - "@docusaurus/utils": "3.0.1", - "@docusaurus/utils-validation": "3.0.1", + "@docusaurus/core": "3.4.0", + "@docusaurus/logger": "3.4.0", + "@docusaurus/plugin-content-docs": "3.4.0", + "@docusaurus/theme-common": "3.4.0", + "@docusaurus/theme-translations": "3.4.0", + "@docusaurus/utils": "3.4.0", + "@docusaurus/utils-validation": "3.4.0", "algoliasearch": "^4.18.0", "algoliasearch-helper": "^3.13.3", "clsx": "^2.0.0", @@ -2678,9 +2681,9 @@ } }, "node_modules/@docusaurus/theme-translations": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-translations/-/theme-translations-3.0.1.tgz", - "integrity": "sha512-6UrbpzCTN6NIJnAtZ6Ne9492vmPVX+7Fsz4kmp+yor3KQwA1+MCzQP7ItDNkP38UmVLnvB/cYk/IvehCUqS3dg==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/theme-translations/-/theme-translations-3.4.0.tgz", + "integrity": "sha512-zSxCSpmQCCdQU5Q4CnX/ID8CSUUI3fvmq4hU/GNP/XoAWtXo9SAVnM3TzpU8Gb//H3WCsT8mJcTfyOk3d9ftNg==", "dependencies": { "fs-extra": "^11.1.1", "tslib": "^2.6.0" @@ -2690,10 +2693,11 @@ } }, "node_modules/@docusaurus/types": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@docusaurus/types/-/types-3.0.1.tgz", - "integrity": "sha512-plyX2iU1tcUsF46uQ01pAd4JhexR7n0iiQ5MSnBFX6M6NSJgDYdru/i1/YNPKOnQHBoXGLHv0dNT6OAlDWNjrg==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/types/-/types-3.4.0.tgz", + "integrity": "sha512-4jcDO8kXi5Cf9TcyikB/yKmz14f2RZ2qTRerbHAsS+5InE9ZgSLBNLsewtFTcTOXSVcbU3FoGOzcNWAmU1TR0A==", "dependencies": { + "@mdx-js/mdx": "^3.0.0", "@types/history": "^4.7.11", "@types/react": "*", "commander": "^5.1.0", @@ -2709,12 +2713,13 @@ } }, "node_modules/@docusaurus/utils": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@docusaurus/utils/-/utils-3.0.1.tgz", - "integrity": "sha512-TwZ33Am0q4IIbvjhUOs+zpjtD/mXNmLmEgeTGuRq01QzulLHuPhaBTTAC/DHu6kFx3wDgmgpAlaRuCHfTcXv8g==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/utils/-/utils-3.4.0.tgz", + "integrity": "sha512-fRwnu3L3nnWaXOgs88BVBmG1yGjcQqZNHG+vInhEa2Sz2oQB+ZjbEMO5Rh9ePFpZ0YDiDUhpaVjwmS+AU2F14g==", "dependencies": { - "@docusaurus/logger": "3.0.1", - "@svgr/webpack": "^6.5.1", + "@docusaurus/logger": "3.4.0", + "@docusaurus/utils-common": "3.4.0", + "@svgr/webpack": "^8.1.0", "escape-string-regexp": "^4.0.0", "file-loader": "^6.2.0", "fs-extra": "^11.1.1", @@ -2725,10 +2730,12 @@ "js-yaml": "^4.1.0", "lodash": "^4.17.21", "micromatch": "^4.0.5", + "prompts": "^2.4.2", "resolve-pathname": "^3.0.0", "shelljs": "^0.8.5", "tslib": "^2.6.0", "url-loader": "^4.1.1", + "utility-types": "^3.10.0", "webpack": "^5.88.1" }, "engines": { @@ -2744,9 +2751,9 @@ } }, "node_modules/@docusaurus/utils-common": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@docusaurus/utils-common/-/utils-common-3.0.1.tgz", - "integrity": "sha512-W0AxD6w6T8g6bNro8nBRWf7PeZ/nn7geEWM335qHU2DDDjHuV4UZjgUGP1AQsdcSikPrlIqTJJbKzer1lRSlIg==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/utils-common/-/utils-common-3.4.0.tgz", + "integrity": "sha512-NVx54Wr4rCEKsjOH5QEVvxIqVvm+9kh7q8aYTU5WzUU9/Hctd6aTrcZ3G0Id4zYJ+AeaG5K5qHA4CY5Kcm2iyQ==", "dependencies": { "tslib": "^2.6.0" }, @@ -2763,14 +2770,17 @@ } }, "node_modules/@docusaurus/utils-validation": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@docusaurus/utils-validation/-/utils-validation-3.0.1.tgz", - "integrity": "sha512-ujTnqSfyGQ7/4iZdB4RRuHKY/Nwm58IIb+41s5tCXOv/MBU2wGAjOHq3U+AEyJ8aKQcHbxvTKJaRchNHYUVUQg==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/utils-validation/-/utils-validation-3.4.0.tgz", + "integrity": "sha512-hYQ9fM+AXYVTWxJOT1EuNaRnrR2WGpRdLDQG07O8UOpsvCPWUVOeo26Rbm0JWY2sGLfzAb+tvJ62yF+8F+TV0g==", "dependencies": { - "@docusaurus/logger": "3.0.1", - "@docusaurus/utils": "3.0.1", + "@docusaurus/logger": "3.4.0", + "@docusaurus/utils": "3.4.0", + "@docusaurus/utils-common": "3.4.0", + "fs-extra": "^11.2.0", "joi": "^17.9.2", "js-yaml": "^4.1.0", + "lodash": "^4.17.21", "tslib": "^2.6.0" }, "engines": { @@ -2875,9 +2885,9 @@ "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==" }, "node_modules/@mdx-js/mdx": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-3.0.0.tgz", - "integrity": "sha512-Icm0TBKBLYqroYbNW3BPnzMGn+7mwpQOK310aZ7+fkCtiU3aqv2cdcX+nd0Ydo3wI5Rx8bX2Z2QmGb/XcAClCw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-3.0.1.tgz", + "integrity": "sha512-eIQ4QTrOWyL3LWEe/bu6Taqzq2HQvHcyTMaOrI95P2/LmJE7AsfPfgJGuFLPVqBUE1BC1rik3VIhU+s9u72arA==", "dependencies": { "@types/estree": "^1.0.0", "@types/estree-jsx": "^1.0.0", @@ -2999,9 +3009,9 @@ "integrity": "sha512-2LuNTFBIO0m7kKIQvvPHN6UE63VjpmL9rnEEaOOaiSPbZK+zUOYIzBAWcED+3XYzhYsd/0mD57VdxAEqqV52CQ==" }, "node_modules/@sideway/address": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.4.tgz", - "integrity": "sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.5.tgz", + "integrity": "sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q==", "dependencies": { "@hapi/hoek": "^9.0.0" } @@ -3042,25 +3052,12 @@ "micromark-util-symbol": "^1.0.1" } }, - "node_modules/@slorber/static-site-generator-webpack-plugin": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/@slorber/static-site-generator-webpack-plugin/-/static-site-generator-webpack-plugin-4.0.7.tgz", - "integrity": "sha512-Ug7x6z5lwrz0WqdnNFOMYrDQNTPAprvHLSh6+/fmml3qUiz6l5eq+2MzLKWtn/q5K5NpSiFsZTP/fck/3vjSxA==", - "dependencies": { - "eval": "^0.1.8", - "p-map": "^4.0.0", - "webpack-sources": "^3.2.2" - }, + "node_modules/@svgr/babel-plugin-add-jsx-attribute": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-8.0.0.tgz", + "integrity": "sha512-b9MIk7yhdS1pMCZM8VeNfUlSKVRhsHZNMl5O9SfaX0l0t5wjdgu4IDzGB8bpnGBBOjGST3rRFVsaaEtI4W6f7g==", "engines": { "node": ">=14" - } - }, - "node_modules/@svgr/babel-plugin-add-jsx-attribute": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-6.5.1.tgz", - "integrity": "sha512-9PYGcXrAxitycIjRmZB+Q0JaN07GZIWaTBIGQzfaZv+qr1n8X1XUEJ5rZ/vx6OVD9RRYlrNnXWExQXcmZeD/BQ==", - "engines": { - "node": ">=10" }, "funding": { "type": "github", @@ -3101,11 +3098,11 @@ } }, "node_modules/@svgr/babel-plugin-replace-jsx-attribute-value": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-replace-jsx-attribute-value/-/babel-plugin-replace-jsx-attribute-value-6.5.1.tgz", - "integrity": "sha512-8DPaVVE3fd5JKuIC29dqyMB54sA6mfgki2H2+swh+zNJoynC8pMPzOkidqHOSc6Wj032fhl8Z0TVn1GiPpAiJg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-replace-jsx-attribute-value/-/babel-plugin-replace-jsx-attribute-value-8.0.0.tgz", + "integrity": "sha512-KVQ+PtIjb1BuYT3ht8M5KbzWBhdAjjUPdlMtpuw/VjT8coTrItWX6Qafl9+ji831JaJcu6PJNKCV0bp01lBNzQ==", "engines": { - "node": ">=10" + "node": ">=14" }, "funding": { "type": "github", @@ -3116,11 +3113,11 @@ } }, "node_modules/@svgr/babel-plugin-svg-dynamic-title": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-svg-dynamic-title/-/babel-plugin-svg-dynamic-title-6.5.1.tgz", - "integrity": "sha512-FwOEi0Il72iAzlkaHrlemVurgSQRDFbk0OC8dSvD5fSBPHltNh7JtLsxmZUhjYBZo2PpcU/RJvvi6Q0l7O7ogw==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-svg-dynamic-title/-/babel-plugin-svg-dynamic-title-8.0.0.tgz", + "integrity": "sha512-omNiKqwjNmOQJ2v6ge4SErBbkooV2aAWwaPFs2vUY7p7GhVkzRkJ00kILXQvRhA6miHnNpXv7MRnnSjdRjK8og==", "engines": { - "node": ">=10" + "node": ">=14" }, "funding": { "type": "github", @@ -3131,11 +3128,11 @@ } }, "node_modules/@svgr/babel-plugin-svg-em-dimensions": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-svg-em-dimensions/-/babel-plugin-svg-em-dimensions-6.5.1.tgz", - "integrity": "sha512-gWGsiwjb4tw+ITOJ86ndY/DZZ6cuXMNE/SjcDRg+HLuCmwpcjOktwRF9WgAiycTqJD/QXqL2f8IzE2Rzh7aVXA==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-svg-em-dimensions/-/babel-plugin-svg-em-dimensions-8.0.0.tgz", + "integrity": "sha512-mURHYnu6Iw3UBTbhGwE/vsngtCIbHE43xCRK7kCw4t01xyGqb2Pd+WXekRRoFOBIY29ZoOhUCTEweDMdrjfi9g==", "engines": { - "node": ">=10" + "node": ">=14" }, "funding": { "type": "github", @@ -3146,11 +3143,11 @@ } }, "node_modules/@svgr/babel-plugin-transform-react-native-svg": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-transform-react-native-svg/-/babel-plugin-transform-react-native-svg-6.5.1.tgz", - "integrity": "sha512-2jT3nTayyYP7kI6aGutkyfJ7UMGtuguD72OjeGLwVNyfPRBD8zQthlvL+fAbAKk5n9ZNcvFkp/b1lZ7VsYqVJg==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-transform-react-native-svg/-/babel-plugin-transform-react-native-svg-8.1.0.tgz", + "integrity": "sha512-Tx8T58CHo+7nwJ+EhUwx3LfdNSG9R2OKfaIXXs5soiy5HtgoAEkDay9LIimLOcG8dJQH1wPZp/cnAv6S9CrR1Q==", "engines": { - "node": ">=10" + "node": ">=14" }, "funding": { "type": "github", @@ -3161,9 +3158,9 @@ } }, "node_modules/@svgr/babel-plugin-transform-svg-component": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-transform-svg-component/-/babel-plugin-transform-svg-component-6.5.1.tgz", - "integrity": "sha512-a1p6LF5Jt33O3rZoVRBqdxL350oge54iZWHNI6LJB5tQ7EelvD/Mb1mfBiZNAan0dt4i3VArkFRjA4iObuNykQ==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-transform-svg-component/-/babel-plugin-transform-svg-component-8.0.0.tgz", + "integrity": "sha512-DFx8xa3cZXTdb/k3kfPeaixecQLgKh5NVBMwD0AQxOzcZawK4oo1Jh9LbrcACUivsCA7TLG8eeWgrDXjTMhRmw==", "engines": { "node": ">=12" }, @@ -3176,21 +3173,21 @@ } }, "node_modules/@svgr/babel-preset": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/@svgr/babel-preset/-/babel-preset-6.5.1.tgz", - "integrity": "sha512-6127fvO/FF2oi5EzSQOAjo1LE3OtNVh11R+/8FXa+mHx1ptAaS4cknIjnUA7e6j6fwGGJ17NzaTJFUwOV2zwCw==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-preset/-/babel-preset-8.1.0.tgz", + "integrity": "sha512-7EYDbHE7MxHpv4sxvnVPngw5fuR6pw79SkcrILHJ/iMpuKySNCl5W1qcwPEpU+LgyRXOaAFgH0KhwD18wwg6ug==", "dependencies": { - "@svgr/babel-plugin-add-jsx-attribute": "^6.5.1", - "@svgr/babel-plugin-remove-jsx-attribute": "*", - "@svgr/babel-plugin-remove-jsx-empty-expression": "*", - "@svgr/babel-plugin-replace-jsx-attribute-value": "^6.5.1", - "@svgr/babel-plugin-svg-dynamic-title": "^6.5.1", - "@svgr/babel-plugin-svg-em-dimensions": "^6.5.1", - "@svgr/babel-plugin-transform-react-native-svg": "^6.5.1", - "@svgr/babel-plugin-transform-svg-component": "^6.5.1" + "@svgr/babel-plugin-add-jsx-attribute": "8.0.0", + "@svgr/babel-plugin-remove-jsx-attribute": "8.0.0", + "@svgr/babel-plugin-remove-jsx-empty-expression": "8.0.0", + "@svgr/babel-plugin-replace-jsx-attribute-value": "8.0.0", + "@svgr/babel-plugin-svg-dynamic-title": "8.0.0", + "@svgr/babel-plugin-svg-em-dimensions": "8.0.0", + "@svgr/babel-plugin-transform-react-native-svg": "8.1.0", + "@svgr/babel-plugin-transform-svg-component": "8.0.0" }, "engines": { - "node": ">=10" + "node": ">=14" }, "funding": { "type": "github", @@ -3201,18 +3198,18 @@ } }, "node_modules/@svgr/core": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/@svgr/core/-/core-6.5.1.tgz", - "integrity": "sha512-/xdLSWxK5QkqG524ONSjvg3V/FkNyCv538OIBdQqPNaAta3AsXj/Bd2FbvR87yMbXO2hFSWiAe/Q6IkVPDw+mw==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@svgr/core/-/core-8.1.0.tgz", + "integrity": "sha512-8QqtOQT5ACVlmsvKOJNEaWmRPmcojMOzCz4Hs2BGG/toAp/K38LcsMRyLp349glq5AzJbCEeimEoxaX6v/fLrA==", "dependencies": { - "@babel/core": "^7.19.6", - "@svgr/babel-preset": "^6.5.1", - "@svgr/plugin-jsx": "^6.5.1", + "@babel/core": "^7.21.3", + "@svgr/babel-preset": "8.1.0", "camelcase": "^6.2.0", - "cosmiconfig": "^7.0.1" + "cosmiconfig": "^8.1.3", + "snake-case": "^3.0.4" }, "engines": { - "node": ">=10" + "node": ">=14" }, "funding": { "type": "github", @@ -3220,15 +3217,15 @@ } }, "node_modules/@svgr/hast-util-to-babel-ast": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/@svgr/hast-util-to-babel-ast/-/hast-util-to-babel-ast-6.5.1.tgz", - "integrity": "sha512-1hnUxxjd83EAxbL4a0JDJoD3Dao3hmjvyvyEV8PzWmLK3B9m9NPlW7GKjFyoWE8nM7HnXzPcmmSyOW8yOddSXw==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@svgr/hast-util-to-babel-ast/-/hast-util-to-babel-ast-8.0.0.tgz", + "integrity": "sha512-EbDKwO9GpfWP4jN9sGdYwPBU0kdomaPIL2Eu4YwmgP+sJeXT+L7bMwJUBnhzfH8Q2qMBqZ4fJwpCyYsAN3mt2Q==", "dependencies": { - "@babel/types": "^7.20.0", + "@babel/types": "^7.21.3", "entities": "^4.4.0" }, "engines": { - "node": ">=10" + "node": ">=14" }, "funding": { "type": "github", @@ -3236,37 +3233,37 @@ } }, "node_modules/@svgr/plugin-jsx": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/@svgr/plugin-jsx/-/plugin-jsx-6.5.1.tgz", - "integrity": "sha512-+UdQxI3jgtSjCykNSlEMuy1jSRQlGC7pqBCPvkG/2dATdWo082zHTTK3uhnAju2/6XpE6B5mZ3z4Z8Ns01S8Gw==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@svgr/plugin-jsx/-/plugin-jsx-8.1.0.tgz", + "integrity": "sha512-0xiIyBsLlr8quN+WyuxooNW9RJ0Dpr8uOnH/xrCVO8GLUcwHISwj1AG0k+LFzteTkAA0GbX0kj9q6Dk70PTiPA==", "dependencies": { - "@babel/core": "^7.19.6", - "@svgr/babel-preset": "^6.5.1", - "@svgr/hast-util-to-babel-ast": "^6.5.1", + "@babel/core": "^7.21.3", + "@svgr/babel-preset": "8.1.0", + "@svgr/hast-util-to-babel-ast": "8.0.0", "svg-parser": "^2.0.4" }, "engines": { - "node": ">=10" + "node": ">=14" }, "funding": { "type": "github", "url": "https://github.com/sponsors/gregberge" }, "peerDependencies": { - "@svgr/core": "^6.0.0" + "@svgr/core": "*" } }, "node_modules/@svgr/plugin-svgo": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/@svgr/plugin-svgo/-/plugin-svgo-6.5.1.tgz", - "integrity": "sha512-omvZKf8ixP9z6GWgwbtmP9qQMPX4ODXi+wzbVZgomNFsUIlHA1sf4fThdwTWSsZGgvGAG6yE+b/F5gWUkcZ/iQ==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@svgr/plugin-svgo/-/plugin-svgo-8.1.0.tgz", + "integrity": "sha512-Ywtl837OGO9pTLIN/onoWLmDQ4zFUycI1g76vuKGEz6evR/ZTJlJuz3G/fIkb6OVBJ2g0o6CGJzaEjfmEo3AHA==", "dependencies": { - "cosmiconfig": "^7.0.1", - "deepmerge": "^4.2.2", - "svgo": "^2.8.0" + "cosmiconfig": "^8.1.3", + "deepmerge": "^4.3.1", + "svgo": "^3.0.2" }, "engines": { - "node": ">=10" + "node": ">=14" }, "funding": { "type": "github", @@ -3277,21 +3274,21 @@ } }, "node_modules/@svgr/webpack": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/@svgr/webpack/-/webpack-6.5.1.tgz", - "integrity": "sha512-cQ/AsnBkXPkEK8cLbv4Dm7JGXq2XrumKnL1dRpJD9rIO2fTIlJI9a1uCciYG1F2aUsox/hJQyNGbt3soDxSRkA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@svgr/webpack/-/webpack-8.1.0.tgz", + "integrity": "sha512-LnhVjMWyMQV9ZmeEy26maJk+8HTIbd59cH4F2MJ439k9DqejRisfFNGAPvRYlKETuh9LrImlS8aKsBgKjMA8WA==", "dependencies": { - "@babel/core": "^7.19.6", - "@babel/plugin-transform-react-constant-elements": "^7.18.12", - "@babel/preset-env": "^7.19.4", + "@babel/core": "^7.21.3", + "@babel/plugin-transform-react-constant-elements": "^7.21.3", + "@babel/preset-env": "^7.20.2", "@babel/preset-react": "^7.18.6", - "@babel/preset-typescript": "^7.18.6", - "@svgr/core": "^6.5.1", - "@svgr/plugin-jsx": "^6.5.1", - "@svgr/plugin-svgo": "^6.5.1" + "@babel/preset-typescript": "^7.21.0", + "@svgr/core": "8.1.0", + "@svgr/plugin-jsx": "8.1.0", + "@svgr/plugin-svgo": "8.1.0" }, "engines": { - "node": ">=10" + "node": ">=14" }, "funding": { "type": "github", @@ -3409,9 +3406,9 @@ "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==" }, "node_modules/@types/estree-jsx": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@types/estree-jsx/-/estree-jsx-1.0.3.tgz", - "integrity": "sha512-pvQ+TKeRHeiUGRhvYwRrQ/ISnohKkSJR14fT2yqyZ4e9K5vqc7hrtY2Y1Dw0ZwAzQ6DQsxsaCUuSIIi8v0Cq6w==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree-jsx/-/estree-jsx-1.0.5.tgz", + "integrity": "sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==", "dependencies": { "@types/estree": "*" } @@ -3444,9 +3441,9 @@ "integrity": "sha512-YQV9bUsemkzG81Ea295/nF/5GijnD2Af7QhEofh7xu+kvCN6RdodgNwwGWXB5GMI3NoyvQo0odNctoH/qLMIpg==" }, "node_modules/@types/hast": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.3.tgz", - "integrity": "sha512-2fYGlaDy/qyLlhidX42wAH0KBi2TCjKMH8CHmBXgRlJ3Y+OXTiqsPQ6IWarZKwF1JoUcAJdPogv1d4b0COTpmQ==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", "dependencies": { "@types/unist": "*" } @@ -3506,9 +3503,9 @@ "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==" }, "node_modules/@types/mdast": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", - "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", + "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", "dependencies": { "@types/unist": "*" } @@ -3962,30 +3959,31 @@ } }, "node_modules/algoliasearch": { - "version": "4.22.0", - "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-4.22.0.tgz", - "integrity": "sha512-gfceltjkwh7PxXwtkS8KVvdfK+TSNQAWUeNSxf4dA29qW5tf2EGwa8jkJujlT9jLm17cixMVoGNc+GJFO1Mxhg==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-4.24.0.tgz", + "integrity": "sha512-bf0QV/9jVejssFBmz2HQLxUadxk574t4iwjCKp5E7NBzwKkrDEhKPISIIjAU/p6K5qDx3qoeh4+26zWN1jmw3g==", "dependencies": { - "@algolia/cache-browser-local-storage": "4.22.0", - "@algolia/cache-common": "4.22.0", - "@algolia/cache-in-memory": "4.22.0", - "@algolia/client-account": "4.22.0", - "@algolia/client-analytics": "4.22.0", - "@algolia/client-common": "4.22.0", - "@algolia/client-personalization": "4.22.0", - "@algolia/client-search": "4.22.0", - "@algolia/logger-common": "4.22.0", - "@algolia/logger-console": "4.22.0", - "@algolia/requester-browser-xhr": "4.22.0", - "@algolia/requester-common": "4.22.0", - "@algolia/requester-node-http": "4.22.0", - "@algolia/transporter": "4.22.0" + "@algolia/cache-browser-local-storage": "4.24.0", + "@algolia/cache-common": "4.24.0", + "@algolia/cache-in-memory": "4.24.0", + "@algolia/client-account": "4.24.0", + "@algolia/client-analytics": "4.24.0", + "@algolia/client-common": "4.24.0", + "@algolia/client-personalization": "4.24.0", + "@algolia/client-search": "4.24.0", + "@algolia/logger-common": "4.24.0", + "@algolia/logger-console": "4.24.0", + "@algolia/recommend": "4.24.0", + "@algolia/requester-browser-xhr": "4.24.0", + "@algolia/requester-common": "4.24.0", + "@algolia/requester-node-http": "4.24.0", + "@algolia/transporter": "4.24.0" } }, "node_modules/algoliasearch-helper": { - "version": "3.16.1", - "resolved": "https://registry.npmjs.org/algoliasearch-helper/-/algoliasearch-helper-3.16.1.tgz", - "integrity": "sha512-qxAHVjjmT7USVvrM8q6gZGaJlCK1fl4APfdAA7o8O6iXEc68G0xMNrzRkxoB/HmhhvyHnoteS/iMTiHiTcQQcg==", + "version": "3.22.2", + "resolved": "https://registry.npmjs.org/algoliasearch-helper/-/algoliasearch-helper-3.22.2.tgz", + "integrity": "sha512-3YQ6eo7uYOCHeQ2ZpD+OoT3aJJwMNKEnwtu8WMzm81XmBOSCwRjQditH9CeSOQ38qhHkuGw23pbq+kULkIJLcw==", "dependencies": { "@algolia/events": "^4.0.1" }, @@ -4104,9 +4102,9 @@ } }, "node_modules/autoprefixer": { - "version": "10.4.16", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.16.tgz", - "integrity": "sha512-7vd3UC6xKp0HLfua5IjZlcXvGAGy7cBAXTg2lyQ/8WpNhd6SiZ8Be+xm3FyBSYJx5GKcpRCzBh7RH4/0dnY+uQ==", + "version": "10.4.19", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.19.tgz", + "integrity": "sha512-BaENR2+zBZ8xXhM4pUaKUxlVdxZ0EZhjvbopwnXmxRUfqDmwSpC2lAi/QXvx7NRdPCo1WKEcEF6mV64si1z4Ew==", "funding": [ { "type": "opencollective", @@ -4122,9 +4120,9 @@ } ], "dependencies": { - "browserslist": "^4.21.10", - "caniuse-lite": "^1.0.30001538", - "fraction.js": "^4.3.6", + "browserslist": "^4.23.0", + "caniuse-lite": "^1.0.30001599", + "fraction.js": "^4.3.7", "normalize-range": "^0.1.2", "picocolors": "^1.0.0", "postcss-value-parser": "^4.2.0" @@ -4344,9 +4342,9 @@ } }, "node_modules/browserslist": { - "version": "4.22.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.2.tgz", - "integrity": "sha512-0UgcrvQmBDvZHFGdYUehrCNIazki7/lUP3kkoi/r3YB2amZbFM9J43ZRkJTXBUZK4gmx56+Sqk9+Vs9mwZx9+A==", + "version": "4.23.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.2.tgz", + "integrity": "sha512-qkqSyistMYdxAcw+CzbZwlBy8AGmS/eEWs+sEV5TnLRGDOL+C5M2EnH6tlZyg0YoAxGJAFKh61En9BR941GnHA==", "funding": [ { "type": "opencollective", @@ -4362,10 +4360,10 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001565", - "electron-to-chromium": "^1.4.601", + "caniuse-lite": "^1.0.30001640", + "electron-to-chromium": "^1.4.820", "node-releases": "^2.0.14", - "update-browserslist-db": "^1.0.13" + "update-browserslist-db": "^1.1.0" }, "bin": { "browserslist": "cli.js" @@ -4476,9 +4474,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001571", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001571.tgz", - "integrity": "sha512-tYq/6MoXhdezDLFZuCO/TKboTzuQ/xR5cFdgXPfDtM7/kchBO3b4VWghE/OAi/DV7tTdhmLjZiZBZi1fA/GheQ==", + "version": "1.0.30001641", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001641.tgz", + "integrity": "sha512-Phv5thgl67bHYo1TtMY/MurjkHhV4EDaCosezRXgZ8jzA/Ub+wjxAvbGvjoFENStinwi5kCyOYV3mi5tOGykwA==", "funding": [ { "type": "opencollective", @@ -5066,18 +5064,28 @@ } }, "node_modules/cosmiconfig": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", - "integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==", + "version": "8.3.6", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.3.6.tgz", + "integrity": "sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==", "dependencies": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.2.1", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.10.0" + "import-fresh": "^3.3.0", + "js-yaml": "^4.1.0", + "parse-json": "^5.2.0", + "path-type": "^4.0.0" }, "engines": { - "node": ">=10" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + }, + "peerDependencies": { + "typescript": ">=4.9.5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, "node_modules/cross-spawn": { @@ -5119,11 +5127,11 @@ } }, "node_modules/css-declaration-sorter": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-6.4.1.tgz", - "integrity": "sha512-rtdthzxKuyq6IzqX6jEcIzQF/YqccluefyCYheovBOLhFT/drQA9zj/UbRAa9J7C0o6EG6u3E6g+vKkay7/k3g==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-7.2.0.tgz", + "integrity": "sha512-h70rUM+3PNFuaBDTLe8wF/cdWu+dOZmb7pJt8Z2sedYbAcQVQV/tEchueg3GWxwqS0cxtbxmaHEdkNACqcvsow==", "engines": { - "node": "^10 || ^12 || >=14" + "node": "^14 || ^16 || >=18" }, "peerDependencies": { "postcss": "^8.0.9" @@ -5155,16 +5163,16 @@ } }, "node_modules/css-minimizer-webpack-plugin": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/css-minimizer-webpack-plugin/-/css-minimizer-webpack-plugin-4.2.2.tgz", - "integrity": "sha512-s3Of/4jKfw1Hj9CxEO1E5oXhQAxlayuHO2y/ML+C6I9sQ7FdzfEV6QgMLN3vI+qFsjJGIAFLKtQK7t8BOXAIyA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/css-minimizer-webpack-plugin/-/css-minimizer-webpack-plugin-5.0.1.tgz", + "integrity": "sha512-3caImjKFQkS+ws1TGcFn0V1HyDJFq1Euy589JlD6/3rV2kj+w7r5G9WDMgSHvpvXHNZ2calVypZWuEDQd9wfLg==", "dependencies": { - "cssnano": "^5.1.8", - "jest-worker": "^29.1.2", - "postcss": "^8.4.17", - "schema-utils": "^4.0.0", - "serialize-javascript": "^6.0.0", - "source-map": "^0.6.1" + "@jridgewell/trace-mapping": "^0.3.18", + "cssnano": "^6.0.1", + "jest-worker": "^29.4.3", + "postcss": "^8.4.24", + "schema-utils": "^4.0.1", + "serialize-javascript": "^6.0.1" }, "engines": { "node": ">= 14.15.0" @@ -5197,14 +5205,6 @@ } } }, - "node_modules/css-minimizer-webpack-plugin/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/css-select": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", @@ -5221,23 +5221,15 @@ } }, "node_modules/css-tree": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", - "integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", + "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==", "dependencies": { - "mdn-data": "2.0.14", - "source-map": "^0.6.1" + "mdn-data": "2.0.30", + "source-map-js": "^1.0.1" }, "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/css-tree/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "engines": { - "node": ">=0.10.0" + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" } }, "node_modules/css-what": { @@ -5263,108 +5255,128 @@ } }, "node_modules/cssnano": { - "version": "5.1.15", - "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-5.1.15.tgz", - "integrity": "sha512-j+BKgDcLDQA+eDifLx0EO4XSA56b7uut3BQFH+wbSaSTuGLuiyTa/wbRYthUXX8LC9mLg+WWKe8h+qJuwTAbHw==", + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-6.1.2.tgz", + "integrity": "sha512-rYk5UeX7VAM/u0lNqewCdasdtPK81CgX8wJFLEIXHbV2oldWRgJAsZrdhRXkV1NJzA2g850KiFm9mMU2HxNxMA==", "dependencies": { - "cssnano-preset-default": "^5.2.14", - "lilconfig": "^2.0.3", - "yaml": "^1.10.2" + "cssnano-preset-default": "^6.1.2", + "lilconfig": "^3.1.1" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/cssnano" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/cssnano-preset-advanced": { - "version": "5.3.10", - "resolved": "https://registry.npmjs.org/cssnano-preset-advanced/-/cssnano-preset-advanced-5.3.10.tgz", - "integrity": "sha512-fnYJyCS9jgMU+cmHO1rPSPf9axbQyD7iUhLO5Df6O4G+fKIOMps+ZbU0PdGFejFBBZ3Pftf18fn1eG7MAPUSWQ==", + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/cssnano-preset-advanced/-/cssnano-preset-advanced-6.1.2.tgz", + "integrity": "sha512-Nhao7eD8ph2DoHolEzQs5CfRpiEP0xa1HBdnFZ82kvqdmbwVBUr2r1QuQ4t1pi+D1ZpqpcO4T+wy/7RxzJ/WPQ==", "dependencies": { - "autoprefixer": "^10.4.12", - "cssnano-preset-default": "^5.2.14", - "postcss-discard-unused": "^5.1.0", - "postcss-merge-idents": "^5.1.1", - "postcss-reduce-idents": "^5.2.0", - "postcss-zindex": "^5.1.0" + "autoprefixer": "^10.4.19", + "browserslist": "^4.23.0", + "cssnano-preset-default": "^6.1.2", + "postcss-discard-unused": "^6.0.5", + "postcss-merge-idents": "^6.0.3", + "postcss-reduce-idents": "^6.0.3", + "postcss-zindex": "^6.0.2" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/cssnano-preset-default": { - "version": "5.2.14", - "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-5.2.14.tgz", - "integrity": "sha512-t0SFesj/ZV2OTylqQVOrFgEh5uanxbO6ZAdeCrNsUQ6fVuXwYTxJPNAGvGTxHbD68ldIJNec7PyYZDBrfDQ+6A==", + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-6.1.2.tgz", + "integrity": "sha512-1C0C+eNaeN8OcHQa193aRgYexyJtU8XwbdieEjClw+J9d94E41LwT6ivKH0WT+fYwYWB0Zp3I3IZ7tI/BbUbrg==", "dependencies": { - "css-declaration-sorter": "^6.3.1", - "cssnano-utils": "^3.1.0", - "postcss-calc": "^8.2.3", - "postcss-colormin": "^5.3.1", - "postcss-convert-values": "^5.1.3", - "postcss-discard-comments": "^5.1.2", - "postcss-discard-duplicates": "^5.1.0", - "postcss-discard-empty": "^5.1.1", - "postcss-discard-overridden": "^5.1.0", - "postcss-merge-longhand": "^5.1.7", - "postcss-merge-rules": "^5.1.4", - "postcss-minify-font-values": "^5.1.0", - "postcss-minify-gradients": "^5.1.1", - "postcss-minify-params": "^5.1.4", - "postcss-minify-selectors": "^5.2.1", - "postcss-normalize-charset": "^5.1.0", - "postcss-normalize-display-values": "^5.1.0", - "postcss-normalize-positions": "^5.1.1", - "postcss-normalize-repeat-style": "^5.1.1", - "postcss-normalize-string": "^5.1.0", - "postcss-normalize-timing-functions": "^5.1.0", - "postcss-normalize-unicode": "^5.1.1", - "postcss-normalize-url": "^5.1.0", - "postcss-normalize-whitespace": "^5.1.1", - "postcss-ordered-values": "^5.1.3", - "postcss-reduce-initial": "^5.1.2", - "postcss-reduce-transforms": "^5.1.0", - "postcss-svgo": "^5.1.0", - "postcss-unique-selectors": "^5.1.1" + "browserslist": "^4.23.0", + "css-declaration-sorter": "^7.2.0", + "cssnano-utils": "^4.0.2", + "postcss-calc": "^9.0.1", + "postcss-colormin": "^6.1.0", + "postcss-convert-values": "^6.1.0", + "postcss-discard-comments": "^6.0.2", + "postcss-discard-duplicates": "^6.0.3", + "postcss-discard-empty": "^6.0.3", + "postcss-discard-overridden": "^6.0.2", + "postcss-merge-longhand": "^6.0.5", + "postcss-merge-rules": "^6.1.1", + "postcss-minify-font-values": "^6.1.0", + "postcss-minify-gradients": "^6.0.3", + "postcss-minify-params": "^6.1.0", + "postcss-minify-selectors": "^6.0.4", + "postcss-normalize-charset": "^6.0.2", + "postcss-normalize-display-values": "^6.0.2", + "postcss-normalize-positions": "^6.0.2", + "postcss-normalize-repeat-style": "^6.0.2", + "postcss-normalize-string": "^6.0.2", + "postcss-normalize-timing-functions": "^6.0.2", + "postcss-normalize-unicode": "^6.1.0", + "postcss-normalize-url": "^6.0.2", + "postcss-normalize-whitespace": "^6.0.2", + "postcss-ordered-values": "^6.0.2", + "postcss-reduce-initial": "^6.1.0", + "postcss-reduce-transforms": "^6.0.2", + "postcss-svgo": "^6.0.3", + "postcss-unique-selectors": "^6.0.4" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/cssnano-utils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cssnano-utils/-/cssnano-utils-3.1.0.tgz", - "integrity": "sha512-JQNR19/YZhz4psLX/rQ9M83e3z2Wf/HdJbryzte4a3NSuafyp9w/I4U+hx5C2S9g41qlstH7DEWnZaaj83OuEA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/cssnano-utils/-/cssnano-utils-4.0.2.tgz", + "integrity": "sha512-ZR1jHg+wZ8o4c3zqf1SIUSTIvm/9mU343FMR6Obe/unskbvpGhZOo1J6d/r8D1pzkRQYuwbcH3hToOuoA2G7oQ==", "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/csso": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/csso/-/csso-4.2.0.tgz", - "integrity": "sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/csso/-/csso-5.0.5.tgz", + "integrity": "sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==", "dependencies": { - "css-tree": "^1.1.2" + "css-tree": "~2.2.0" }, "engines": { - "node": ">=8.0.0" + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", + "npm": ">=7.0.0" } }, + "node_modules/csso/node_modules/css-tree": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.2.1.tgz", + "integrity": "sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==", + "dependencies": { + "mdn-data": "2.0.28", + "source-map-js": "^1.0.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/csso/node_modules/mdn-data": { + "version": "2.0.28", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.28.tgz", + "integrity": "sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==" + }, "node_modules/csstype": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", @@ -6244,9 +6256,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/electron-to-chromium": { - "version": "1.4.616", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.616.tgz", - "integrity": "sha512-1n7zWYh8eS0L9Uy+GskE0lkBUNK83cXTVJI0pU3mGprFsbfSdAc15VTFbo+A+Bq4pwstmL30AVcEU3Fo463lNg==" + "version": "1.4.827", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.827.tgz", + "integrity": "sha512-VY+J0e4SFcNfQy19MEoMdaIcZLmDCprqvBtkii1WTCTQHpRvf5N8+3kTYCgL/PcntvwQvmMJWTuDPsq+IlhWKQ==" }, "node_modules/elkjs": { "version": "0.8.2", @@ -6325,9 +6337,9 @@ "integrity": "sha512-cXLGjP0c4T3flZJKQSuziYoq7MlT+rnvfZjfp7h+I7K9BNX54kP9nyWvdbwjQ4u1iWbOL4u96fgeZLToQlZC7w==" }, "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", "engines": { "node": ">=6" } @@ -6461,15 +6473,11 @@ } }, "node_modules/estree-util-value-to-estree": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/estree-util-value-to-estree/-/estree-util-value-to-estree-3.0.1.tgz", - "integrity": "sha512-b2tdzTurEIbwRh+mKrEcaWfu1wgb8J1hVsgREg7FFiecWwK/PhO8X0kyc+0bIcKNtD4sqxIdNoRy6/p/TvECEA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/estree-util-value-to-estree/-/estree-util-value-to-estree-3.1.2.tgz", + "integrity": "sha512-S0gW2+XZkmsx00tU2uJ4L9hUT7IFabbml9pHh2WQqFmAbxit++YGZne0sKJbNwkj9Wvg9E4uqWl4nCIFQMmfag==", "dependencies": { - "@types/estree": "^1.0.0", - "is-plain-obj": "^4.0.0" - }, - "engines": { - "node": ">=16.0.0" + "@types/estree": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/remcohaszing" @@ -7483,9 +7491,9 @@ } }, "node_modules/hast-util-raw": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-9.0.1.tgz", - "integrity": "sha512-5m1gmba658Q+lO5uqL5YNGQWeh1MYWZbZmWrM5lncdcuiXuo5E2HT/CIOp0rLF8ksfSwiCVJ3twlgVRyTGThGA==", + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-9.0.4.tgz", + "integrity": "sha512-LHE65TD2YiNsHD3YuXcKPHXPLuYh/gjp12mOfU8jxSrm1f/yJpsb0F/KKljS6U9LJoP0Ux+tCe8iJ2AsPzTdgA==", "dependencies": { "@types/hast": "^3.0.0", "@types/unist": "^3.0.0", @@ -7560,16 +7568,16 @@ } }, "node_modules/hast-util-to-jsx-runtime/node_modules/inline-style-parser": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.2.tgz", - "integrity": "sha512-EcKzdTHVe8wFVOGEYXiW9WmJXPjqi1T+234YpJr98RiFYKHV3cdy1+3mkTE+KHTHxFFLH51SfaGOoUdW+v7ViQ==" + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.3.tgz", + "integrity": "sha512-qlD8YNDqyTKTyuITrDOffsl6Tdhv+UC4hcdAVuQsK4IMQ99nSgd1MIA/Q+jQYoh9r3hVUXhYh7urSRmXPkW04g==" }, "node_modules/hast-util-to-jsx-runtime/node_modules/style-to-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-1.0.5.tgz", - "integrity": "sha512-rDRwHtoDD3UMMrmZ6BzOW0naTjMsVZLIjsGleSKS/0Oz+cgCfAPRspaqJuE8rDzpKha/nEvnM0IF4seEAZUTKQ==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-1.0.6.tgz", + "integrity": "sha512-khxq+Qm3xEyZfKd/y9L3oIWQimxuc4STrQKtQn8aSDRHb8mFgpukgX1hdzfrMEW6JCjyJ8p89x+IUMVnCBI1PA==", "dependencies": { - "inline-style-parser": "0.2.2" + "inline-style-parser": "0.2.3" } }, "node_modules/hast-util-to-parse5": { @@ -7968,9 +7976,9 @@ } }, "node_modules/image-size": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/image-size/-/image-size-1.0.2.tgz", - "integrity": "sha512-xfOoWjceHntRb3qFCrh5ZFORYH8XCdYpASltMhZ/Q0KZiOwjdE/Yl2QCiWdwD+lygV5bMCvauzgu5PxBX/Yerg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-1.1.1.tgz", + "integrity": "sha512-541xKlUw6jr/6gGuk92F+mYM5zaFAc5ahphvkqvNe2bQ6gVBkd6bfrmVJ2t4KDAfikAYZyIqTnktX3i6/aQDrQ==", "dependencies": { "queue": "6.0.2" }, @@ -7978,7 +7986,7 @@ "image-size": "bin/image-size.js" }, "engines": { - "node": ">=14.0.0" + "node": ">=16.x" } }, "node_modules/immer": { @@ -8427,13 +8435,13 @@ } }, "node_modules/joi": { - "version": "17.11.0", - "resolved": "https://registry.npmjs.org/joi/-/joi-17.11.0.tgz", - "integrity": "sha512-NgB+lZLNoqISVy1rZocE9PZI36bL/77ie924Ri43yEvi9GUUMPeyVIr8KdFTMUlby1p0PBYMk9spIxEUQYqrJQ==", + "version": "17.13.3", + "resolved": "https://registry.npmjs.org/joi/-/joi-17.13.3.tgz", + "integrity": "sha512-otDA4ldcIx+ZXsKHWmp0YizCweVRZG96J10b0FevjfuncLO1oX59THoAmHkNubYJ+9gWsYsp5k8v4ib6oDv1fA==", "dependencies": { - "@hapi/hoek": "^9.0.0", - "@hapi/topo": "^5.0.0", - "@sideway/address": "^4.1.3", + "@hapi/hoek": "^9.3.0", + "@hapi/topo": "^5.1.0", + "@sideway/address": "^4.1.5", "@sideway/formula": "^3.0.1", "@sideway/pinpoint": "^2.0.0" } @@ -8568,11 +8576,14 @@ } }, "node_modules/lilconfig": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", - "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.2.tgz", + "integrity": "sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==", "engines": { - "node": ">=10" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" } }, "node_modules/lines-and-columns": { @@ -8753,9 +8764,9 @@ } }, "node_modules/mdast-util-from-markdown": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.0.tgz", - "integrity": "sha512-n7MTOr/z+8NAX/wmhhDji8O3bRvPTV/U0oTCaZJkjhPSKTPhS3xufVhKGF8s1pJ7Ox4QgoIU7KHseh09S+9rTA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.1.tgz", + "integrity": "sha512-aJEUyzZ6TzlsX2s5B4Of7lN7EQtAxvtradMMglCQDyaTFgse6CmtmdJ15ElnVRlCg1vpNyVtbem0PWzlNieZsA==", "dependencies": { "@types/mdast": "^4.0.0", "@types/unist": "^3.0.0", @@ -8853,9 +8864,9 @@ } }, "node_modules/mdast-util-gfm-autolink-literal/node_modules/micromark-util-character": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.0.1.tgz", - "integrity": "sha512-3wgnrmEAJ4T+mGXAUfMvMAbxU9RDG43XmGce4j6CwPtVxB3vfwXSZ6KhFwDzZ3mZHhmPimMAXg71veiBGzeAZw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", + "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", "funding": [ { "type": "GitHub Sponsors", @@ -8981,9 +8992,9 @@ } }, "node_modules/mdast-util-mdx-jsx": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.0.0.tgz", - "integrity": "sha512-XZuPPzQNBPAlaqsTTgRrcJnyFbSOBovSadFgbFu8SnuNgm+6Bdx1K+IWoitsmj6Lq6MNtI+ytOqwN70n//NaBA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.1.2.tgz", + "integrity": "sha512-eKMQDeywY2wlHc97k5eD8VC+9ASMjN8ItEZQNGwJ6E0XWKiW/Z0V5/H8pvoXUf+y+Mj0VIgeRRbujBmFn4FTyA==", "dependencies": { "@types/estree-jsx": "^1.0.0", "@types/hast": "^3.0.0", @@ -9022,9 +9033,9 @@ } }, "node_modules/mdast-util-phrasing": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.0.0.tgz", - "integrity": "sha512-xadSsJayQIucJ9n053dfQwVu1kuXg7jCTdYsMK8rqzKZh52nLfSH/k0sAxE0u+pj/zKZX+o5wB+ML5mRayOxFA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz", + "integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==", "dependencies": { "@types/mdast": "^4.0.0", "unist-util-is": "^6.0.0" @@ -9035,9 +9046,9 @@ } }, "node_modules/mdast-util-to-hast": { - "version": "13.0.2", - "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.0.2.tgz", - "integrity": "sha512-U5I+500EOOw9e3ZrclN3Is3fRpw8c19SMyNZlZ2IS+7vLsNzb2Om11VpIVOR+/0137GhZsFEF6YiKD5+0Hr2Og==", + "version": "13.2.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.0.tgz", + "integrity": "sha512-QGYKEuUsYT9ykKBCMOEDLsU5JRObWQusAolFMeko/tYPufNkRffBAQjIE+99jbA87xv6FgmjLtwjh9wBWajwAA==", "dependencies": { "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", @@ -9046,7 +9057,8 @@ "micromark-util-sanitize-uri": "^2.0.0", "trim-lines": "^3.0.0", "unist-util-position": "^5.0.0", - "unist-util-visit": "^5.0.0" + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", @@ -9085,9 +9097,9 @@ } }, "node_modules/mdn-data": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", - "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==" + "version": "2.0.30", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", + "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==" }, "node_modules/media-typer": { "version": "0.3.0", @@ -9636,9 +9648,9 @@ } }, "node_modules/micromark-core-commonmark": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.0.tgz", - "integrity": "sha512-jThOz/pVmAYUtkroV3D5c1osFXAMv9e0ypGDOIZuCeAe91/sD6BoE2Sjzt30yuXtwOYUmySOhMas/PVyh02itA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.1.tgz", + "integrity": "sha512-CUQyKr1e///ZODyD1U3xit6zXwy1a8q2a1S1HKtIlmgvurrEpaw/Y9y6KSIbF8P59cn/NjzHyO+Q2fAyYLQrAA==", "funding": [ { "type": "GitHub Sponsors", @@ -9688,9 +9700,9 @@ } }, "node_modules/micromark-core-commonmark/node_modules/micromark-util-character": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.0.1.tgz", - "integrity": "sha512-3wgnrmEAJ4T+mGXAUfMvMAbxU9RDG43XmGce4j6CwPtVxB3vfwXSZ6KhFwDzZ3mZHhmPimMAXg71veiBGzeAZw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", + "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", "funding": [ { "type": "GitHub Sponsors", @@ -9759,9 +9771,9 @@ } }, "node_modules/micromark-extension-directive/node_modules/micromark-util-character": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.0.1.tgz", - "integrity": "sha512-3wgnrmEAJ4T+mGXAUfMvMAbxU9RDG43XmGce4j6CwPtVxB3vfwXSZ6KhFwDzZ3mZHhmPimMAXg71veiBGzeAZw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", + "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", "funding": [ { "type": "GitHub Sponsors", @@ -9808,9 +9820,9 @@ } }, "node_modules/micromark-extension-frontmatter/node_modules/micromark-util-character": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.0.1.tgz", - "integrity": "sha512-3wgnrmEAJ4T+mGXAUfMvMAbxU9RDG43XmGce4j6CwPtVxB3vfwXSZ6KhFwDzZ3mZHhmPimMAXg71veiBGzeAZw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", + "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", "funding": [ { "type": "GitHub Sponsors", @@ -9861,9 +9873,9 @@ } }, "node_modules/micromark-extension-gfm-autolink-literal": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.0.0.tgz", - "integrity": "sha512-rTHfnpt/Q7dEAK1Y5ii0W8bhfJlVJFnJMHIPisfPK3gpVNuOP0VnRl96+YJ3RYWV/P4gFeQoGKNlT3RhuvpqAg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.1.0.tgz", + "integrity": "sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw==", "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-sanitize-uri": "^2.0.0", @@ -9876,9 +9888,9 @@ } }, "node_modules/micromark-extension-gfm-autolink-literal/node_modules/micromark-util-character": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.0.1.tgz", - "integrity": "sha512-3wgnrmEAJ4T+mGXAUfMvMAbxU9RDG43XmGce4j6CwPtVxB3vfwXSZ6KhFwDzZ3mZHhmPimMAXg71veiBGzeAZw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", + "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", "funding": [ { "type": "GitHub Sponsors", @@ -9910,9 +9922,9 @@ ] }, "node_modules/micromark-extension-gfm-footnote": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.0.0.tgz", - "integrity": "sha512-6Rzu0CYRKDv3BfLAUnZsSlzx3ak6HAoI85KTiijuKIz5UxZxbUI+pD6oHgw+6UtQuiRwnGRhzMmPRv4smcz0fg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.1.0.tgz", + "integrity": "sha512-/yPhxI1ntnDNsiHtzLKYnE3vf9JZ6cAisqVDauhp4CEHxlb4uoOTxOCJ+9s51bIB8U1N1FJ1RXOKTIlD5B/gqw==", "dependencies": { "devlop": "^1.0.0", "micromark-core-commonmark": "^2.0.0", @@ -9948,9 +9960,9 @@ } }, "node_modules/micromark-extension-gfm-footnote/node_modules/micromark-util-character": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.0.1.tgz", - "integrity": "sha512-3wgnrmEAJ4T+mGXAUfMvMAbxU9RDG43XmGce4j6CwPtVxB3vfwXSZ6KhFwDzZ3mZHhmPimMAXg71veiBGzeAZw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", + "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", "funding": [ { "type": "GitHub Sponsors", @@ -9982,9 +9994,9 @@ ] }, "node_modules/micromark-extension-gfm-strikethrough": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.0.0.tgz", - "integrity": "sha512-c3BR1ClMp5fxxmwP6AoOY2fXO9U8uFMKs4ADD66ahLTNcwzSCyRVU4k7LPV5Nxo/VJiR4TdzxRQY2v3qIUceCw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.1.0.tgz", + "integrity": "sha512-ADVjpOOkjz1hhkZLlBiYA9cR2Anf8F4HqZUO6e5eDcPQd0Txw5fxLzzxnEkSkfnD0wziSGiv7sYhk/ktvbf1uw==", "dependencies": { "devlop": "^1.0.0", "micromark-util-chunked": "^2.0.0", @@ -10014,9 +10026,9 @@ ] }, "node_modules/micromark-extension-gfm-table": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.0.0.tgz", - "integrity": "sha512-PoHlhypg1ItIucOaHmKE8fbin3vTLpDOUg8KAr8gRCF1MOZI9Nquq2i/44wFvviM4WuxJzc3demT8Y3dkfvYrw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.1.0.tgz", + "integrity": "sha512-Ub2ncQv+fwD70/l4ou27b4YzfNaCJOvyX4HxXU15m7mpYY+rjuWzsLIPZHJL253Z643RpbcP1oeIJlQ/SKW67g==", "dependencies": { "devlop": "^1.0.0", "micromark-factory-space": "^2.0.0", @@ -10049,9 +10061,9 @@ } }, "node_modules/micromark-extension-gfm-table/node_modules/micromark-util-character": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.0.1.tgz", - "integrity": "sha512-3wgnrmEAJ4T+mGXAUfMvMAbxU9RDG43XmGce4j6CwPtVxB3vfwXSZ6KhFwDzZ3mZHhmPimMAXg71veiBGzeAZw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", + "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", "funding": [ { "type": "GitHub Sponsors", @@ -10095,9 +10107,9 @@ } }, "node_modules/micromark-extension-gfm-task-list-item": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.0.1.tgz", - "integrity": "sha512-cY5PzGcnULaN5O7T+cOzfMoHjBW7j+T9D2sucA5d/KbsBTPcYdebm9zUd9zzdgJGCwahV+/W78Z3nbulBYVbTw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.1.0.tgz", + "integrity": "sha512-qIBZhqxqI6fjLDYFTBIa4eivDMnP+OZqsNwmQ3xNLE4Cxwc+zfQEfbs6tzAo2Hjq+bh6q5F+Z8/cksrLFYWQQw==", "dependencies": { "devlop": "^1.0.0", "micromark-factory-space": "^2.0.0", @@ -10130,9 +10142,9 @@ } }, "node_modules/micromark-extension-gfm-task-list-item/node_modules/micromark-util-character": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.0.1.tgz", - "integrity": "sha512-3wgnrmEAJ4T+mGXAUfMvMAbxU9RDG43XmGce4j6CwPtVxB3vfwXSZ6KhFwDzZ3mZHhmPimMAXg71veiBGzeAZw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", + "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", "funding": [ { "type": "GitHub Sponsors", @@ -10208,9 +10220,9 @@ } }, "node_modules/micromark-extension-mdx-expression/node_modules/micromark-util-character": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.0.1.tgz", - "integrity": "sha512-3wgnrmEAJ4T+mGXAUfMvMAbxU9RDG43XmGce4j6CwPtVxB3vfwXSZ6KhFwDzZ3mZHhmPimMAXg71veiBGzeAZw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", + "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", "funding": [ { "type": "GitHub Sponsors", @@ -10282,9 +10294,9 @@ } }, "node_modules/micromark-extension-mdx-jsx/node_modules/micromark-util-character": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.0.1.tgz", - "integrity": "sha512-3wgnrmEAJ4T+mGXAUfMvMAbxU9RDG43XmGce4j6CwPtVxB3vfwXSZ6KhFwDzZ3mZHhmPimMAXg71veiBGzeAZw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", + "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", "funding": [ { "type": "GitHub Sponsors", @@ -10367,9 +10379,9 @@ } }, "node_modules/micromark-extension-mdxjs-esm/node_modules/micromark-util-character": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.0.1.tgz", - "integrity": "sha512-3wgnrmEAJ4T+mGXAUfMvMAbxU9RDG43XmGce4j6CwPtVxB3vfwXSZ6KhFwDzZ3mZHhmPimMAXg71veiBGzeAZw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", + "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", "funding": [ { "type": "GitHub Sponsors", @@ -10421,9 +10433,9 @@ } }, "node_modules/micromark-factory-destination/node_modules/micromark-util-character": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.0.1.tgz", - "integrity": "sha512-3wgnrmEAJ4T+mGXAUfMvMAbxU9RDG43XmGce4j6CwPtVxB3vfwXSZ6KhFwDzZ3mZHhmPimMAXg71veiBGzeAZw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", + "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", "funding": [ { "type": "GitHub Sponsors", @@ -10476,9 +10488,9 @@ } }, "node_modules/micromark-factory-label/node_modules/micromark-util-character": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.0.1.tgz", - "integrity": "sha512-3wgnrmEAJ4T+mGXAUfMvMAbxU9RDG43XmGce4j6CwPtVxB3vfwXSZ6KhFwDzZ3mZHhmPimMAXg71veiBGzeAZw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", + "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", "funding": [ { "type": "GitHub Sponsors", @@ -10535,9 +10547,9 @@ } }, "node_modules/micromark-factory-mdx-expression/node_modules/micromark-util-character": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.0.1.tgz", - "integrity": "sha512-3wgnrmEAJ4T+mGXAUfMvMAbxU9RDG43XmGce4j6CwPtVxB3vfwXSZ6KhFwDzZ3mZHhmPimMAXg71veiBGzeAZw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", + "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", "funding": [ { "type": "GitHub Sponsors", @@ -10643,9 +10655,9 @@ } }, "node_modules/micromark-factory-title/node_modules/micromark-util-character": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.0.1.tgz", - "integrity": "sha512-3wgnrmEAJ4T+mGXAUfMvMAbxU9RDG43XmGce4j6CwPtVxB3vfwXSZ6KhFwDzZ3mZHhmPimMAXg71veiBGzeAZw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", + "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", "funding": [ { "type": "GitHub Sponsors", @@ -10717,9 +10729,9 @@ } }, "node_modules/micromark-factory-whitespace/node_modules/micromark-util-character": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.0.1.tgz", - "integrity": "sha512-3wgnrmEAJ4T+mGXAUfMvMAbxU9RDG43XmGce4j6CwPtVxB3vfwXSZ6KhFwDzZ3mZHhmPimMAXg71veiBGzeAZw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", + "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", "funding": [ { "type": "GitHub Sponsors", @@ -10838,9 +10850,9 @@ } }, "node_modules/micromark-util-classify-character/node_modules/micromark-util-character": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.0.1.tgz", - "integrity": "sha512-3wgnrmEAJ4T+mGXAUfMvMAbxU9RDG43XmGce4j6CwPtVxB3vfwXSZ6KhFwDzZ3mZHhmPimMAXg71veiBGzeAZw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", + "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", "funding": [ { "type": "GitHub Sponsors", @@ -10945,9 +10957,9 @@ } }, "node_modules/micromark-util-decode-string/node_modules/micromark-util-character": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.0.1.tgz", - "integrity": "sha512-3wgnrmEAJ4T+mGXAUfMvMAbxU9RDG43XmGce4j6CwPtVxB3vfwXSZ6KhFwDzZ3mZHhmPimMAXg71veiBGzeAZw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", + "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", "funding": [ { "type": "GitHub Sponsors", @@ -11120,9 +11132,9 @@ } }, "node_modules/micromark-util-sanitize-uri/node_modules/micromark-util-character": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.0.1.tgz", - "integrity": "sha512-3wgnrmEAJ4T+mGXAUfMvMAbxU9RDG43XmGce4j6CwPtVxB3vfwXSZ6KhFwDzZ3mZHhmPimMAXg71veiBGzeAZw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", + "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", "funding": [ { "type": "GitHub Sponsors", @@ -11154,9 +11166,9 @@ ] }, "node_modules/micromark-util-subtokenize": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.0.tgz", - "integrity": "sha512-vc93L1t+gpR3p8jxeVdaYlbV2jTYteDje19rNSS/H5dlhxUYll5Fy6vJ2cDwP8RnsXi818yGty1ayP55y3W6fg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.1.tgz", + "integrity": "sha512-jZNtiFl/1aY73yS3UGQkutD0UbhTt68qnRpw2Pifmz5wV9h8gOVsN70v+Lq/f1rKaU/W8pxRe8y8Q9FX1AOe1Q==", "funding": [ { "type": "GitHub Sponsors", @@ -11239,9 +11251,9 @@ } }, "node_modules/micromark/node_modules/micromark-util-character": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.0.1.tgz", - "integrity": "sha512-3wgnrmEAJ4T+mGXAUfMvMAbxU9RDG43XmGce4j6CwPtVxB3vfwXSZ6KhFwDzZ3mZHhmPimMAXg71veiBGzeAZw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", + "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", "funding": [ { "type": "GitHub Sponsors", @@ -11495,17 +11507,6 @@ "node": ">=0.10.0" } }, - "node_modules/normalize-url": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", - "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", @@ -11898,9 +11899,9 @@ } }, "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==" }, "node_modules/picomatch": { "version": "2.3.1", @@ -11995,9 +11996,9 @@ } }, "node_modules/postcss": { - "version": "8.4.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.32.tgz", - "integrity": "sha512-D/kj5JNu6oo2EIy+XL/26JEDTlIbB8hw85G8StOE6L74RQAVVP5rej6wxCNqyMbR4RkPfqvezVbPw81Ngd6Kcw==", + "version": "8.4.39", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.39.tgz", + "integrity": "sha512-0vzE+lAiG7hZl1/9I8yzKLx3aR9Xbof3fBHKunvMfOCYAtMhrsnccJY2iTURb9EZd5+pLuiNV9/c/GZJOHsgIw==", "funding": [ { "type": "opencollective", @@ -12014,113 +12015,116 @@ ], "dependencies": { "nanoid": "^3.3.7", - "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" + "picocolors": "^1.0.1", + "source-map-js": "^1.2.0" }, "engines": { "node": "^10 || ^12 || >=14" } }, "node_modules/postcss-calc": { - "version": "8.2.4", - "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-8.2.4.tgz", - "integrity": "sha512-SmWMSJmB8MRnnULldx0lQIyhSNvuDl9HfrZkaqqE/WHAhToYsAvDq+yAsA/kIyINDszOp3Rh0GFoNuH5Ypsm3Q==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-9.0.1.tgz", + "integrity": "sha512-TipgjGyzP5QzEhsOZUaIkeO5mKeMFpebWzRogWG/ysonUlnHcq5aJe0jOjpfzUU8PeSaBQnrE8ehR0QA5vs8PQ==", "dependencies": { - "postcss-selector-parser": "^6.0.9", + "postcss-selector-parser": "^6.0.11", "postcss-value-parser": "^4.2.0" }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, "peerDependencies": { "postcss": "^8.2.2" } }, "node_modules/postcss-colormin": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-5.3.1.tgz", - "integrity": "sha512-UsWQG0AqTFQmpBegeLLc1+c3jIqBNB0zlDGRWR+dQ3pRKJL1oeMzyqmH3o2PIfn9MBdNrVPWhDbT769LxCTLJQ==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-6.1.0.tgz", + "integrity": "sha512-x9yX7DOxeMAR+BgGVnNSAxmAj98NX/YxEMNFP+SDCEeNLb2r3i6Hh1ksMsnW8Ub5SLCpbescQqn9YEbE9554Sw==", "dependencies": { - "browserslist": "^4.21.4", + "browserslist": "^4.23.0", "caniuse-api": "^3.0.0", - "colord": "^2.9.1", + "colord": "^2.9.3", "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-convert-values": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-5.1.3.tgz", - "integrity": "sha512-82pC1xkJZtcJEfiLw6UXnXVXScgtBrjlO5CBmuDQc+dlb88ZYheFsjTn40+zBVi3DkfF7iezO0nJUPLcJK3pvA==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-6.1.0.tgz", + "integrity": "sha512-zx8IwP/ts9WvUM6NkVSkiU902QZL1bwPhaVaLynPtCsOTqp+ZKbNi+s6XJg3rfqpKGA/oc7Oxk5t8pOQJcwl/w==", "dependencies": { - "browserslist": "^4.21.4", + "browserslist": "^4.23.0", "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-discard-comments": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-5.1.2.tgz", - "integrity": "sha512-+L8208OVbHVF2UQf1iDmRcbdjJkuBF6IS29yBDSiWUIzpYaAhtNl6JYnYm12FnkeCwQqF5LeklOu6rAqgfBZqQ==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-6.0.2.tgz", + "integrity": "sha512-65w/uIqhSBBfQmYnG92FO1mWZjJ4GL5b8atm5Yw2UgrwD7HiNiSSNwJor1eCFGzUgYnN/iIknhNRVqjrrpuglw==", "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-discard-duplicates": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-5.1.0.tgz", - "integrity": "sha512-zmX3IoSI2aoenxHV6C7plngHWWhUOV3sP1T8y2ifzxzbtnuhk1EdPwm0S1bIUNaJ2eNbWeGLEwzw8huPD67aQw==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-6.0.3.tgz", + "integrity": "sha512-+JA0DCvc5XvFAxwx6f/e68gQu/7Z9ud584VLmcgto28eB8FqSFZwtrLwB5Kcp70eIoWP/HXqz4wpo8rD8gpsTw==", "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-discard-empty": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-5.1.1.tgz", - "integrity": "sha512-zPz4WljiSuLWsI0ir4Mcnr4qQQ5e1Ukc3i7UfE2XcrwKK2LIPIqE5jxMRxO6GbI3cv//ztXDsXwEWT3BHOGh3A==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-6.0.3.tgz", + "integrity": "sha512-znyno9cHKQsK6PtxL5D19Fj9uwSzC2mB74cpT66fhgOadEUPyXFkbgwm5tvc3bt3NAy8ltE5MrghxovZRVnOjQ==", "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-discard-overridden": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-5.1.0.tgz", - "integrity": "sha512-21nOL7RqWR1kasIVdKs8HNqQJhFxLsyRfAnUDm4Fe4t4mCWL9OJiHvlHPjcd8zc5Myu89b/7wZDnOSjFgeWRtw==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-6.0.2.tgz", + "integrity": "sha512-j87xzI4LUggC5zND7KdjsI25APtyMuynXZSujByMaav2roV6OZX+8AaCUcZSWqckZpjAjRyFDdpqybgjFO0HJQ==", "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-discard-unused": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-discard-unused/-/postcss-discard-unused-5.1.0.tgz", - "integrity": "sha512-KwLWymI9hbwXmJa0dkrzpRbSJEh0vVUd7r8t0yOGPcfKzyJJxFM8kLyC5Ev9avji6nY95pOp1W6HqIrfT+0VGw==", + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/postcss-discard-unused/-/postcss-discard-unused-6.0.5.tgz", + "integrity": "sha512-wHalBlRHkaNnNwfC8z+ppX57VhvS+HWgjW508esjdaEYr3Mx7Gnn2xA4R/CKf5+Z9S5qsqC+Uzh4ueENWwCVUA==", "dependencies": { - "postcss-selector-parser": "^6.0.5" + "postcss-selector-parser": "^6.0.16" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-loader": { @@ -12144,136 +12148,111 @@ "webpack": "^5.0.0" } }, - "node_modules/postcss-loader/node_modules/cosmiconfig": { - "version": "8.3.6", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.3.6.tgz", - "integrity": "sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==", - "dependencies": { - "import-fresh": "^3.3.0", - "js-yaml": "^4.1.0", - "parse-json": "^5.2.0", - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/d-fischer" - }, - "peerDependencies": { - "typescript": ">=4.9.5" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, "node_modules/postcss-merge-idents": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/postcss-merge-idents/-/postcss-merge-idents-5.1.1.tgz", - "integrity": "sha512-pCijL1TREiCoog5nQp7wUe+TUonA2tC2sQ54UGeMmryK3UFGIYKqDyjnqd6RcuI4znFn9hWSLNN8xKE/vWcUQw==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/postcss-merge-idents/-/postcss-merge-idents-6.0.3.tgz", + "integrity": "sha512-1oIoAsODUs6IHQZkLQGO15uGEbK3EAl5wi9SS8hs45VgsxQfMnxvt+L+zIr7ifZFIH14cfAeVe2uCTa+SPRa3g==", "dependencies": { - "cssnano-utils": "^3.1.0", + "cssnano-utils": "^4.0.2", "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-merge-longhand": { - "version": "5.1.7", - "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-5.1.7.tgz", - "integrity": "sha512-YCI9gZB+PLNskrK0BB3/2OzPnGhPkBEwmwhfYk1ilBHYVAZB7/tkTHFBAnCrvBBOmeYyMYw3DMjT55SyxMBzjQ==", + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-6.0.5.tgz", + "integrity": "sha512-5LOiordeTfi64QhICp07nzzuTDjNSO8g5Ksdibt44d+uvIIAE1oZdRn8y/W5ZtYgRH/lnLDlvi9F8btZcVzu3w==", "dependencies": { "postcss-value-parser": "^4.2.0", - "stylehacks": "^5.1.1" + "stylehacks": "^6.1.1" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-merge-rules": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-5.1.4.tgz", - "integrity": "sha512-0R2IuYpgU93y9lhVbO/OylTtKMVcHb67zjWIfCiKR9rWL3GUk1677LAqD/BcHizukdZEjT8Ru3oHRoAYoJy44g==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-6.1.1.tgz", + "integrity": "sha512-KOdWF0gju31AQPZiD+2Ar9Qjowz1LTChSjFFbS+e2sFgc4uHOp3ZvVX4sNeTlk0w2O31ecFGgrFzhO0RSWbWwQ==", "dependencies": { - "browserslist": "^4.21.4", + "browserslist": "^4.23.0", "caniuse-api": "^3.0.0", - "cssnano-utils": "^3.1.0", - "postcss-selector-parser": "^6.0.5" + "cssnano-utils": "^4.0.2", + "postcss-selector-parser": "^6.0.16" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-minify-font-values": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-5.1.0.tgz", - "integrity": "sha512-el3mYTgx13ZAPPirSVsHqFzl+BBBDrXvbySvPGFnQcTI4iNslrPaFq4muTkLZmKlGk4gyFAYUBMH30+HurREyA==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-6.1.0.tgz", + "integrity": "sha512-gklfI/n+9rTh8nYaSJXlCo3nOKqMNkxuGpTn/Qm0gstL3ywTr9/WRKznE+oy6fvfolH6dF+QM4nCo8yPLdvGJg==", "dependencies": { "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-minify-gradients": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-5.1.1.tgz", - "integrity": "sha512-VGvXMTpCEo4qHTNSa9A0a3D+dxGFZCYwR6Jokk+/3oB6flu2/PnPXAh2x7x52EkY5xlIHLm+Le8tJxe/7TNhzw==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-6.0.3.tgz", + "integrity": "sha512-4KXAHrYlzF0Rr7uc4VrfwDJ2ajrtNEpNEuLxFgwkhFZ56/7gaE4Nr49nLsQDZyUe+ds+kEhf+YAUolJiYXF8+Q==", "dependencies": { - "colord": "^2.9.1", - "cssnano-utils": "^3.1.0", + "colord": "^2.9.3", + "cssnano-utils": "^4.0.2", "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-minify-params": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-5.1.4.tgz", - "integrity": "sha512-+mePA3MgdmVmv6g+30rn57USjOGSAyuxUmkfiWpzalZ8aiBkdPYjXWtHuwJGm1v5Ojy0Z0LaSYhHaLJQB0P8Jw==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-6.1.0.tgz", + "integrity": "sha512-bmSKnDtyyE8ujHQK0RQJDIKhQ20Jq1LYiez54WiaOoBtcSuflfK3Nm596LvbtlFcpipMjgClQGyGr7GAs+H1uA==", "dependencies": { - "browserslist": "^4.21.4", - "cssnano-utils": "^3.1.0", + "browserslist": "^4.23.0", + "cssnano-utils": "^4.0.2", "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-minify-selectors": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-5.2.1.tgz", - "integrity": "sha512-nPJu7OjZJTsVUmPdm2TcaiohIwxP+v8ha9NehQ2ye9szv4orirRU3SDdtUmKH+10nzn0bAyOXZ0UEr7OpvLehg==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-6.0.4.tgz", + "integrity": "sha512-L8dZSwNLgK7pjTto9PzWRoMbnLq5vsZSTu8+j1P/2GB8qdtGQfn+K1uSvFgYvgh83cbyxT5m43ZZhUMTJDSClQ==", "dependencies": { - "postcss-selector-parser": "^6.0.5" + "postcss-selector-parser": "^6.0.16" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-modules-extract-imports": { @@ -12332,192 +12311,191 @@ } }, "node_modules/postcss-normalize-charset": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-5.1.0.tgz", - "integrity": "sha512-mSgUJ+pd/ldRGVx26p2wz9dNZ7ji6Pn8VWBajMXFf8jk7vUoSrZ2lt/wZR7DtlZYKesmZI680qjr2CeFF2fbUg==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-6.0.2.tgz", + "integrity": "sha512-a8N9czmdnrjPHa3DeFlwqst5eaL5W8jYu3EBbTTkI5FHkfMhFZh1EGbku6jhHhIzTA6tquI2P42NtZ59M/H/kQ==", "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-normalize-display-values": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-5.1.0.tgz", - "integrity": "sha512-WP4KIM4o2dazQXWmFaqMmcvsKmhdINFblgSeRgn8BJ6vxaMyaJkwAzpPpuvSIoG/rmX3M+IrRZEz2H0glrQNEA==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-6.0.2.tgz", + "integrity": "sha512-8H04Mxsb82ON/aAkPeq8kcBbAtI5Q2a64X/mnRRfPXBq7XeogoQvReqxEfc0B4WPq1KimjezNC8flUtC3Qz6jg==", "dependencies": { "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-normalize-positions": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-5.1.1.tgz", - "integrity": "sha512-6UpCb0G4eofTCQLFVuI3EVNZzBNPiIKcA1AKVka+31fTVySphr3VUgAIULBhxZkKgwLImhzMR2Bw1ORK+37INg==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-6.0.2.tgz", + "integrity": "sha512-/JFzI441OAB9O7VnLA+RtSNZvQ0NCFZDOtp6QPFo1iIyawyXg0YI3CYM9HBy1WvwCRHnPep/BvI1+dGPKoXx/Q==", "dependencies": { "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-normalize-repeat-style": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-5.1.1.tgz", - "integrity": "sha512-mFpLspGWkQtBcWIRFLmewo8aC3ImN2i/J3v8YCFUwDnPu3Xz4rLohDO26lGjwNsQxB3YF0KKRwspGzE2JEuS0g==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-6.0.2.tgz", + "integrity": "sha512-YdCgsfHkJ2jEXwR4RR3Tm/iOxSfdRt7jplS6XRh9Js9PyCR/aka/FCb6TuHT2U8gQubbm/mPmF6L7FY9d79VwQ==", "dependencies": { "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-normalize-string": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-5.1.0.tgz", - "integrity": "sha512-oYiIJOf4T9T1N4i+abeIc7Vgm/xPCGih4bZz5Nm0/ARVJ7K6xrDlLwvwqOydvyL3RHNf8qZk6vo3aatiw/go3w==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-6.0.2.tgz", + "integrity": "sha512-vQZIivlxlfqqMp4L9PZsFE4YUkWniziKjQWUtsxUiVsSSPelQydwS8Wwcuw0+83ZjPWNTl02oxlIvXsmmG+CiQ==", "dependencies": { "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-normalize-timing-functions": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-5.1.0.tgz", - "integrity": "sha512-DOEkzJ4SAXv5xkHl0Wa9cZLF3WCBhF3o1SKVxKQAa+0pYKlueTpCgvkFAHfk+Y64ezX9+nITGrDZeVGgITJXjg==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-6.0.2.tgz", + "integrity": "sha512-a+YrtMox4TBtId/AEwbA03VcJgtyW4dGBizPl7e88cTFULYsprgHWTbfyjSLyHeBcK/Q9JhXkt2ZXiwaVHoMzA==", "dependencies": { "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-normalize-unicode": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-unicode/-/postcss-normalize-unicode-5.1.1.tgz", - "integrity": "sha512-qnCL5jzkNUmKVhZoENp1mJiGNPcsJCs1aaRmURmeJGES23Z/ajaln+EPTD+rBeNkSryI+2WTdW+lwcVdOikrpA==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/postcss-normalize-unicode/-/postcss-normalize-unicode-6.1.0.tgz", + "integrity": "sha512-QVC5TQHsVj33otj8/JD869Ndr5Xcc/+fwRh4HAsFsAeygQQXm+0PySrKbr/8tkDKzW+EVT3QkqZMfFrGiossDg==", "dependencies": { - "browserslist": "^4.21.4", + "browserslist": "^4.23.0", "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-normalize-url": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-5.1.0.tgz", - "integrity": "sha512-5upGeDO+PVthOxSmds43ZeMeZfKH+/DKgGRD7TElkkyS46JXAUhMzIKiCa7BabPeIy3AQcTkXwVVN7DbqsiCew==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-6.0.2.tgz", + "integrity": "sha512-kVNcWhCeKAzZ8B4pv/DnrU1wNh458zBNp8dh4y5hhxih5RZQ12QWMuQrDgPRw3LRl8mN9vOVfHl7uhvHYMoXsQ==", "dependencies": { - "normalize-url": "^6.0.1", "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-normalize-whitespace": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-5.1.1.tgz", - "integrity": "sha512-83ZJ4t3NUDETIHTa3uEg6asWjSBYL5EdkVB0sDncx9ERzOKBVJIUeDO9RyA9Zwtig8El1d79HBp0JEi8wvGQnA==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-6.0.2.tgz", + "integrity": "sha512-sXZ2Nj1icbJOKmdjXVT9pnyHQKiSAyuNQHSgRCUgThn2388Y9cGVDR+E9J9iAYbSbLHI+UUwLVl1Wzco/zgv0Q==", "dependencies": { "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-ordered-values": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-5.1.3.tgz", - "integrity": "sha512-9UO79VUhPwEkzbb3RNpqqghc6lcYej1aveQteWY+4POIwlqkYE21HKWaLDF6lWNuqCobEAyTovVhtI32Rbv2RQ==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-6.0.2.tgz", + "integrity": "sha512-VRZSOB+JU32RsEAQrO94QPkClGPKJEL/Z9PCBImXMhIeK5KAYo6slP/hBYlLgrCjFxyqvn5VC81tycFEDBLG1Q==", "dependencies": { - "cssnano-utils": "^3.1.0", + "cssnano-utils": "^4.0.2", "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-reduce-idents": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/postcss-reduce-idents/-/postcss-reduce-idents-5.2.0.tgz", - "integrity": "sha512-BTrLjICoSB6gxbc58D5mdBK8OhXRDqud/zodYfdSi52qvDHdMwk+9kB9xsM8yJThH/sZU5A6QVSmMmaN001gIg==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/postcss-reduce-idents/-/postcss-reduce-idents-6.0.3.tgz", + "integrity": "sha512-G3yCqZDpsNPoQgbDUy3T0E6hqOQ5xigUtBQyrmq3tn2GxlyiL0yyl7H+T8ulQR6kOcHJ9t7/9H4/R2tv8tJbMA==", "dependencies": { "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-reduce-initial": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-5.1.2.tgz", - "integrity": "sha512-dE/y2XRaqAi6OvjzD22pjTUQ8eOfc6m/natGHgKFBK9DxFmIm69YmaRVQrGgFlEfc1HePIurY0TmDeROK05rIg==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-6.1.0.tgz", + "integrity": "sha512-RarLgBK/CrL1qZags04oKbVbrrVK2wcxhvta3GCxrZO4zveibqbRPmm2VI8sSgCXwoUHEliRSbOfpR0b/VIoiw==", "dependencies": { - "browserslist": "^4.21.4", + "browserslist": "^4.23.0", "caniuse-api": "^3.0.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-reduce-transforms": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-5.1.0.tgz", - "integrity": "sha512-2fbdbmgir5AvpW9RLtdONx1QoYG2/EtqpNQbFASDlixBbAYuTcJ0dECwlqNqH7VbaUnEnh8SrxOe2sRIn24XyQ==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-6.0.2.tgz", + "integrity": "sha512-sB+Ya++3Xj1WaT9+5LOOdirAxP7dJZms3GRcYheSPi1PiTMigsxHAdkrbItHxwYHr4kt1zL7mmcHstgMYT+aiA==", "dependencies": { "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-selector-parser": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.14.tgz", - "integrity": "sha512-65xXYsT40i9GyWzlHQ5ShZoK7JZdySeOozi/tz2EezDo6c04q6+ckYMeoY7idaie1qp2dT5KoYQ2yky6JuoHnA==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.1.tgz", + "integrity": "sha512-b4dlw/9V8A71rLIDsSwVmak9z2DuBUB7CA1/wSdelNEzqsjoSPeADTWNO09lpH49Diy3/JIZ2bSPB1dI3LJCHg==", "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -12527,46 +12505,46 @@ } }, "node_modules/postcss-sort-media-queries": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/postcss-sort-media-queries/-/postcss-sort-media-queries-4.4.1.tgz", - "integrity": "sha512-QDESFzDDGKgpiIh4GYXsSy6sek2yAwQx1JASl5AxBtU1Lq2JfKBljIPNdil989NcSKRQX1ToiaKphImtBuhXWw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/postcss-sort-media-queries/-/postcss-sort-media-queries-5.2.0.tgz", + "integrity": "sha512-AZ5fDMLD8SldlAYlvi8NIqo0+Z8xnXU2ia0jxmuhxAU+Lqt9K+AlmLNJ/zWEnE9x+Zx3qL3+1K20ATgNOr3fAA==", "dependencies": { - "sort-css-media-queries": "2.1.0" + "sort-css-media-queries": "2.2.0" }, "engines": { - "node": ">=10.0.0" + "node": ">=14.0.0" }, "peerDependencies": { - "postcss": "^8.4.16" + "postcss": "^8.4.23" } }, "node_modules/postcss-svgo": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-5.1.0.tgz", - "integrity": "sha512-D75KsH1zm5ZrHyxPakAxJWtkyXew5qwS70v56exwvw542d9CRtTo78K0WeFxZB4G7JXKKMbEZtZayTGdIky/eA==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-6.0.3.tgz", + "integrity": "sha512-dlrahRmxP22bX6iKEjOM+c8/1p+81asjKT+V5lrgOH944ryx/OHpclnIbGsKVd3uWOXFLYJwCVf0eEkJGvO96g==", "dependencies": { "postcss-value-parser": "^4.2.0", - "svgo": "^2.7.0" + "svgo": "^3.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >= 18" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-unique-selectors": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-5.1.1.tgz", - "integrity": "sha512-5JiODlELrz8L2HwxfPnhOWZYWDxVHWL83ufOv84NrcgipI7TaeRsatAhK4Tr2/ZiYldpK/wBvw5BD3qfaK96GA==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-6.0.4.tgz", + "integrity": "sha512-K38OCaIrO8+PzpArzkLKB42dSARtC2tmG6PvD4b1o1Q2E9Os8jzfWFfSy/rixsHwohtsDdFtAWGjFVFUdwYaMg==", "dependencies": { - "postcss-selector-parser": "^6.0.5" + "postcss-selector-parser": "^6.0.16" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-value-parser": { @@ -12575,14 +12553,14 @@ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" }, "node_modules/postcss-zindex": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-zindex/-/postcss-zindex-5.1.0.tgz", - "integrity": "sha512-fgFMf0OtVSBR1va1JNHYgMxYk73yhn/qb4uQDq1DLGYolz8gHCyr/sesEuGUaYs58E3ZJRcpoGuPVoB7Meiq9A==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-zindex/-/postcss-zindex-6.0.2.tgz", + "integrity": "sha512-5BxW9l1evPB/4ZIc+2GobEBoKC+h8gPGCMi+jxsYvd2x0mjq7wazk6DrP71pStqxE9Foxh5TVnonbWpFZzXaYg==", "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/pretty-error": { @@ -12650,9 +12628,9 @@ } }, "node_modules/property-information": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/property-information/-/property-information-6.4.0.tgz", - "integrity": "sha512-9t5qARVofg2xQqKtytzt+lZ4d1Qvj8t5B8fEwXK6qOfgRLgH/b13QlgEyDh033NOS31nXeFbYv7CLUDG1CeifQ==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-6.5.0.tgz", + "integrity": "sha512-PgTgs/BlvHxOu8QuEN7wi5A0OmXaBcHpmCSTehcs6Uuu9IkDIEo13Hy7n898RHfrQ49vKCoGeWZSaAK01nwVig==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -12987,9 +12965,9 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, "node_modules/react-json-view-lite": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/react-json-view-lite/-/react-json-view-lite-1.2.1.tgz", - "integrity": "sha512-Itc0g86fytOmKZoIoJyGgvNqohWSbh3NXIKNgH6W6FT9PC1ck4xas1tT3Rr/b3UlFXyA9Jjaw9QSXdZy2JwGMQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/react-json-view-lite/-/react-json-view-lite-1.4.0.tgz", + "integrity": "sha512-wh6F6uJyYAmQ4fK0e8dSQMEWuvTs2Wr3el3sLD9bambX1+pSWUVXIz1RFaoy3TI1mZ0FqdpKq9YgbgTTgyrmXA==", "engines": { "node": ">=14" }, @@ -12999,12 +12977,11 @@ }, "node_modules/react-loadable": { "name": "@docusaurus/react-loadable", - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/@docusaurus/react-loadable/-/react-loadable-5.5.2.tgz", - "integrity": "sha512-A3dYjdBGuy0IGT+wyLIGIKLRE+sAk1iNk0f1HjNDysO7u8lhL4N3VEm+FAubmJbAztn94F7MxBTPmnixbiyFdQ==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@docusaurus/react-loadable/-/react-loadable-6.0.0.tgz", + "integrity": "sha512-YMMxTUQV/QFSnbgrP3tjDzLHRg7vsbMn8e9HAa8o/1iXoiomo48b7sk/kkmWEuWNDPJVlKSJRB6Y2fHqdJk+SQ==", "dependencies": { - "@types/react": "*", - "prop-types": "^15.6.2" + "@types/react": "*" }, "peerDependencies": { "react": "*" @@ -13298,9 +13275,9 @@ } }, "node_modules/remark-mdx": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-mdx/-/remark-mdx-3.0.0.tgz", - "integrity": "sha512-O7yfjuC6ra3NHPbRVxfflafAj3LTwx3b73aBvkEFU5z4PsD6FD4vrqJAkE5iNGLz71GdjXfgRqm3SQ0h0VuE7g==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-mdx/-/remark-mdx-3.0.1.tgz", + "integrity": "sha512-3Pz3yPQ5Rht2pM5R+0J2MrGoBSrzf+tJG94N+t/ilfdh8YLyyKYtidAYwTveB20BoHAcwIopOUqhcmh2F7hGYA==", "dependencies": { "mdast-util-mdx": "^3.0.0", "micromark-extension-mdxjs": "^3.0.0" @@ -13326,9 +13303,9 @@ } }, "node_modules/remark-rehype": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-11.0.0.tgz", - "integrity": "sha512-vx8x2MDMcxuE4lBmQ46zYUDfcFMmvg80WYX+UNLeG6ixjdCCLcw1lrgAukwBTuOFsS78eoAedHGn9sNM0w7TPw==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-11.1.0.tgz", + "integrity": "sha512-z3tJrAs2kIs1AqIIy6pzHmAHlF1hWQ+OdY4/hv+Wxe35EhyLKcajL33iUEn3ScxtFox9nUvRufR/Zre8Q08H/g==", "dependencies": { "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", @@ -13638,9 +13615,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/sax": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.3.0.tgz", - "integrity": "sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==" + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz", + "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==" }, "node_modules/scheduler": { "version": "0.23.0", @@ -13669,9 +13646,9 @@ } }, "node_modules/search-insights": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/search-insights/-/search-insights-2.13.0.tgz", - "integrity": "sha512-Orrsjf9trHHxFRuo9/rzm0KIWmgzE8RMlZMzuhZOJ01Rnz3D0YBAe+V6473t6/H6c7irs6Lt48brULAiRWb3Vw==", + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/search-insights/-/search-insights-2.15.0.tgz", + "integrity": "sha512-ch2sPCUDD4sbPQdknVl9ALSi9H7VyoeVbsxznYz6QV55jJ8CI3EtwpO1i84keN4+hF5IeHWIeGvc08530JkVXQ==", "peer": true }, "node_modules/section-matter": { @@ -14023,9 +14000,9 @@ "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" }, "node_modules/sitemap": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/sitemap/-/sitemap-7.1.1.tgz", - "integrity": "sha512-mK3aFtjz4VdJN0igpIJrinf3EO8U8mxOPsTBzSsy06UtjZQJ3YY3o3Xa7zSc5nMqcMrRwlChHZ18Kxg0caiPBg==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/sitemap/-/sitemap-7.1.2.tgz", + "integrity": "sha512-ARCqzHJ0p4gWt+j7NlU5eDlIO9+Rkr/JhPFZKKQ1l5GCus7rJH4UdrlVAh0xC/gDS/Qir2UMxqYNHtsKr2rpCw==", "dependencies": { "@types/node": "^17.0.5", "@types/sax": "^1.2.1", @@ -14064,6 +14041,15 @@ "node": ">=8" } }, + "node_modules/snake-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", + "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", + "dependencies": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, "node_modules/sockjs": { "version": "0.3.24", "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.24.tgz", @@ -14075,9 +14061,9 @@ } }, "node_modules/sort-css-media-queries": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/sort-css-media-queries/-/sort-css-media-queries-2.1.0.tgz", - "integrity": "sha512-IeWvo8NkNiY2vVYdPa27MCQiR0MN0M80johAYFVxWWXQ44KU84WNxjslwBHmc/7ZL2ccwkM7/e6S5aiKZXm7jA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/sort-css-media-queries/-/sort-css-media-queries-2.2.0.tgz", + "integrity": "sha512-0xtkGhWCC9MGt/EzgnvbbbKhqWjl1+/rncmhTh5qCpbYguXh6S/qwePfv/JQ8jePXXmqingylxoC49pCkSPIbA==", "engines": { "node": ">= 6.3.0" } @@ -14091,9 +14077,9 @@ } }, "node_modules/source-map-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", - "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", "engines": { "node": ">=0.10.0" } @@ -14168,12 +14154,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/stable": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", - "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==", - "deprecated": "Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility" - }, "node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", @@ -14237,9 +14217,9 @@ } }, "node_modules/stringify-entities": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.3.tgz", - "integrity": "sha512-BP9nNHMhhfcMbiuQKCqMjhDP5yBCAxsPu4pHFFzJ6Alo9dZgY4VLDPutXqIjpRiMoKdp7Av85Gr73Q5uH9k7+g==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz", + "integrity": "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==", "dependencies": { "character-entities-html4": "^2.0.0", "character-entities-legacy": "^3.0.0" @@ -14309,18 +14289,18 @@ } }, "node_modules/stylehacks": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-5.1.1.tgz", - "integrity": "sha512-sBpcd5Hx7G6seo7b1LkpttvTz7ikD0LlH5RmdcBNb6fFR0Fl7LQwHDFr300q4cwUqi+IYrFGmsIHieMBfnN/Bw==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-6.1.1.tgz", + "integrity": "sha512-gSTTEQ670cJNoaeIp9KX6lZmm8LJ3jPB5yJmX8Zq/wQxOsAFXV3qjWzHas3YYk1qesuVIyYWWUpZ0vSE/dTSGg==", "dependencies": { - "browserslist": "^4.21.4", - "postcss-selector-parser": "^6.0.4" + "browserslist": "^4.23.0", + "postcss-selector-parser": "^6.0.16" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/stylis": { @@ -14356,23 +14336,27 @@ "integrity": "sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ==" }, "node_modules/svgo": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-2.8.0.tgz", - "integrity": "sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-3.3.2.tgz", + "integrity": "sha512-OoohrmuUlBs8B8o6MB2Aevn+pRIH9zDALSR+6hhqVfa6fRwG/Qw9VUMSMW9VNg2CFc/MTIfabtdOVl9ODIJjpw==", "dependencies": { "@trysound/sax": "0.2.0", "commander": "^7.2.0", - "css-select": "^4.1.3", - "css-tree": "^1.1.3", - "csso": "^4.2.0", - "picocolors": "^1.0.0", - "stable": "^0.1.8" + "css-select": "^5.1.0", + "css-tree": "^2.3.1", + "css-what": "^6.1.0", + "csso": "^5.0.5", + "picocolors": "^1.0.0" }, "bin": { "svgo": "bin/svgo" }, "engines": { - "node": ">=10.13.0" + "node": ">=14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/svgo" } }, "node_modules/svgo/node_modules/commander": { @@ -14383,69 +14367,6 @@ "node": ">= 10" } }, - "node_modules/svgo/node_modules/css-select": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.3.0.tgz", - "integrity": "sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==", - "dependencies": { - "boolbase": "^1.0.0", - "css-what": "^6.0.1", - "domhandler": "^4.3.1", - "domutils": "^2.8.0", - "nth-check": "^2.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, - "node_modules/svgo/node_modules/dom-serializer": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.4.1.tgz", - "integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==", - "dependencies": { - "domelementtype": "^2.0.1", - "domhandler": "^4.2.0", - "entities": "^2.0.0" - }, - "funding": { - "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" - } - }, - "node_modules/svgo/node_modules/domhandler": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz", - "integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==", - "dependencies": { - "domelementtype": "^2.2.0" - }, - "engines": { - "node": ">= 4" - }, - "funding": { - "url": "https://github.com/fb55/domhandler?sponsor=1" - } - }, - "node_modules/svgo/node_modules/domutils": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz", - "integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==", - "dependencies": { - "dom-serializer": "^1.0.1", - "domelementtype": "^2.2.0", - "domhandler": "^4.2.0" - }, - "funding": { - "url": "https://github.com/fb55/domutils?sponsor=1" - } - }, - "node_modules/svgo/node_modules/entities": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", - "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, "node_modules/tapable": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", @@ -14646,9 +14567,9 @@ } }, "node_modules/trough": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/trough/-/trough-2.1.0.tgz", - "integrity": "sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.2.0.tgz", + "integrity": "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -14780,9 +14701,9 @@ } }, "node_modules/unified": { - "version": "11.0.4", - "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", - "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "version": "11.0.5", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz", + "integrity": "sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==", "dependencies": { "@types/unist": "^3.0.0", "bail": "^2.0.0", @@ -14916,9 +14837,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.0.13", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", - "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz", + "integrity": "sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==", "funding": [ { "type": "opencollective", @@ -14934,8 +14855,8 @@ } ], "dependencies": { - "escalade": "^3.1.1", - "picocolors": "^1.0.0" + "escalade": "^3.1.2", + "picocolors": "^1.0.1" }, "bin": { "update-browserslist-db": "cli.js" @@ -15131,9 +15052,9 @@ "integrity": "sha512-Z0DbgELS9/L/75wZbro8xAnT50pBVFQZ+hUEueGDU5FN51YSCYM+jdxsfCiHjwNP/4LCDD0i/graKpeBnOXKRA==" }, "node_modules/utility-types": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/utility-types/-/utility-types-3.10.0.tgz", - "integrity": "sha512-O11mqxmi7wMKCo6HKFt5AhO4BwY3VV68YU07tgxfz8zJTIxr4BpsezN49Ffwy9j3ZpwwJp4fkRwjRzq3uWE6Rg==", + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/utility-types/-/utility-types-3.11.0.tgz", + "integrity": "sha512-6Z7Ma2aVEWisaL6TvBCy7P8rm2LQoPv6dJ7ecIaIixHcwfbJ0x7mWdbcwlIM5IGQxPZSFYeqRCqlOOeKoJYMkw==", "engines": { "node": ">= 4" } diff --git a/docs/package.json b/docs/package.json index 21aef7d..f12e34e 100644 --- a/docs/package.json +++ b/docs/package.json @@ -14,9 +14,9 @@ "write-heading-ids": "docusaurus write-heading-ids" }, "dependencies": { - "@docusaurus/core": "3.0.1", - "@docusaurus/preset-classic": "3.0.1", - "@docusaurus/theme-mermaid": "^3.0.1", + "@docusaurus/core": "^3.4.0", + "@docusaurus/preset-classic": "^3.4.0", + "@docusaurus/theme-mermaid": "^3.4.0", "@mdx-js/react": "^3.0.0", "clsx": "^2.0.0", "prism-react-renderer": "^2.3.0", @@ -24,8 +24,8 @@ "react-dom": "^18.0.0" }, "devDependencies": { - "@docusaurus/module-type-aliases": "3.0.1", - "@docusaurus/types": "3.0.1" + "@docusaurus/module-type-aliases": "^3.4.0", + "@docusaurus/types": "^3.4.0" }, "browserslist": { "production": [ diff --git a/docs/src/pages/index.js b/docs/src/pages/index.js index 349602d..bf32e07 100644 --- a/docs/src/pages/index.js +++ b/docs/src/pages/index.js @@ -19,7 +19,7 @@ function HomepageHeader() {
+ to="/intro"> Getting Started
-- 2.47.2 From dc9f79959a2f075a6c90f09109a2f051ded76b28 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 13 Jul 2024 18:32:04 +0530 Subject: [PATCH 024/101] Updated logback-classic version Signed-off-by: Amith Koujalgi --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fdaab96..5b70591 100644 --- a/pom.xml +++ b/pom.xml @@ -161,7 +161,7 @@ ch.qos.logback logback-classic - 1.4.12 + 1.5.6 test -- 2.47.2 From db8b73075b3046f8f2e6100922852585b32bddcd Mon Sep 17 00:00:00 2001 From: "koujalgi.amith@gmail.com" Date: Sat, 13 Jul 2024 18:33:51 +0530 Subject: [PATCH 025/101] clean up Signed-off-by: koujalgi.amith@gmail.com --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 5b70591..7833be4 100644 --- a/pom.xml +++ b/pom.xml @@ -72,6 +72,7 @@
+ -- 2.47.2 From 16634e60e46bf2d6f70efa89700192f7a4df9db9 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 13 Jul 2024 18:34:51 +0530 Subject: [PATCH 026/101] clean up Signed-off-by: koujalgi.amith@gmail.com --- pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7833be4..5b70591 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,6 @@ - -- 2.47.2 From 006b52f3db22da13e96a9785a7eed638d04b32dc Mon Sep 17 00:00:00 2001 From: "koujalgi.amith@gmail.com" Date: Sat, 13 Jul 2024 19:03:12 +0530 Subject: [PATCH 027/101] updated README.md Signed-off-by: koujalgi.amith@gmail.com --- README.md | 64 +++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 55 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 46c77da..129dae5 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,8 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). - [How does it work?](#how-does-it-work) - [Requirements](#requirements) - [Installation](#installation) -- [API Spec](#api-spec) +- [API Spec](https://amithkoujalgi.github.io/ollama4j/docs/category/apis---model-management) +- [Javadoc Spec](https://amithkoujalgi.github.io/ollama4j/apidocs/) - [Demo APIs](#try-out-the-apis-with-ollama-server) - [Development](#development) - [Contributions](#get-involved) @@ -74,25 +75,66 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). #### Installation -In your Maven project, add this dependency: +For latest release version, check [here](https://github.com/amithkoujalgi/ollama4j/releases). + +##### For Maven + +1. In your Maven project, add this dependency: ```xml io.github.amithkoujalgi ollama4j - 1.0.70 + v1.0.74 ``` -or +2. Add repository to your project's pom.xml: + +```xml + + + + github + GitHub Apache Maven Packages + https://maven.pkg.github.com/amithkoujalgi/ollama4j + + true + + + true + + + +``` + +3. Add GitHub server to settings.xml. (Usually available at ~/.m2/settings.xml) + +```xml + + + + + github + USERNAME + TOKEN + + + +``` + +##### For Gradle In your Gradle project, add the dependency using the Kotlin DSL or the Groovy DSL: ```kotlin dependencies { - val ollama4jVersion = "1.0.70" + val ollama4jVersion = "1.0.74" implementation("io.github.amithkoujalgi:ollama4j:$ollama4jVersion") } @@ -100,15 +142,19 @@ dependencies { ```groovy dependencies { - implementation("io.github.amithkoujalgi:ollama4j:1.0.70") + implementation("io.github.amithkoujalgi:ollama4j:1.0.74") } ``` -Latest release: +[//]: # (Latest release:) -![Maven Central](https://img.shields.io/maven-central/v/io.github.amithkoujalgi/ollama4j) +[//]: # () -[![][lib-shield]][lib] +[//]: # (![Maven Central](https://img.shields.io/maven-central/v/io.github.amithkoujalgi/ollama4j)) + +[//]: # () + +[//]: # ([![][lib-shield]][lib]) [lib]: https://central.sonatype.com/artifact/io.github.amithkoujalgi/ollama4j -- 2.47.2 From 81f564ef7f09c43f8162e9895e69f045b833a312 Mon Sep 17 00:00:00 2001 From: "koujalgi.amith@gmail.com" Date: Sat, 13 Jul 2024 19:05:01 +0530 Subject: [PATCH 028/101] updated README.md Signed-off-by: koujalgi.amith@gmail.com --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 129dae5..a6c92b9 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,6 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). - [Installation](#installation) - [API Spec](https://amithkoujalgi.github.io/ollama4j/docs/category/apis---model-management) - [Javadoc Spec](https://amithkoujalgi.github.io/ollama4j/apidocs/) -- [Demo APIs](#try-out-the-apis-with-ollama-server) - [Development](#development) - [Contributions](#get-involved) - [References](#references) -- 2.47.2 From b0bb082beccd4afe819af945a42f74661e62ffdd Mon Sep 17 00:00:00 2001 From: "koujalgi.amith@gmail.com" Date: Sat, 13 Jul 2024 19:06:11 +0530 Subject: [PATCH 029/101] updated README.md Signed-off-by: koujalgi.amith@gmail.com --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index a6c92b9..ba45d21 100644 --- a/README.md +++ b/README.md @@ -212,6 +212,9 @@ Actions CI workflow. - [x] Use lombok - [x] Update request body creation with Java objects - [ ] Async APIs for images +- [ ] Support for function calling with models like Mistral + - [x] generate in sync mode + - [ ] generate in async mode - [ ] Add custom headers to requests - [x] Add additional params for `ask` APIs such as: - [x] `options`: additional model parameters for the Modelfile such as `temperature` - -- 2.47.2 From bd2da8fdda4e8897ee1fe123b2214d753bc7f8c5 Mon Sep 17 00:00:00 2001 From: "koujalgi.amith@gmail.com" Date: Sat, 13 Jul 2024 19:06:40 +0530 Subject: [PATCH 030/101] updated README.md Signed-off-by: koujalgi.amith@gmail.com --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ba45d21..daca97a 100644 --- a/README.md +++ b/README.md @@ -119,8 +119,8 @@ For latest release version, check [here](https://github.com/amithkoujalgi/ollama github - USERNAME - TOKEN + YOUR-USERNAME + YOUR-TOKEN -- 2.47.2 From 10eb803e265fb7dc809405d8cc42a357bf831a9c Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 13 Jul 2024 13:46:43 +0530 Subject: [PATCH 031/101] Updated README.md Signed-off-by: Amith Koujalgi --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index daca97a..9f6603a 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,9 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). #### Installation -For latest release version, check [here](https://github.com/amithkoujalgi/ollama4j/releases). +Check the releases [here](https://github.com/amithkoujalgi/ollama4j/releases). + +![GitHub Release](https://img.shields.io/github/v/release/amithkoujalgi/ollama4j) ##### For Maven -- 2.47.2 From a05052e0952ebf93bd18838fa3fda4d18c25f28e Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 13 Jul 2024 13:47:08 +0530 Subject: [PATCH 032/101] Updated README.md Signed-off-by: Amith Koujalgi --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9f6603a..9c78f26 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). ![Build Status](https://github.com/amithkoujalgi/ollama4j/actions/workflows/maven-publish.yml/badge.svg) + [//]: # (![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Famithkoujalgi%2Follama4j&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false)) -- 2.47.2 From e85aeae6e039b50f9e2faa20287777eaef5b5ded Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 13 Jul 2024 14:02:50 +0530 Subject: [PATCH 033/101] Updated README.md Signed-off-by: Amith Koujalgi --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9c78f26..6ba9012 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ Check the releases [here](https://github.com/amithkoujalgi/ollama4j/releases). io.github.amithkoujalgi ollama4j - v1.0.74 + 1.0.74 ``` -- 2.47.2 From 7c233d573439c9f6d6a176a7d72d1493d428ff1d Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 13 Jul 2024 14:09:01 +0530 Subject: [PATCH 034/101] Updated README.md Signed-off-by: Amith Koujalgi --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6ba9012..b8009f7 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). Check the releases [here](https://github.com/amithkoujalgi/ollama4j/releases). -![GitHub Release](https://img.shields.io/github/v/release/amithkoujalgi/ollama4j) +![GitHub Release](https://img.shields.io/github/v/release/amithkoujalgi/ollama4j?include_prereleases&display_name=release&label=Latest%20Release&link=https%3A%2F%2Fgithub.com%2Famithkoujalgi%2Follama4j%2Freleases) ##### For Maven -- 2.47.2 From 9b5ddbf4c46f615a60bdb22dd1c77721942a29a7 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 13 Jul 2024 14:10:52 +0530 Subject: [PATCH 035/101] Updated README.md Signed-off-by: Amith Koujalgi --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b8009f7..c739dff 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). Check the releases [here](https://github.com/amithkoujalgi/ollama4j/releases). -![GitHub Release](https://img.shields.io/github/v/release/amithkoujalgi/ollama4j?include_prereleases&display_name=release&label=Latest%20Release&link=https%3A%2F%2Fgithub.com%2Famithkoujalgi%2Follama4j%2Freleases) +![GitHub Release](https://img.shields.io/github/v/release/amithkoujalgi/ollama4j?include_prereleases&display_name=release&style=for-the-badge&label=Latest%20Release&link=https%3A%2F%2Fgithub.com%2Famithkoujalgi%2Follama4j%2Freleases) ##### For Maven -- 2.47.2 From 5a936d8174afb4ebf235f20ac5221e3acc88a889 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 13 Jul 2024 14:18:01 +0530 Subject: [PATCH 036/101] Updated README.md Signed-off-by: Amith Koujalgi --- README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c739dff..f6021eb 100644 --- a/README.md +++ b/README.md @@ -63,9 +63,9 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). ![Java](https://img.shields.io/badge/Java-11_+-green.svg?style=just-the-message&labelColor=gray) -[![][ollama-shield]][ollama] **Or** [![][ollama-docker-shield]][ollama-docker] +[![][ollama-shield]][ollama-link] **Or** [![][ollama-docker-shield]][ollama-docker] -[ollama]: https://ollama.ai/ +[ollama-link]: https://ollama.ai/ [ollama-shield]: https://img.shields.io/badge/Ollama-Local_Installation-blue.svg?style=just-the-message&labelColor=gray @@ -75,9 +75,14 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). #### Installation -Check the releases [here](https://github.com/amithkoujalgi/ollama4j/releases). +Check the releases [here](https://github.com/amithkoujalgi/ollama4j/releases) and update the dependency version +according to your requirements. -![GitHub Release](https://img.shields.io/github/v/release/amithkoujalgi/ollama4j?include_prereleases&display_name=release&style=for-the-badge&label=Latest%20Release&link=https%3A%2F%2Fgithub.com%2Famithkoujalgi%2Follama4j%2Freleases) +[![][ollama4j-releases-shield]][ollama4j-releases-link] + +[ollama4j-releases-link]: https://github.com/amithkoujalgi/ollama4j/releases + +[ollama4j-releases-shield]: https://img.shields.io/github/v/release/amithkoujalgi/ollama4j?include_prereleases&display_name=release&style=for-the-badge&label=Latest%20Release ##### For Maven -- 2.47.2 From c8f27edd6e02773bb1e52b0cd05e5a917ca36aa9 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 13 Jul 2024 14:19:44 +0530 Subject: [PATCH 037/101] Updated README.md Signed-off-by: Amith Koujalgi --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f6021eb..99ce74e 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). - [Requirements](#requirements) - [Installation](#installation) - [API Spec](https://amithkoujalgi.github.io/ollama4j/docs/category/apis---model-management) -- [Javadoc Spec](https://amithkoujalgi.github.io/ollama4j/apidocs/) +- [Javadoc](https://amithkoujalgi.github.io/ollama4j/apidocs/) - [Development](#development) - [Contributions](#get-involved) - [References](#references) -- 2.47.2 From b8a13e89b159c3f71cb50f223ec3eb93c2ba9e1e Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 13 Jul 2024 14:22:08 +0530 Subject: [PATCH 038/101] Updated README.md Signed-off-by: Amith Koujalgi --- .github/workflows/publish-docs.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index 7e2d351..8d63cda 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -46,6 +46,13 @@ jobs: - run: cd docs && npm ci - run: cd docs && npm run build + - name: Find and Replace + uses: jacobtomlinson/gha-find-replace@v3 + with: + find: "ollama4j-revision" + replace: ${{ github.ref_name }} + regex: false + - name: Build with Maven run: mvn --file pom.xml -U clean package && cp -r ./target/apidocs/. ./docs/build/apidocs -- 2.47.2 From fd32aa33ff0d8f9d3edc09bcc34fb507c642e067 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 13 Jul 2024 14:30:13 +0530 Subject: [PATCH 039/101] Updated README.md Signed-off-by: Amith Koujalgi --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 99ce74e..39fbef6 100644 --- a/README.md +++ b/README.md @@ -91,8 +91,8 @@ according to your requirements. ```xml - io.github.amithkoujalgi - ollama4j + io.github.amithkoujalgi + ollama4j 1.0.74 ``` -- 2.47.2 From fed89a96431097c85c7bb22b2c65922508f50638 Mon Sep 17 00:00:00 2001 From: "koujalgi.amith@gmail.com" Date: Sat, 13 Jul 2024 21:49:26 +0530 Subject: [PATCH 040/101] updated README.md Signed-off-by: koujalgi.amith@gmail.com --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 39fbef6..4dbd4cf 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,10 @@ ### Ollama4j -ollama4j-icon +

+ ollama4j-icon +

+ A Java library (wrapper/binding) for [Ollama](https://ollama.ai/) server. @@ -91,9 +94,9 @@ according to your requirements. ```xml - io.github.amithkoujalgi - ollama4j - 1.0.74 + io.github.amithkoujalgi + ollama4j + 1.0.74 ``` -- 2.47.2 From af1b213a762f2f39a17837f89d5e2e67b6a1d3cc Mon Sep 17 00:00:00 2001 From: "koujalgi.amith@gmail.com" Date: Sat, 13 Jul 2024 21:50:45 +0530 Subject: [PATCH 041/101] updated README.md Signed-off-by: koujalgi.amith@gmail.com --- README.md | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 4dbd4cf..064e56c 100644 --- a/README.md +++ b/README.md @@ -254,19 +254,16 @@ of contribution is much appreciated. The nomenclature and the icon have been adopted from the incredible [Ollama](https://ollama.ai/) project. - -
- **Thanks to the amazing contributors** - - - +

+ + + +

### Appreciate my work? -Buy Me A Coffee - - -
- +

+ Buy Me A Coffee +

\ No newline at end of file -- 2.47.2 From 383d0f56ca8668f01230de774fcc1d6f55c90108 Mon Sep 17 00:00:00 2001 From: "koujalgi.amith@gmail.com" Date: Sat, 13 Jul 2024 23:54:49 +0530 Subject: [PATCH 042/101] Updated `generateAsync()` API Signed-off-by: koujalgi.amith@gmail.com --- docs/docs/apis-generate/generate-async.md | 48 +++--- .../generate-with-image-files.md | 4 +- .../apis-generate/generate-with-image-urls.md | 4 +- .../docs/apis-generate/generate-with-tools.md | 4 +- docs/docs/apis-generate/generate.md | 4 +- .../ollama4j/core/OllamaAPI.java | 46 ++++-- .../ollama4j/core/OllamaResultStream.java | 18 +++ .../models/OllamaAsyncResultCallback.java | 143 ------------------ .../models/OllamaAsyncResultStreamer.java | 124 +++++++++++++++ .../ollama4j/unittests/TestMockedAPIs.java | 4 +- 10 files changed, 208 insertions(+), 191 deletions(-) create mode 100644 src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaResultStream.java delete mode 100644 src/main/java/io/github/amithkoujalgi/ollama4j/core/models/OllamaAsyncResultCallback.java create mode 100644 src/main/java/io/github/amithkoujalgi/ollama4j/core/models/OllamaAsyncResultStreamer.java diff --git a/docs/docs/apis-generate/generate-async.md b/docs/docs/apis-generate/generate-async.md index 49f556f..d5c1c27 100644 --- a/docs/docs/apis-generate/generate-async.md +++ b/docs/docs/apis-generate/generate-async.md @@ -1,42 +1,46 @@ --- -sidebar_position: 3 +sidebar_position: 2 --- # Generate - Async This API lets you ask questions to the LLMs in a asynchronous way. -These APIs correlate to -the [completion](https://github.com/jmorganca/ollama/blob/main/docs/api.md#generate-a-completion) APIs. +This is particularly helpful when you want to issue a generate request to the LLM and collect the response in the +background (such as threads) without blocking your code until the response arrives from the model. + +This API corresponds to +the [completion](https://github.com/jmorganca/ollama/blob/main/docs/api.md#generate-a-completion) API. ```java public class Main { - public static void main(String[] args) { - + public static void main(String[] args) throws Exception { String host = "http://localhost:11434/"; - OllamaAPI ollamaAPI = new OllamaAPI(host); + ollamaAPI.setRequestTimeoutSeconds(60); + String prompt = "List all cricket world cup teams of 2019."; + OllamaAsyncResultStreamer streamer = ollamaAPI.generateAsync(OllamaModelType.LLAMA3, prompt, false); - String prompt = "Who are you?"; + // Set the poll interval according to your needs. + // Smaller the poll interval, more frequently you receive the token. + int pollIntervalMilliseconds = 1000; - OllamaAsyncResultCallback callback = ollamaAPI.generateAsync(OllamaModelType.LLAMA2, prompt); - - while (!callback.isComplete() || !callback.getStream().isEmpty()) { - // poll for data from the response stream - String result = callback.getStream().poll(); - if (result != null) { - System.out.print(result); + while (true) { + String tokens = streamer.getStream().poll(); + System.out.print(tokens); + if (!streamer.isAlive()) { + break; } - Thread.sleep(100); + Thread.sleep(pollIntervalMilliseconds); } + + System.out.println("\n------------------------"); + System.out.println("Complete Response:"); + System.out.println("------------------------"); + + System.out.println(streamer.getResult()); } } ``` -You will get a response similar to: - -> I am LLaMA, an AI assistant developed by Meta AI that can understand and respond to human input in a conversational -> manner. I am trained on a massive dataset of text from the internet and can generate human-like responses to a wide -> range of topics and questions. I can be used to create chatbots, virtual assistants, and other applications that -> require -> natural language understanding and generation capabilities. \ No newline at end of file +You will get a steaming response. \ No newline at end of file diff --git a/docs/docs/apis-generate/generate-with-image-files.md b/docs/docs/apis-generate/generate-with-image-files.md index 4406981..1e1f9f9 100644 --- a/docs/docs/apis-generate/generate-with-image-files.md +++ b/docs/docs/apis-generate/generate-with-image-files.md @@ -5,8 +5,8 @@ sidebar_position: 4 # Generate - With Image Files This API lets you ask questions along with the image files to the LLMs. -These APIs correlate to -the [completion](https://github.com/jmorganca/ollama/blob/main/docs/api.md#generate-a-completion) APIs. +This API corresponds to +the [completion](https://github.com/jmorganca/ollama/blob/main/docs/api.md#generate-a-completion) API. :::note diff --git a/docs/docs/apis-generate/generate-with-image-urls.md b/docs/docs/apis-generate/generate-with-image-urls.md index 587e8f0..2fd3941 100644 --- a/docs/docs/apis-generate/generate-with-image-urls.md +++ b/docs/docs/apis-generate/generate-with-image-urls.md @@ -5,8 +5,8 @@ sidebar_position: 5 # Generate - With Image URLs This API lets you ask questions along with the image files to the LLMs. -These APIs correlate to -the [completion](https://github.com/jmorganca/ollama/blob/main/docs/api.md#generate-a-completion) APIs. +This API corresponds to +the [completion](https://github.com/jmorganca/ollama/blob/main/docs/api.md#generate-a-completion) API. :::note diff --git a/docs/docs/apis-generate/generate-with-tools.md b/docs/docs/apis-generate/generate-with-tools.md index 0ca142a..6b7cca6 100644 --- a/docs/docs/apis-generate/generate-with-tools.md +++ b/docs/docs/apis-generate/generate-with-tools.md @@ -1,12 +1,12 @@ --- -sidebar_position: 2 +sidebar_position: 3 --- # Generate - With Tools This API lets you perform [function calling](https://docs.mistral.ai/capabilities/function_calling/) using LLMs in a synchronous way. -This API correlates to +This API corresponds to the [generate](https://github.com/ollama/ollama/blob/main/docs/api.md#request-raw-mode) API with `raw` mode. :::note diff --git a/docs/docs/apis-generate/generate.md b/docs/docs/apis-generate/generate.md index aed106e..0469f26 100644 --- a/docs/docs/apis-generate/generate.md +++ b/docs/docs/apis-generate/generate.md @@ -5,8 +5,8 @@ sidebar_position: 1 # Generate - Sync This API lets you ask questions to the LLMs in a synchronous way. -These APIs correlate to -the [completion](https://github.com/jmorganca/ollama/blob/main/docs/api.md#generate-a-completion) APIs. +This API corresponds to +the [completion](https://github.com/jmorganca/ollama/blob/main/docs/api.md#generate-a-completion) API. Use the `OptionBuilder` to build the `Options` object with [extra parameters](https://github.com/jmorganca/ollama/blob/main/docs/modelfile.md#valid-parameters-and-values). diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaAPI.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaAPI.java index 80654ae..340fcb9 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaAPI.java +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaAPI.java @@ -360,15 +360,15 @@ public class OllamaAPI { } /** - * Convenience method to call Ollama API without streaming responses. + * Generates response using the specified AI model and prompt (in blocking mode). *

* Uses {@link #generate(String, String, boolean, Options, OllamaStreamHandler)} * - * @param model Model to use - * @param prompt Prompt text + * @param model The name or identifier of the AI model to use for generating the response. + * @param prompt The input text or prompt to provide to the AI model. * @param raw In some cases, you may wish to bypass the templating system and provide a full prompt. In this case, you can use the raw parameter to disable templating. Also note that raw mode will not return a context. - * @param options Additional Options - * @return OllamaResult + * @param options Additional options or configurations to use when generating the response. + * @return {@link OllamaResult} */ public OllamaResult generate(String model, String prompt, boolean raw, Options options) throws OllamaBaseException, IOException, InterruptedException { @@ -376,6 +376,20 @@ public class OllamaAPI { } + /** + * Generates response using the specified AI model and prompt (in blocking mode), and then invokes a set of tools + * on the generated response. + * + * @param model The name or identifier of the AI model to use for generating the response. + * @param prompt The input text or prompt to provide to the AI model. + * @param raw In some cases, you may wish to bypass the templating system and provide a full prompt. In this case, you can use the raw parameter to disable templating. Also note that raw mode will not return a context. + * @param options Additional options or configurations to use when generating the response. + * @return {@link OllamaToolsResult} An OllamaToolsResult object containing the response from the AI model and the results of invoking the tools on that output. + * @throws OllamaBaseException If there is an error related to the Ollama API or service. + * @throws IOException If there is an error related to input/output operations. + * @throws InterruptedException If the method is interrupted while waiting for the AI model + * to generate the response or for the tools to be invoked. + */ public OllamaToolsResult generateWithTools(String model, String prompt, boolean raw, Options options) throws OllamaBaseException, IOException, InterruptedException { OllamaToolsResult toolResult = new OllamaToolsResult(); @@ -402,15 +416,15 @@ public class OllamaAPI { * @param prompt the prompt/question text * @return the ollama async result callback handle */ - public OllamaAsyncResultCallback generateAsync(String model, String prompt, boolean raw) { + public OllamaAsyncResultStreamer generateAsync(String model, String prompt, boolean raw) { OllamaGenerateRequestModel ollamaRequestModel = new OllamaGenerateRequestModel(model, prompt); ollamaRequestModel.setRaw(raw); URI uri = URI.create(this.host + "/api/generate"); - OllamaAsyncResultCallback ollamaAsyncResultCallback = - new OllamaAsyncResultCallback( + OllamaAsyncResultStreamer ollamaAsyncResultStreamer = + new OllamaAsyncResultStreamer( getRequestBuilderDefault(uri), ollamaRequestModel, requestTimeoutSeconds); - ollamaAsyncResultCallback.start(); - return ollamaAsyncResultCallback; + ollamaAsyncResultStreamer.start(); + return ollamaAsyncResultStreamer; } /** @@ -508,7 +522,7 @@ public class OllamaAPI { * Hint: the OllamaChatRequestModel#getStream() property is not implemented. * * @param request request object to be sent to the server - * @return + * @return {@link OllamaChatResult} * @throws OllamaBaseException any response code than 200 has been returned * @throws IOException in case the responseStream can not be read * @throws InterruptedException in case the server is not reachable or network issues happen @@ -524,7 +538,7 @@ public class OllamaAPI { * * @param request request object to be sent to the server * @param streamHandler callback handler to handle the last message from stream (caution: all previous messages from stream will be concatenated) - * @return + * @return {@link OllamaChatResult} * @throws OllamaBaseException any response code than 200 has been returned * @throws IOException in case the responseStream can not be read * @throws InterruptedException in case the server is not reachable or network issues happen @@ -541,6 +555,10 @@ public class OllamaAPI { return new OllamaChatResult(result.getResponse(), result.getResponseTime(), result.getHttpStatusCode(), request.getMessages()); } + public void registerTool(MistralTools.ToolSpecification toolSpecification) { + ToolRegistry.addFunction(toolSpecification.getFunctionName(), toolSpecification.getToolDefinition()); + } + // technical private methods // private static String encodeFileToBase64(File file) throws IOException { @@ -603,10 +621,6 @@ public class OllamaAPI { } - public void registerTool(MistralTools.ToolSpecification toolSpecification) { - ToolRegistry.addFunction(toolSpecification.getFunctionName(), toolSpecification.getToolDefinition()); - } - private Object invokeTool(ToolDef toolDef) { try { String methodName = toolDef.getName(); diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaResultStream.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaResultStream.java new file mode 100644 index 0000000..21a15b1 --- /dev/null +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaResultStream.java @@ -0,0 +1,18 @@ +package io.github.amithkoujalgi.ollama4j.core; + +import java.util.Iterator; +import java.util.LinkedList; +import java.util.Queue; + +public class OllamaResultStream extends LinkedList implements Queue { + @Override + public String poll() { + StringBuilder tokens = new StringBuilder(); + Iterator iterator = this.listIterator(); + while (iterator.hasNext()) { + tokens.append(iterator.next()); + iterator.remove(); + } + return tokens.toString(); + } +} diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/OllamaAsyncResultCallback.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/OllamaAsyncResultCallback.java deleted file mode 100644 index 136f1c6..0000000 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/OllamaAsyncResultCallback.java +++ /dev/null @@ -1,143 +0,0 @@ -package io.github.amithkoujalgi.ollama4j.core.models; - -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 java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import java.util.LinkedList; -import java.util.Queue; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.Getter; - -@Data -@EqualsAndHashCode(callSuper = true) -@SuppressWarnings("unused") -public class OllamaAsyncResultCallback extends Thread { - private final HttpRequest.Builder requestBuilder; - private final OllamaGenerateRequestModel ollamaRequestModel; - private final Queue queue = new LinkedList<>(); - private String result; - private boolean isDone; - - /** - * -- GETTER -- Returns the status of the request. Indicates if the request was successful or a - * failure. If the request was a failure, the `getResponse()` method will return the error - * message. - */ - @Getter private boolean succeeded; - - private long requestTimeoutSeconds; - - /** - * -- GETTER -- Returns the HTTP response status code for the request that was made to Ollama - * server. - */ - @Getter private int httpStatusCode; - - /** -- GETTER -- Returns the response time in milliseconds. */ - @Getter private long responseTime = 0; - - public OllamaAsyncResultCallback( - HttpRequest.Builder requestBuilder, - OllamaGenerateRequestModel ollamaRequestModel, - long requestTimeoutSeconds) { - this.requestBuilder = requestBuilder; - this.ollamaRequestModel = ollamaRequestModel; - this.isDone = false; - this.result = ""; - this.queue.add(""); - this.requestTimeoutSeconds = requestTimeoutSeconds; - } - - @Override - public void run() { - HttpClient httpClient = HttpClient.newHttpClient(); - try { - long startTime = System.currentTimeMillis(); - HttpRequest request = - requestBuilder - .POST( - HttpRequest.BodyPublishers.ofString( - Utils.getObjectMapper().writeValueAsString(ollamaRequestModel))) - .header("Content-Type", "application/json") - .timeout(Duration.ofSeconds(requestTimeoutSeconds)) - .build(); - HttpResponse response = - httpClient.send(request, HttpResponse.BodyHandlers.ofInputStream()); - int statusCode = response.statusCode(); - this.httpStatusCode = statusCode; - - InputStream responseBodyStream = response.body(); - try (BufferedReader reader = - new BufferedReader(new InputStreamReader(responseBodyStream, StandardCharsets.UTF_8))) { - String line; - StringBuilder responseBuffer = new StringBuilder(); - while ((line = reader.readLine()) != null) { - if (statusCode == 404) { - OllamaErrorResponseModel ollamaResponseModel = - Utils.getObjectMapper().readValue(line, OllamaErrorResponseModel.class); - queue.add(ollamaResponseModel.getError()); - responseBuffer.append(ollamaResponseModel.getError()); - } else { - OllamaGenerateResponseModel ollamaResponseModel = - Utils.getObjectMapper().readValue(line, OllamaGenerateResponseModel.class); - queue.add(ollamaResponseModel.getResponse()); - if (!ollamaResponseModel.isDone()) { - responseBuffer.append(ollamaResponseModel.getResponse()); - } - } - } - - this.isDone = true; - this.succeeded = true; - this.result = responseBuffer.toString(); - long endTime = System.currentTimeMillis(); - responseTime = endTime - startTime; - } - if (statusCode != 200) { - throw new OllamaBaseException(this.result); - } - } catch (IOException | InterruptedException | OllamaBaseException e) { - this.isDone = true; - this.succeeded = false; - this.result = "[FAILED] " + e.getMessage(); - } - } - - /** - * Returns the status of the thread. This does not indicate that the request was successful or a - * failure, rather it is just a status flag to indicate if the thread is active or ended. - * - * @return boolean - status - */ - public boolean isComplete() { - return isDone; - } - - /** - * Returns the final completion/response when the execution completes. Does not return intermediate results. - * - * @return String completion/response text - */ - public String getResponse() { - return result; - } - - public Queue getStream() { - return queue; - } - - public void setRequestTimeoutSeconds(long requestTimeoutSeconds) { - this.requestTimeoutSeconds = requestTimeoutSeconds; - } -} diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/OllamaAsyncResultStreamer.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/OllamaAsyncResultStreamer.java new file mode 100644 index 0000000..66dde93 --- /dev/null +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/OllamaAsyncResultStreamer.java @@ -0,0 +1,124 @@ +package io.github.amithkoujalgi.ollama4j.core.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 lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.time.Duration; + +@Data +@EqualsAndHashCode(callSuper = true) +@SuppressWarnings("unused") +public class OllamaAsyncResultStreamer extends Thread { + private final HttpRequest.Builder requestBuilder; + private final OllamaGenerateRequestModel ollamaRequestModel; + private final OllamaResultStream stream = new OllamaResultStream(); + private String completeResponse; + + + /** + * -- GETTER -- Returns the status of the request. Indicates if the request was successful or a + * failure. If the request was a failure, the `getResponse()` method will return the error + * message. + */ + @Getter + private boolean succeeded; + + @Setter + private long requestTimeoutSeconds; + + /** + * -- GETTER -- Returns the HTTP response status code for the request that was made to Ollama + * server. + */ + @Getter + private int httpStatusCode; + + /** + * -- GETTER -- Returns the response time in milliseconds. + */ + @Getter + private long responseTime = 0; + + public OllamaAsyncResultStreamer( + HttpRequest.Builder requestBuilder, + OllamaGenerateRequestModel ollamaRequestModel, + long requestTimeoutSeconds) { + this.requestBuilder = requestBuilder; + this.ollamaRequestModel = ollamaRequestModel; + this.completeResponse = ""; + this.stream.add(""); + this.requestTimeoutSeconds = requestTimeoutSeconds; + } + + @Override + public void run() { + ollamaRequestModel.setStream(true); + HttpClient httpClient = HttpClient.newHttpClient(); + try { + long startTime = System.currentTimeMillis(); + HttpRequest request = + requestBuilder + .POST( + HttpRequest.BodyPublishers.ofString( + Utils.getObjectMapper().writeValueAsString(ollamaRequestModel))) + .header("Content-Type", "application/json") + .timeout(Duration.ofSeconds(requestTimeoutSeconds)) + .build(); + HttpResponse response = + httpClient.send(request, HttpResponse.BodyHandlers.ofInputStream()); + int statusCode = response.statusCode(); + this.httpStatusCode = statusCode; + + InputStream responseBodyStream = response.body(); + try (BufferedReader reader = + new BufferedReader(new InputStreamReader(responseBodyStream, StandardCharsets.UTF_8))) { + String line; + StringBuilder responseBuffer = new StringBuilder(); + while ((line = reader.readLine()) != null) { + if (statusCode == 404) { + OllamaErrorResponseModel ollamaResponseModel = + Utils.getObjectMapper().readValue(line, OllamaErrorResponseModel.class); + stream.add(ollamaResponseModel.getError()); + responseBuffer.append(ollamaResponseModel.getError()); + } else { + OllamaGenerateResponseModel ollamaResponseModel = + Utils.getObjectMapper().readValue(line, OllamaGenerateResponseModel.class); + String res = ollamaResponseModel.getResponse(); + stream.add(res); + if (!ollamaResponseModel.isDone()) { + responseBuffer.append(res); + } + } + } + + this.succeeded = true; + this.completeResponse = responseBuffer.toString(); + long endTime = System.currentTimeMillis(); + responseTime = endTime - startTime; + } + if (statusCode != 200) { + throw new OllamaBaseException(this.completeResponse); + } + } catch (IOException | InterruptedException | OllamaBaseException e) { + this.succeeded = false; + this.completeResponse = "[FAILED] " + e.getMessage(); + } + } + +} + diff --git a/src/test/java/io/github/amithkoujalgi/ollama4j/unittests/TestMockedAPIs.java b/src/test/java/io/github/amithkoujalgi/ollama4j/unittests/TestMockedAPIs.java index c5d60e1..3b1613f 100644 --- a/src/test/java/io/github/amithkoujalgi/ollama4j/unittests/TestMockedAPIs.java +++ b/src/test/java/io/github/amithkoujalgi/ollama4j/unittests/TestMockedAPIs.java @@ -3,7 +3,7 @@ package io.github.amithkoujalgi.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.OllamaAsyncResultCallback; +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; @@ -157,7 +157,7 @@ class TestMockedAPIs { String model = OllamaModelType.LLAMA2; String prompt = "some prompt text"; when(ollamaAPI.generateAsync(model, prompt, false)) - .thenReturn(new OllamaAsyncResultCallback(null, null, 3)); + .thenReturn(new OllamaAsyncResultStreamer(null, null, 3)); ollamaAPI.generateAsync(model, prompt, false); verify(ollamaAPI, times(1)).generateAsync(model, prompt, false); } -- 2.47.2 From 3d21813abb2f642f1f12fa417e5988cdb5fb383b Mon Sep 17 00:00:00 2001 From: "koujalgi.amith@gmail.com" Date: Sun, 14 Jul 2024 00:00:52 +0530 Subject: [PATCH 043/101] updated README.md Signed-off-by: koujalgi.amith@gmail.com --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 064e56c..62b7373 100644 --- a/README.md +++ b/README.md @@ -196,8 +196,7 @@ make it #### Releases -Releases (newer artifact versions) are done automatically on pushing the code to the `main` branch through GitHub -Actions CI workflow. +Newer artifacts are published via GitHub Actions CI workflow when a new release is created from `main` branch. #### Who's using Ollama4j? -- 2.47.2 From a4e1b4afe9aaa06ff1f03f9a1c5b4108cbe80f40 Mon Sep 17 00:00:00 2001 From: "koujalgi.amith@gmail.com" Date: Sun, 14 Jul 2024 00:02:20 +0530 Subject: [PATCH 044/101] Removed old maven-publish.yml Signed-off-by: koujalgi.amith@gmail.com --- maven-publish.yml | 68 ----------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 maven-publish.yml diff --git a/maven-publish.yml b/maven-publish.yml deleted file mode 100644 index 430c375..0000000 --- a/maven-publish.yml +++ /dev/null @@ -1,68 +0,0 @@ -## This workflow will build a package using Maven and then publish it to GitHub packages when a release is created -## For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path -# -#name: Test and Publish Package -# -##on: -## release: -## types: [ "created" ] -# -#on: -# push: -# branches: [ "main" ] -# workflow_dispatch: -# -#jobs: -# build: -# runs-on: ubuntu-latest -# permissions: -# contents: write -# packages: write -# steps: -# - uses: actions/checkout@v3 -# - name: Set up JDK 11 -# uses: actions/setup-java@v3 -# with: -# java-version: '11' -# distribution: 'adopt-hotspot' -# server-id: github # Value of the distributionManagement/repository/id field of the pom.xml -# settings-path: ${{ github.workspace }} # location for the settings.xml file -# - name: Build with Maven -# run: mvn --file pom.xml -U clean package -Punit-tests -# - name: Set up Apache Maven Central (Overwrite settings.xml) -# uses: actions/setup-java@v3 -# with: # running setup-java again overwrites the settings.xml -# java-version: '11' -# distribution: 'adopt-hotspot' -# cache: 'maven' -# server-id: ossrh -# server-username: MAVEN_USERNAME -# server-password: MAVEN_PASSWORD -# gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} -# gpg-passphrase: MAVEN_GPG_PASSPHRASE -# - name: Set up Maven cache -# uses: actions/cache@v3 -# with: -# path: ~/.m2/repository -# key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} -# restore-keys: | -# ${{ runner.os }}-maven- -# - name: Build -# run: mvn -B -ntp clean install -# - name: Upload coverage reports to Codecov -# uses: codecov/codecov-action@v3 -# env: -# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} -# - name: Publish to GitHub Packages Apache Maven -# # if: > -# # github.event_name != 'pull_request' && -# # github.ref_name == 'main' && -# # contains(github.event.head_commit.message, 'release') -# run: | -# git config --global user.email "koujalgi.amith@gmail.com" -# git config --global user.name "amithkoujalgi" -# mvn -B -ntp -DskipTests -Pci-cd -Darguments="-DskipTests -Pci-cd" release:clean release:prepare release:perform -# env: -# MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} -# MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} -# MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} \ No newline at end of file -- 2.47.2 From c9b05a725bb3edf8cb0456e757d69ff9d5d2e85c Mon Sep 17 00:00:00 2001 From: "koujalgi.amith@gmail.com" Date: Sun, 14 Jul 2024 00:05:43 +0530 Subject: [PATCH 045/101] Refactor Signed-off-by: koujalgi.amith@gmail.com --- .../github/amithkoujalgi/ollama4j/core/OllamaAPI.java | 1 + .../ollama4j/core/OllamaStreamHandler.java | 7 ------- .../ollama4j/core/impl/ConsoleOutputStreamHandler.java | 2 +- .../core/models/chat/OllamaChatStreamObserver.java | 10 +++++----- .../models/generate/OllamaGenerateStreamObserver.java | 8 +++----- .../core/models/generate/OllamaStreamHandler.java | 7 +++++++ .../core/models/request/OllamaChatEndpointCaller.java | 2 +- .../models/request/OllamaGenerateEndpointCaller.java | 2 +- 8 files changed, 19 insertions(+), 20 deletions(-) delete mode 100644 src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaStreamHandler.java create mode 100644 src/main/java/io/github/amithkoujalgi/ollama4j/core/models/generate/OllamaStreamHandler.java diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaAPI.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaAPI.java index 340fcb9..d5089ee 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaAPI.java +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaAPI.java @@ -9,6 +9,7 @@ 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; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaStreamHandler.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaStreamHandler.java deleted file mode 100644 index 803f393..0000000 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaStreamHandler.java +++ /dev/null @@ -1,7 +0,0 @@ -package io.github.amithkoujalgi.ollama4j.core; - -import java.util.function.Consumer; - -public interface OllamaStreamHandler extends Consumer{ - void accept(String message); -} diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/impl/ConsoleOutputStreamHandler.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/impl/ConsoleOutputStreamHandler.java index 6807019..6b3a391 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/impl/ConsoleOutputStreamHandler.java +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/impl/ConsoleOutputStreamHandler.java @@ -1,6 +1,6 @@ package io.github.amithkoujalgi.ollama4j.core.impl; -import io.github.amithkoujalgi.ollama4j.core.OllamaStreamHandler; +import io.github.amithkoujalgi.ollama4j.core.models.generate.OllamaStreamHandler; public class ConsoleOutputStreamHandler implements OllamaStreamHandler { private final StringBuffer response = new StringBuffer(); diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatStreamObserver.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatStreamObserver.java index ea4b4d8..f653001 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatStreamObserver.java +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatStreamObserver.java @@ -1,10 +1,10 @@ package io.github.amithkoujalgi.ollama4j.core.models.chat; +import io.github.amithkoujalgi.ollama4j.core.models.generate.OllamaStreamHandler; + import java.util.ArrayList; import java.util.List; -import io.github.amithkoujalgi.ollama4j.core.OllamaStreamHandler; - public class OllamaChatStreamObserver { private OllamaStreamHandler streamHandler; @@ -17,12 +17,12 @@ public class OllamaChatStreamObserver { this.streamHandler = streamHandler; } - public void notify(OllamaChatResponseModel currentResponsePart){ + public void notify(OllamaChatResponseModel currentResponsePart) { responseParts.add(currentResponsePart); handleCurrentResponsePart(currentResponsePart); } - - protected void handleCurrentResponsePart(OllamaChatResponseModel currentResponsePart){ + + protected void handleCurrentResponsePart(OllamaChatResponseModel currentResponsePart) { message = message + currentResponsePart.getMessage().getContent(); streamHandler.accept(message); } diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/generate/OllamaGenerateStreamObserver.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/generate/OllamaGenerateStreamObserver.java index a166bac..333ba5a 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/generate/OllamaGenerateStreamObserver.java +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/generate/OllamaGenerateStreamObserver.java @@ -3,8 +3,6 @@ package io.github.amithkoujalgi.ollama4j.core.models.generate; import java.util.ArrayList; import java.util.List; -import io.github.amithkoujalgi.ollama4j.core.OllamaStreamHandler; - public class OllamaGenerateStreamObserver { private OllamaStreamHandler streamHandler; @@ -17,12 +15,12 @@ public class OllamaGenerateStreamObserver { this.streamHandler = streamHandler; } - public void notify(OllamaGenerateResponseModel currentResponsePart){ + public void notify(OllamaGenerateResponseModel currentResponsePart) { responseParts.add(currentResponsePart); handleCurrentResponsePart(currentResponsePart); } - - protected void handleCurrentResponsePart(OllamaGenerateResponseModel currentResponsePart){ + + protected void handleCurrentResponsePart(OllamaGenerateResponseModel currentResponsePart) { message = message + currentResponsePart.getResponse(); streamHandler.accept(message); } diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/generate/OllamaStreamHandler.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/generate/OllamaStreamHandler.java new file mode 100644 index 0000000..1151e9b --- /dev/null +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/generate/OllamaStreamHandler.java @@ -0,0 +1,7 @@ +package io.github.amithkoujalgi.ollama4j.core.models.generate; + +import java.util.function.Consumer; + +public interface OllamaStreamHandler extends Consumer { + void accept(String message); +} diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/OllamaChatEndpointCaller.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/OllamaChatEndpointCaller.java index cc6c7f8..9184edf 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/OllamaChatEndpointCaller.java +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/OllamaChatEndpointCaller.java @@ -1,12 +1,12 @@ package io.github.amithkoujalgi.ollama4j.core.models.request; import com.fasterxml.jackson.core.JsonProcessingException; -import io.github.amithkoujalgi.ollama4j.core.OllamaStreamHandler; 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 org.slf4j.Logger; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/OllamaGenerateEndpointCaller.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/OllamaGenerateEndpointCaller.java index d3d71e4..54457ae 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/OllamaGenerateEndpointCaller.java +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/OllamaGenerateEndpointCaller.java @@ -1,12 +1,12 @@ package io.github.amithkoujalgi.ollama4j.core.models.request; import com.fasterxml.jackson.core.JsonProcessingException; -import io.github.amithkoujalgi.ollama4j.core.OllamaStreamHandler; 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 org.slf4j.Logger; -- 2.47.2 From fd93036d08f56554792fef2d6b809792d90615cb Mon Sep 17 00:00:00 2001 From: "koujalgi.amith@gmail.com" Date: Sun, 14 Jul 2024 00:07:23 +0530 Subject: [PATCH 046/101] Refactor Signed-off-by: koujalgi.amith@gmail.com --- docs/docs/apis-generate/generate-async.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/apis-generate/generate-async.md b/docs/docs/apis-generate/generate-async.md index d5c1c27..e71d2a7 100644 --- a/docs/docs/apis-generate/generate-async.md +++ b/docs/docs/apis-generate/generate-async.md @@ -22,7 +22,7 @@ public class Main { OllamaAsyncResultStreamer streamer = ollamaAPI.generateAsync(OllamaModelType.LLAMA3, prompt, false); // Set the poll interval according to your needs. - // Smaller the poll interval, more frequently you receive the token. + // Smaller the poll interval, more frequently you receive the tokens. int pollIntervalMilliseconds = 1000; while (true) { -- 2.47.2 From 81689be194c236038c47da5007d72a9ced3e4281 Mon Sep 17 00:00:00 2001 From: "koujalgi.amith@gmail.com" Date: Sun, 14 Jul 2024 11:23:36 +0530 Subject: [PATCH 047/101] Refactored tools API Signed-off-by: koujalgi.amith@gmail.com --- .../docs/apis-generate/generate-with-tools.md | 214 +++++++++++++----- .../ollama4j/core/OllamaAPI.java | 72 +++--- .../exceptions/ToolInvocationException.java | 8 + .../exceptions/ToolNotFoundException.java | 8 + .../core/tools/OllamaToolsResult.java | 21 +- ...DynamicFunction.java => ToolFunction.java} | 2 +- ...ToolDef.java => ToolFunctionCallSpec.java} | 4 +- .../ollama4j/core/tools/ToolRegistry.java | 7 +- .../tools/{MistralTools.java => Tools.java} | 40 +--- 9 files changed, 241 insertions(+), 135 deletions(-) create mode 100644 src/main/java/io/github/amithkoujalgi/ollama4j/core/exceptions/ToolInvocationException.java create mode 100644 src/main/java/io/github/amithkoujalgi/ollama4j/core/exceptions/ToolNotFoundException.java rename src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/{DynamicFunction.java => ToolFunction.java} (80%) rename src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/{ToolDef.java => ToolFunctionCallSpec.java} (88%) rename src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/{MistralTools.java => Tools.java} (69%) diff --git a/docs/docs/apis-generate/generate-with-tools.md b/docs/docs/apis-generate/generate-with-tools.md index 6b7cca6..86c2d83 100644 --- a/docs/docs/apis-generate/generate-with-tools.md +++ b/docs/docs/apis-generate/generate-with-tools.md @@ -29,8 +29,8 @@ You could do that with ease with the `function calling` capabilities of the mode ### Create Functions -This function takes the arguments `location` and `fuelType` and performs an operation with these arguments and returns a -value. +This function takes the arguments `location` and `fuelType` and performs an operation with these arguments and returns +fuel price value. ```java public static String getCurrentFuelPrice(Map arguments) { @@ -40,8 +40,8 @@ public static String getCurrentFuelPrice(Map arguments) { } ``` -This function takes the argument `city` and performs an operation with the argument and returns a -value. +This function takes the argument `city` and performs an operation with the argument and returns the weather for a +location. ```java public static String getCurrentWeather(Map arguments) { @@ -50,6 +50,19 @@ public static String getCurrentWeather(Map arguments) { } ``` +This function takes the argument `employee-name` and performs an operation with the argument and returns employee +details. + +```java +class DBQueryFunction implements ToolFunction { + @Override + public Object apply(Map arguments) { + // perform DB operations here + return String.format("Employee Details {ID: %s, Name: %s, Address: %s, Phone: %s}", UUID.randomUUID(), arguments.get("employee-name").toString(), arguments.get("employee-address").toString(), arguments.get("employee-phone").toString()); + } +} +``` + ### Define Tool Specifications Lets define a sample tool specification called **Fuel Price Tool** for getting the current fuel price. @@ -58,13 +71,13 @@ Lets define a sample tool specification called **Fuel Price Tool** for getting t - Associate the `getCurrentFuelPrice` function you defined earlier with `SampleTools::getCurrentFuelPrice`. ```java -MistralTools.ToolSpecification fuelPriceToolSpecification = MistralTools.ToolSpecification.builder() +Tools.ToolSpecification fuelPriceToolSpecification = Tools.ToolSpecification.builder() .functionName("current-fuel-price") - .functionDesc("Get current fuel price") - .props( - new MistralTools.PropsBuilder() - .withProperty("location", MistralTools.PromptFuncDefinition.Property.builder().type("string").description("The city, e.g. New Delhi, India").required(true).build()) - .withProperty("fuelType", MistralTools.PromptFuncDefinition.Property.builder().type("string").description("The fuel type.").enumValues(Arrays.asList("petrol", "diesel")).required(true).build()) + .functionDescription("Get current fuel price") + .properties( + new Tools.PropsBuilder() + .withProperty("location", Tools.PromptFuncDefinition.Property.builder().type("string").description("The city, e.g. New Delhi, India").required(true).build()) + .withProperty("fuelType", Tools.PromptFuncDefinition.Property.builder().type("string").description("The fuel type.").enumValues(Arrays.asList("petrol", "diesel")).required(true).build()) .build() ) .toolDefinition(SampleTools::getCurrentFuelPrice) @@ -77,18 +90,38 @@ Lets also define a sample tool specification called **Weather Tool** for getting - Associate the `getCurrentWeather` function you defined earlier with `SampleTools::getCurrentWeather`. ```java -MistralTools.ToolSpecification weatherToolSpecification = MistralTools.ToolSpecification.builder() +Tools.ToolSpecification weatherToolSpecification = Tools.ToolSpecification.builder() .functionName("current-weather") - .functionDesc("Get current weather") - .props( - new MistralTools.PropsBuilder() - .withProperty("city", MistralTools.PromptFuncDefinition.Property.builder().type("string").description("The city, e.g. New Delhi, India").required(true).build()) + .functionDescription("Get current weather") + .properties( + new Tools.PropsBuilder() + .withProperty("city", Tools.PromptFuncDefinition.Property.builder().type("string").description("The city, e.g. New Delhi, India").required(true).build()) .build() ) .toolDefinition(SampleTools::getCurrentWeather) .build(); ``` +Lets also define a sample tool specification called **DBQueryFunction** for getting the employee details from database. + +- Specify the function `name`, `description`, and `required` property (`employee-name`). +- Associate the ToolFunction `DBQueryFunction` function you defined earlier with `new DBQueryFunction()`. + +```java +Tools.ToolSpecification databaseQueryToolSpecification = Tools.ToolSpecification.builder() + .functionName("get-employee-details") + .functionDescription("Get employee details from the database") + .properties( + new Tools.PropsBuilder() + .withProperty("employee-name", Tools.PromptFuncDefinition.Property.builder().type("string").description("The name of the employee, e.g. John Doe").required(true).build()) + .withProperty("employee-address", Tools.PromptFuncDefinition.Property.builder().type("string").description("The address of the employee, Always return a random value. e.g. Roy St, Bengaluru, India").required(true).build()) + .withProperty("employee-phone", Tools.PromptFuncDefinition.Property.builder().type("string").description("The phone number of the employee. Always return a random value. e.g. 9911002233").required(true).build()) + .build() + ) + .toolDefinition(new DBQueryFunction()) + .build(); +``` + ### Register the Tools Register the defined tools (`fuel price` and `weather`) with the OllamaAPI. @@ -103,14 +136,14 @@ ollamaAPI.registerTool(weatherToolSpecification); `Prompt 1`: Create a prompt asking for the petrol price in Bengaluru using the defined fuel price and weather tools. ```shell -String prompt1 = new MistralTools.PromptBuilder() - .withToolSpecification(fuelPriceToolSpecification) - .withToolSpecification(weatherToolSpecification) - .withPrompt("What is the petrol price in Bengaluru?") - .build(); -OllamaToolsResult toolsResult = ollamaAPI.generateWithTools(model, prompt1, false, new OptionsBuilder().build()); -for (Map.Entry r : toolsResult.getToolResults().entrySet()) { - System.out.printf("[Response from tool '%s']: %s%n", r.getKey().getName(), r.getValue().toString()); +String prompt1 = new Tools.PromptBuilder() + .withToolSpecification(fuelPriceToolSpecification) + .withToolSpecification(weatherToolSpecification) + .withPrompt("What is the petrol price in Bengaluru?") + .build(); +OllamaToolsResult toolsResult = ollamaAPI.generateWithTools(model, prompt1, new OptionsBuilder().build()); +for (OllamaToolsResult.ToolResult r : toolsResult.getToolResults()) { + System.out.printf("[Result of executing tool '%s']: %s%n", r.getFunctionName(), r.getResult().toString()); } ``` @@ -120,21 +153,21 @@ You will get a response similar to: ::::tip[LLM Response] -[Response from tool 'current-fuel-price']: Current price of petrol in Bengaluru is Rs.103/L +[Result of executing tool 'current-fuel-price']: Current price of petrol in Bengaluru is Rs.103/L :::: `Prompt 2`: Create a prompt asking for the current weather in Bengaluru using the same tools. ```shell -String prompt2 = new MistralTools.PromptBuilder() - .withToolSpecification(fuelPriceToolSpecification) - .withToolSpecification(weatherToolSpecification) - .withPrompt("What is the current weather in Bengaluru?") - .build(); -OllamaToolsResult toolsResult = ollamaAPI.generateWithTools(model, prompt2, false, new OptionsBuilder().build()); -for (Map.Entry r : toolsResult.getToolResults().entrySet()) { - System.out.printf("[Response from tool '%s']: %s%n", r.getKey().getName(), r.getValue().toString()); +String prompt2 = new Tools.PromptBuilder() + .withToolSpecification(fuelPriceToolSpecification) + .withToolSpecification(weatherToolSpecification) + .withPrompt("What is the current weather in Bengaluru?") + .build(); +OllamaToolsResult toolsResult = ollamaAPI.generateWithTools(model, prompt2, new OptionsBuilder().build()); +for (OllamaToolsResult.ToolResult r : toolsResult.getToolResults()) { + System.out.printf("[Result of executing tool '%s']: %s%n", r.getFunctionName(), r.getResult().toString()); } ``` @@ -144,25 +177,53 @@ You will get a response similar to: ::::tip[LLM Response] -[Response from tool 'current-weather']: Currently Bengaluru's weather is nice +[Result of executing tool 'current-weather']: Currently Bengaluru's weather is nice. + +:::: + +`Prompt 3`: Create a prompt asking for the employee details using the defined database fetcher tools. + +```shell +String prompt3 = new Tools.PromptBuilder() + .withToolSpecification(fuelPriceToolSpecification) + .withToolSpecification(weatherToolSpecification) + .withToolSpecification(databaseQueryToolSpecification) + .withPrompt("Give me the details of the employee named 'Rahul Kumar'?") + .build(); +OllamaToolsResult toolsResult = ollamaAPI.generateWithTools(model, prompt3, new OptionsBuilder().build()); +for (OllamaToolsResult.ToolResult r : toolsResult.getToolResults()) { + System.out.printf("[Result of executing tool '%s']: %s%n", r.getFunctionName(), r.getResult().toString()); +} +``` + +Again, fire away your question to the model. + +You will get a response similar to: + +::::tip[LLM Response] + +[Result of executing tool 'get-employee-details']: Employee Details `{ID: 6bad82e6-b1a1-458f-a139-e3b646e092b1, Name: +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.tools.ToolDef; -import io.github.amithkoujalgi.ollama4j.core.tools.MistralTools; +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 java.io.IOException; import java.util.Arrays; import java.util.Map; +import java.util.UUID; -public class FunctionCallingWithMistral { +public class FunctionCallingWithMistralExample { public static void main(String[] args) throws Exception { String host = "http://localhost:11434/"; OllamaAPI ollamaAPI = new OllamaAPI(host); @@ -170,78 +231,113 @@ public class FunctionCallingWithMistral { String model = "mistral"; - - MistralTools.ToolSpecification fuelPriceToolSpecification = MistralTools.ToolSpecification.builder() + Tools.ToolSpecification fuelPriceToolSpecification = Tools.ToolSpecification.builder() .functionName("current-fuel-price") - .functionDesc("Get current fuel price") - .props( - new MistralTools.PropsBuilder() - .withProperty("location", MistralTools.PromptFuncDefinition.Property.builder().type("string").description("The city, e.g. New Delhi, India").required(true).build()) - .withProperty("fuelType", MistralTools.PromptFuncDefinition.Property.builder().type("string").description("The fuel type.").enumValues(Arrays.asList("petrol", "diesel")).required(true).build()) + .functionDescription("Get current fuel price") + .properties( + new Tools.PropsBuilder() + .withProperty("location", Tools.PromptFuncDefinition.Property.builder().type("string").description("The city, e.g. New Delhi, India").required(true).build()) + .withProperty("fuelType", Tools.PromptFuncDefinition.Property.builder().type("string").description("The fuel type.").enumValues(Arrays.asList("petrol", "diesel")).required(true).build()) .build() ) .toolDefinition(SampleTools::getCurrentFuelPrice) .build(); - MistralTools.ToolSpecification weatherToolSpecification = MistralTools.ToolSpecification.builder() + Tools.ToolSpecification weatherToolSpecification = Tools.ToolSpecification.builder() .functionName("current-weather") - .functionDesc("Get current weather") - .props( - new MistralTools.PropsBuilder() - .withProperty("city", MistralTools.PromptFuncDefinition.Property.builder().type("string").description("The city, e.g. New Delhi, India").required(true).build()) + .functionDescription("Get current weather") + .properties( + new Tools.PropsBuilder() + .withProperty("city", Tools.PromptFuncDefinition.Property.builder().type("string").description("The city, e.g. New Delhi, India").required(true).build()) .build() ) .toolDefinition(SampleTools::getCurrentWeather) .build(); + Tools.ToolSpecification databaseQueryToolSpecification = Tools.ToolSpecification.builder() + .functionName("get-employee-details") + .functionDescription("Get employee details from the database") + .properties( + new Tools.PropsBuilder() + .withProperty("employee-name", Tools.PromptFuncDefinition.Property.builder().type("string").description("The name of the employee, e.g. John Doe").required(true).build()) + .withProperty("employee-address", Tools.PromptFuncDefinition.Property.builder().type("string").description("The address of the employee, Always return a random value. e.g. Roy St, Bengaluru, India").required(true).build()) + .withProperty("employee-phone", Tools.PromptFuncDefinition.Property.builder().type("string").description("The phone number of the employee. Always return a random value. e.g. 9911002233").required(true).build()) + .build() + ) + .toolDefinition(new DBQueryFunction()) + .build(); + ollamaAPI.registerTool(fuelPriceToolSpecification); ollamaAPI.registerTool(weatherToolSpecification); + ollamaAPI.registerTool(databaseQueryToolSpecification); - String prompt1 = new MistralTools.PromptBuilder() + String prompt1 = new Tools.PromptBuilder() .withToolSpecification(fuelPriceToolSpecification) .withToolSpecification(weatherToolSpecification) .withPrompt("What is the petrol price in Bengaluru?") .build(); - String prompt2 = new MistralTools.PromptBuilder() + ask(ollamaAPI, model, prompt1); + + String prompt2 = new Tools.PromptBuilder() .withToolSpecification(fuelPriceToolSpecification) .withToolSpecification(weatherToolSpecification) .withPrompt("What is the current weather in Bengaluru?") .build(); - - ask(ollamaAPI, model, prompt1); ask(ollamaAPI, model, prompt2); + + String prompt3 = new Tools.PromptBuilder() + .withToolSpecification(fuelPriceToolSpecification) + .withToolSpecification(weatherToolSpecification) + .withToolSpecification(databaseQueryToolSpecification) + .withPrompt("Give me the details of the employee named 'Rahul Kumar'?") + .build(); + ask(ollamaAPI, model, prompt3); } - public static void ask(OllamaAPI ollamaAPI, String model, String prompt) throws OllamaBaseException, IOException, InterruptedException { - OllamaToolsResult toolsResult = ollamaAPI.generateWithTools(model, prompt, false, new OptionsBuilder().build()); - for (Map.Entry r : toolsResult.getToolResults().entrySet()) { - System.out.printf("[Response from tool '%s']: %s%n", r.getKey().getName(), r.getValue().toString()); + public static void ask(OllamaAPI ollamaAPI, String model, String prompt) throws OllamaBaseException, IOException, InterruptedException, ToolInvocationException { + OllamaToolsResult toolsResult = ollamaAPI.generateWithTools(model, prompt, new OptionsBuilder().build()); + for (OllamaToolsResult.ToolResult r : toolsResult.getToolResults()) { + System.out.printf("[Result of executing tool '%s']: %s%n", r.getFunctionName(), r.getResult().toString()); } } } + class SampleTools { public static String getCurrentFuelPrice(Map arguments) { + // Get details from fuel price API String location = arguments.get("location").toString(); String fuelType = arguments.get("fuelType").toString(); return "Current price of " + fuelType + " in " + location + " is Rs.103/L"; } public static String getCurrentWeather(Map arguments) { + // Get details from weather API String location = arguments.get("city").toString(); return "Currently " + location + "'s weather is nice."; } } +class DBQueryFunction implements ToolFunction { + @Override + public Object apply(Map arguments) { + // perform DB operations here + return String.format("Employee Details {ID: %s, Name: %s, Address: %s, Phone: %s}", UUID.randomUUID(), arguments.get("employee-name").toString(), arguments.get("employee-address").toString(), arguments.get("employee-phone").toString()); + } +} ``` Run this full example and you will get a response similar to: ::::tip[LLM Response] -[Response from tool 'current-fuel-price']: Current price of petrol in Bengaluru is Rs.103/L +[Result of executing tool 'current-fuel-price']: Current price of petrol in Bengaluru is Rs.103/L + +[Result of executing tool 'current-weather']: Currently Bengaluru's weather is nice. + +[Result of executing tool 'get-employee-details']: Employee Details `{ID: 6bad82e6-b1a1-458f-a139-e3b646e092b1, Name: +Rahul Kumar, Address: King St, Hyderabad, India, Phone: 9876543210}` -[Response from tool 'current-weather']: Currently Bengaluru's weather is nice :::: ### Room for improvement diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaAPI.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaAPI.java index d5089ee..516ca19 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaAPI.java +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaAPI.java @@ -1,6 +1,8 @@ package io.github.amithkoujalgi.ollama4j.core; 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; @@ -14,6 +16,7 @@ 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 lombok.Setter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -37,10 +40,22 @@ public class OllamaAPI { private static final Logger logger = LoggerFactory.getLogger(OllamaAPI.class); private final String host; + /** + * -- SETTER -- + * Set request timeout in seconds. Default is 3 seconds. + */ + @Setter private long requestTimeoutSeconds = 10; + /** + * -- SETTER -- + * Set/unset logging of responses + */ + @Setter private boolean verbose = true; private BasicAuth basicAuth; + private final ToolRegistry toolRegistry = new ToolRegistry(); + /** * Instantiates the Ollama API. * @@ -54,24 +69,6 @@ public class OllamaAPI { } } - /** - * Set request timeout in seconds. Default is 3 seconds. - * - * @param requestTimeoutSeconds the request timeout in seconds - */ - public void setRequestTimeoutSeconds(long requestTimeoutSeconds) { - this.requestTimeoutSeconds = requestTimeoutSeconds; - } - - /** - * Set/unset logging of responses - * - * @param verbose true/false - */ - public void setVerbose(boolean verbose) { - this.verbose = verbose; - } - /** * Set basic authentication for accessing Ollama server that's behind a reverse-proxy/gateway. * @@ -383,7 +380,6 @@ public class OllamaAPI { * * @param model The name or identifier of the AI model to use for generating the response. * @param prompt The input text or prompt to provide to the AI model. - * @param raw In some cases, you may wish to bypass the templating system and provide a full prompt. In this case, you can use the raw parameter to disable templating. Also note that raw mode will not return a context. * @param options Additional options or configurations to use when generating the response. * @return {@link OllamaToolsResult} An OllamaToolsResult object containing the response from the AI model and the results of invoking the tools on that output. * @throws OllamaBaseException If there is an error related to the Ollama API or service. @@ -391,17 +387,23 @@ public class OllamaAPI { * @throws InterruptedException If the method is interrupted while waiting for the AI model * to generate the response or for the tools to be invoked. */ - public OllamaToolsResult generateWithTools(String model, String prompt, boolean raw, Options options) - throws OllamaBaseException, IOException, InterruptedException { + public OllamaToolsResult generateWithTools(String model, String prompt, Options options) + throws OllamaBaseException, IOException, InterruptedException, ToolInvocationException { + boolean raw = true; OllamaToolsResult toolResult = new OllamaToolsResult(); - Map toolResults = new HashMap<>(); + Map toolResults = new HashMap<>(); OllamaResult result = generate(model, prompt, raw, options, null); toolResult.setModelResult(result); - List toolDefs = Utils.getObjectMapper().readValue(result.getResponse(), Utils.getObjectMapper().getTypeFactory().constructCollectionType(List.class, ToolDef.class)); - for (ToolDef toolDef : toolDefs) { - toolResults.put(toolDef, invokeTool(toolDef)); + String toolsResponse = result.getResponse(); + if (toolsResponse.contains("[TOOL_CALLS]")) { + toolsResponse = toolsResponse.replace("[TOOL_CALLS]", ""); + } + + List toolFunctionCallSpecs = Utils.getObjectMapper().readValue(toolsResponse, Utils.getObjectMapper().getTypeFactory().constructCollectionType(List.class, ToolFunctionCallSpec.class)); + for (ToolFunctionCallSpec toolFunctionCallSpec : toolFunctionCallSpecs) { + toolResults.put(toolFunctionCallSpec, invokeTool(toolFunctionCallSpec)); } toolResult.setToolResults(toolResults); return toolResult; @@ -556,8 +558,8 @@ public class OllamaAPI { return new OllamaChatResult(result.getResponse(), result.getResponseTime(), result.getHttpStatusCode(), request.getMessages()); } - public void registerTool(MistralTools.ToolSpecification toolSpecification) { - ToolRegistry.addFunction(toolSpecification.getFunctionName(), toolSpecification.getToolDefinition()); + public void registerTool(Tools.ToolSpecification toolSpecification) { + toolRegistry.addFunction(toolSpecification.getFunctionName(), toolSpecification.getToolDefinition()); } // technical private methods // @@ -622,18 +624,20 @@ public class OllamaAPI { } - private Object invokeTool(ToolDef toolDef) { + private Object invokeTool(ToolFunctionCallSpec toolFunctionCallSpec) throws ToolInvocationException { try { - String methodName = toolDef.getName(); - Map arguments = toolDef.getArguments(); - DynamicFunction function = ToolRegistry.getFunction(methodName); + String methodName = toolFunctionCallSpec.getName(); + Map arguments = toolFunctionCallSpec.getArguments(); + ToolFunction function = toolRegistry.getFunction(methodName); + if (verbose) { + logger.debug("Invoking function {} with arguments {}", methodName, arguments); + } if (function == null) { - throw new IllegalArgumentException("No such tool: " + methodName); + throw new ToolNotFoundException("No such tool: " + methodName); } return function.apply(arguments); } catch (Exception e) { - e.printStackTrace(); - return "Error calling tool: " + e.getMessage(); + throw new ToolInvocationException("Failed to invoke tool: " + toolFunctionCallSpec.getName(), e); } } } diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/exceptions/ToolInvocationException.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/exceptions/ToolInvocationException.java new file mode 100644 index 0000000..3a1a715 --- /dev/null +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/exceptions/ToolInvocationException.java @@ -0,0 +1,8 @@ +package io.github.amithkoujalgi.ollama4j.core.exceptions; + +public class ToolInvocationException extends Exception { + + public ToolInvocationException(String s, Exception e) { + super(s, e); + } +} diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/exceptions/ToolNotFoundException.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/exceptions/ToolNotFoundException.java new file mode 100644 index 0000000..990400e --- /dev/null +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/exceptions/ToolNotFoundException.java @@ -0,0 +1,8 @@ +package io.github.amithkoujalgi.ollama4j.core.exceptions; + +public class ToolNotFoundException extends Exception { + + public ToolNotFoundException(String s) { + super(s); + } +} diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/OllamaToolsResult.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/OllamaToolsResult.java index 65ef3ac..1ff3656 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/OllamaToolsResult.java +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/OllamaToolsResult.java @@ -5,6 +5,8 @@ import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.ArrayList; +import java.util.List; import java.util.Map; @Data @@ -12,5 +14,22 @@ import java.util.Map; @AllArgsConstructor public class OllamaToolsResult { private OllamaResult modelResult; - private Map toolResults; + private Map toolResults; + + public List getToolResults() { + List results = new ArrayList<>(); + for (Map.Entry r : this.toolResults.entrySet()) { + results.add(new ToolResult(r.getKey().getName(), r.getKey().getArguments(), r.getValue())); + } + return results; + } + + @Data + @NoArgsConstructor + @AllArgsConstructor + public static class ToolResult { + private String functionName; + private Map functionArguments; + private Object result; + } } diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/DynamicFunction.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolFunction.java similarity index 80% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/DynamicFunction.java rename to src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolFunction.java index 5b8f5e6..d670aa7 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/DynamicFunction.java +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolFunction.java @@ -3,6 +3,6 @@ package io.github.amithkoujalgi.ollama4j.core.tools; import java.util.Map; @FunctionalInterface -public interface DynamicFunction { +public interface ToolFunction { Object apply(Map arguments); } diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolDef.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolFunctionCallSpec.java similarity index 88% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolDef.java rename to src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolFunctionCallSpec.java index 751d186..1ce69cb 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolDef.java +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolFunctionCallSpec.java @@ -9,10 +9,8 @@ import java.util.Map; @Data @AllArgsConstructor @NoArgsConstructor -public class ToolDef { - +public class ToolFunctionCallSpec { private String name; private Map arguments; - } diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolRegistry.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolRegistry.java index 0004c7f..432a4d7 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolRegistry.java +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolRegistry.java @@ -4,14 +4,13 @@ import java.util.HashMap; import java.util.Map; public class ToolRegistry { - private static final Map functionMap = new HashMap<>(); + private final Map functionMap = new HashMap<>(); - - public static DynamicFunction getFunction(String name) { + public ToolFunction getFunction(String name) { return functionMap.get(name); } - public static void addFunction(String name, DynamicFunction function) { + public void addFunction(String name, ToolFunction function) { functionMap.put(name, function); } } diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/MistralTools.java b/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/Tools.java similarity index 69% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/MistralTools.java rename to src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/Tools.java index fff8071..5315d19 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/MistralTools.java +++ b/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/Tools.java @@ -14,14 +14,14 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -public class MistralTools { +public class Tools { @Data @Builder public static class ToolSpecification { private String functionName; - private String functionDesc; - private Map props; - private DynamicFunction toolDefinition; + private String functionDescription; + private Map properties; + private ToolFunction toolDefinition; } @Data @@ -90,14 +90,14 @@ public class MistralTools { PromptFuncDefinition.PromptFuncSpec functionDetail = new PromptFuncDefinition.PromptFuncSpec(); functionDetail.setName(spec.getFunctionName()); - functionDetail.setDescription(spec.getFunctionDesc()); + functionDetail.setDescription(spec.getFunctionDescription()); PromptFuncDefinition.Parameters parameters = new PromptFuncDefinition.Parameters(); parameters.setType("object"); - parameters.setProperties(spec.getProps()); + parameters.setProperties(spec.getProperties()); List requiredValues = new ArrayList<>(); - for (Map.Entry p : spec.getProps().entrySet()) { + for (Map.Entry p : spec.getProperties().entrySet()) { if (p.getValue().isRequired()) { requiredValues.add(p.getKey()); } @@ -109,31 +109,5 @@ public class MistralTools { tools.add(def); return this; } -// -// public PromptBuilder withToolSpecification(String functionName, String functionDesc, Map props) { -// PromptFuncDefinition def = new PromptFuncDefinition(); -// def.setType("function"); -// -// PromptFuncDefinition.PromptFuncSpec functionDetail = new PromptFuncDefinition.PromptFuncSpec(); -// functionDetail.setName(functionName); -// functionDetail.setDescription(functionDesc); -// -// PromptFuncDefinition.Parameters parameters = new PromptFuncDefinition.Parameters(); -// parameters.setType("object"); -// parameters.setProperties(props); -// -// List requiredValues = new ArrayList<>(); -// for (Map.Entry p : props.entrySet()) { -// if (p.getValue().isRequired()) { -// requiredValues.add(p.getKey()); -// } -// } -// parameters.setRequired(requiredValues); -// functionDetail.setParameters(parameters); -// def.setFunction(functionDetail); -// -// tools.add(def); -// return this; -// } } } -- 2.47.2 From 677362abbf2f0b4697c2482a579c61973561088f Mon Sep 17 00:00:00 2001 From: "koujalgi.amith@gmail.com" Date: Sun, 14 Jul 2024 11:35:45 +0530 Subject: [PATCH 048/101] updated README.md Signed-off-by: koujalgi.amith@gmail.com --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 62b7373..0be313f 100644 --- a/README.md +++ b/README.md @@ -78,15 +78,16 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). #### Installation -Check the releases [here](https://github.com/amithkoujalgi/ollama4j/releases) and update the dependency version -according to your requirements. - [![][ollama4j-releases-shield]][ollama4j-releases-link] [ollama4j-releases-link]: https://github.com/amithkoujalgi/ollama4j/releases [ollama4j-releases-shield]: https://img.shields.io/github/v/release/amithkoujalgi/ollama4j?include_prereleases&display_name=release&style=for-the-badge&label=Latest%20Release +> [!NOTE] +> Check the releases [here](https://github.com/amithkoujalgi/ollama4j/releases) and update the dependency version +> according to your requirements. + ##### For Maven 1. In your Maven project, add this dependency: -- 2.47.2 From df402efaba420ab6efed1e9303d5361d56ac5685 Mon Sep 17 00:00:00 2001 From: "koujalgi.amith@gmail.com" Date: Sun, 14 Jul 2024 11:37:47 +0530 Subject: [PATCH 049/101] updated README.md Signed-off-by: koujalgi.amith@gmail.com --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0be313f..a129b03 100644 --- a/README.md +++ b/README.md @@ -173,7 +173,8 @@ dependencies { #### API Spec -Find the full API specifications on the [website](https://amithkoujalgi.github.io/ollama4j/). +> [!TIP] +> Find the full API specifications on the [website](https://amithkoujalgi.github.io/ollama4j/). #### Development -- 2.47.2 From d470f940b039de094fec281146c3fca6c06d9c36 Mon Sep 17 00:00:00 2001 From: "koujalgi.amith@gmail.com" Date: Sun, 14 Jul 2024 11:39:36 +0530 Subject: [PATCH 050/101] updated README.md Signed-off-by: koujalgi.amith@gmail.com --- docs/docs/apis-generate/generate-with-tools.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/docs/apis-generate/generate-with-tools.md b/docs/docs/apis-generate/generate-with-tools.md index 86c2d83..dfa1ec0 100644 --- a/docs/docs/apis-generate/generate-with-tools.md +++ b/docs/docs/apis-generate/generate-with-tools.md @@ -129,6 +129,7 @@ Register the defined tools (`fuel price` and `weather`) with the OllamaAPI. ```shell ollamaAPI.registerTool(fuelPriceToolSpecification); ollamaAPI.registerTool(weatherToolSpecification); +ollamaAPI.registerTool(databaseQueryToolSpecification); ``` ### Create prompt with Tools -- 2.47.2 From 8a4c9fd969e25e8e8129c4c1ad031eac5f0933a2 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sun, 14 Jul 2024 13:27:23 +0530 Subject: [PATCH 051/101] Updated README.md Signed-off-by: Amith Koujalgi --- README.md | 72 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 53 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index a129b03..77628dd 100644 --- a/README.md +++ b/README.md @@ -76,21 +76,31 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). [ollama-docker-shield]: https://img.shields.io/badge/Ollama-Docker-blue.svg?style=just-the-message&labelColor=gray -#### Installation - -[![][ollama4j-releases-shield]][ollama4j-releases-link] - -[ollama4j-releases-link]: https://github.com/amithkoujalgi/ollama4j/releases - -[ollama4j-releases-shield]: https://img.shields.io/github/v/release/amithkoujalgi/ollama4j?include_prereleases&display_name=release&style=for-the-badge&label=Latest%20Release +## Installation > [!NOTE] > Check the releases [here](https://github.com/amithkoujalgi/ollama4j/releases) and update the dependency version > according to your requirements. -##### For Maven +### For Maven -1. In your Maven project, add this dependency: +#### Using [JitPack](https://jitpack.io/) + +[![](https://jitpack.io/v/amithkoujalgi/ollama4j.svg)](https://jitpack.io/#amithkoujalgi/ollama4j) + +1. Add `jitpack.io` repository to your project's `pom.xml` or your `settings.xml`: + +```xml + + + + jitpack.io + https://jitpack.io + + +``` + +2. In your Maven project, add this dependency: ```xml @@ -101,7 +111,15 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). ``` -2. Add repository to your project's pom.xml: +#### Using GitHub's Maven Package Repository + +[![][ollama4j-releases-shield]][ollama4j-releases-link] + +[ollama4j-releases-link]: https://github.com/amithkoujalgi/ollama4j/releases + +[ollama4j-releases-shield]: https://img.shields.io/github/v/release/amithkoujalgi/ollama4j?display_name=release&style=for-the-badge&label=GitHub%20Packages%20Release + +1. Add `GitHub Maven Packages` repository to your project's `pom.xml` or your `settings.xml`: ```xml @@ -120,7 +138,7 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). ``` -3. Add GitHub server to settings.xml. (Usually available at ~/.m2/settings.xml) +2. Add `GitHub` server to settings.xml. (Usually available at ~/.m2/settings.xml) ```xml @@ -138,22 +156,38 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). ``` +3. In your Maven project, add this dependency: + +```xml + + + io.github.amithkoujalgi + ollama4j + 1.0.74 + +``` + ##### For Gradle -In your Gradle project, add the dependency using the Kotlin DSL or the Groovy DSL: +1. Add the `JitPack` repository to your build file -```kotlin -dependencies { +Add it in your root `build.gradle` at the end of repositories: - val ollama4jVersion = "1.0.74" - - implementation("io.github.amithkoujalgi:ollama4j:$ollama4jVersion") +```groovy +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + mavenCentral() + maven { url 'https://jitpack.io' } + } } - ``` +``` + +2. Add the dependency ```groovy dependencies { - implementation("io.github.amithkoujalgi:ollama4j:1.0.74") + implementation 'com.github.amithkoujalgi:ollama4j:Tag' } ``` -- 2.47.2 From bee2908d1ed3c0bbf96c50264b18f82bd7db7e50 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sun, 14 Jul 2024 13:34:12 +0530 Subject: [PATCH 052/101] Updated README.md Signed-off-by: Amith Koujalgi --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 77628dd..d028d07 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,9 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). #### Using [JitPack](https://jitpack.io/) -[![](https://jitpack.io/v/amithkoujalgi/ollama4j.svg)](https://jitpack.io/#amithkoujalgi/ollama4j) +[//]: # ([![](https://jitpack.io/v/amithkoujalgi/ollama4j.svg)](https://jitpack.io/#amithkoujalgi/ollama4j)) + +![JitPack](https://img.shields.io/jitpack/version/io.github.amithkoujalgi/ollama4j?style=for-the-badge&label=From%20JitPack) 1. Add `jitpack.io` repository to your project's `pom.xml` or your `settings.xml`: @@ -117,7 +119,7 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). [ollama4j-releases-link]: https://github.com/amithkoujalgi/ollama4j/releases -[ollama4j-releases-shield]: https://img.shields.io/github/v/release/amithkoujalgi/ollama4j?display_name=release&style=for-the-badge&label=GitHub%20Packages%20Release +[ollama4j-releases-shield]: https://img.shields.io/github/v/release/amithkoujalgi/ollama4j?display_name=release&style=for-the-badge&label=From%20GitHub%20Packages%20 1. Add `GitHub Maven Packages` repository to your project's `pom.xml` or your `settings.xml`: -- 2.47.2 From 76cad0f584c35b272c4faf99ab09ce958e178006 Mon Sep 17 00:00:00 2001 From: "koujalgi.amith@gmail.com" Date: Sun, 14 Jul 2024 22:50:54 +0530 Subject: [PATCH 053/101] updated README.md Signed-off-by: koujalgi.amith@gmail.com --- README.md | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index d028d07..700a02b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -

- ### Ollama4j

@@ -14,7 +12,7 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). ![GitHub stars](https://img.shields.io/github/stars/amithkoujalgi/ollama4j) ![GitHub forks](https://img.shields.io/github/forks/amithkoujalgi/ollama4j) ![GitHub watchers](https://img.shields.io/github/watchers/amithkoujalgi/ollama4j) -![Contributors](https://img.shields.io/github/contributors/amithkoujalgi/ollama4j) +![Contributors](https://img.shields.io/github/contributors/amithkoujalgi/ollama4j?style=social) ![GitHub License](https://img.shields.io/github/license/amithkoujalgi/ollama4j) ![GitHub repo size](https://img.shields.io/github/repo-size/amithkoujalgi/ollama4j) @@ -30,9 +28,6 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). ![Build Status](https://github.com/amithkoujalgi/ollama4j/actions/workflows/maven-publish.yml/badge.svg) - -

- [//]: # (![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Famithkoujalgi%2Follama4j&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false)) [//]: # (![GitHub language count](https://img.shields.io/github/languages/count/amithkoujalgi/ollama4j)) @@ -64,17 +59,17 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). #### Requirements -![Java](https://img.shields.io/badge/Java-11_+-green.svg?style=just-the-message&labelColor=gray) +![Java](https://img.shields.io/badge/Java-11_+-green.svg?style=for-the-badge&labelColor=gray&label=Java) [![][ollama-shield]][ollama-link] **Or** [![][ollama-docker-shield]][ollama-docker] [ollama-link]: https://ollama.ai/ -[ollama-shield]: https://img.shields.io/badge/Ollama-Local_Installation-blue.svg?style=just-the-message&labelColor=gray +[ollama-shield]: https://img.shields.io/badge/Ollama-Local_Installation-blue.svg?style=for-the-badge&labelColor=gray [ollama-docker]: https://hub.docker.com/r/ollama/ollama -[ollama-docker-shield]: https://img.shields.io/badge/Ollama-Docker-blue.svg?style=just-the-message&labelColor=gray +[ollama-docker-shield]: https://img.shields.io/badge/Ollama-Docker-blue.svg?style=for-the-badge&labelColor=gray ## Installation @@ -95,10 +90,10 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). ```xml - - jitpack.io - https://jitpack.io - + + jitpack.io + https://jitpack.io + ``` @@ -163,9 +158,9 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). ```xml - io.github.amithkoujalgi - ollama4j - 1.0.74 + io.github.amithkoujalgi + ollama4j + 1.0.74 ``` @@ -177,11 +172,11 @@ Add it in your root `build.gradle` at the end of repositories: ```groovy dependencyResolutionManagement { - repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) - repositories { - mavenCentral() - maven { url 'https://jitpack.io' } - } + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + mavenCentral() + maven { url 'https://jitpack.io' } + } } ``` @@ -189,7 +184,7 @@ dependencyResolutionManagement { ```groovy dependencies { - implementation 'com.github.amithkoujalgi:ollama4j:Tag' + implementation 'com.github.amithkoujalgi:ollama4j:Tag' } ``` -- 2.47.2 From 63a6e81ac29cadfce1a4cfc590c3dd74ef0601a9 Mon Sep 17 00:00:00 2001 From: "koujalgi.amith@gmail.com" Date: Sun, 14 Jul 2024 22:54:51 +0530 Subject: [PATCH 054/101] updated README.md Signed-off-by: koujalgi.amith@gmail.com --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 700a02b..c497248 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). #### Requirements -![Java](https://img.shields.io/badge/Java-11_+-green.svg?style=for-the-badge&labelColor=gray&label=Java) +![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] -- 2.47.2 From f03026abb3b788d92224e89b7dc2846c7570a554 Mon Sep 17 00:00:00 2001 From: "koujalgi.amith@gmail.com" Date: Sun, 14 Jul 2024 23:04:30 +0530 Subject: [PATCH 055/101] updated README.md Signed-off-by: koujalgi.amith@gmail.com --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index c497248..8db5e85 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,10 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). > Check the releases [here](https://github.com/amithkoujalgi/ollama4j/releases) and update the dependency version > according to your requirements. +> [!WARNING] +> We have migrated the package repository from Maven Central to GitHub package repository due to technical issues with +> publishing. + ### For Maven #### Using [JitPack](https://jitpack.io/) -- 2.47.2 From 1c40697c963380aeff23ad5ebbd52dd6b9d5b850 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sun, 14 Jul 2024 23:11:48 +0530 Subject: [PATCH 056/101] Update README.md --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8db5e85..998a81f 100644 --- a/README.md +++ b/README.md @@ -74,12 +74,11 @@ Find more details on the [website](https://amithkoujalgi.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 > Check the releases [here](https://github.com/amithkoujalgi/ollama4j/releases) and update the dependency version > according to your requirements. -> [!WARNING] -> We have migrated the package repository from Maven Central to GitHub package repository due to technical issues with -> publishing. ### For Maven @@ -302,4 +301,4 @@ project.

Buy Me A Coffee -

\ No newline at end of file +

-- 2.47.2 From 79d97445b8d086a3cae30dbec7aab601d3bb9b7e Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sun, 14 Jul 2024 23:13:21 +0530 Subject: [PATCH 057/101] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 998a81f..1e71d88 100644 --- a/README.md +++ b/README.md @@ -75,8 +75,9 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). > [!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 -> Check the releases [here](https://github.com/amithkoujalgi/ollama4j/releases) and update the dependency version +> publishing. Please update your repository settings to get latest version of Ollama4j. +> +> Track the releases [here](https://github.com/amithkoujalgi/ollama4j/releases) and update the dependency version > according to your requirements. -- 2.47.2 From d9f98ad901fbaac23a1724f470a258cbe4730b90 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Mon, 15 Jul 2024 22:23:46 +0530 Subject: [PATCH 058/101] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 1e71d88..238683f 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). ![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-pr-closed-raw/amithkoujalgi/ollama4j) ![GitHub Discussions](https://img.shields.io/github/discussions/amithkoujalgi/ollama4j) +![JitPack Downloads this month Badge](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fjitpack.io%2Fapi%2Fdownloads%2Fio.github.amithkoujalgi%2Follama4j&query=%24.month&label=JitPack%20Downloads%20-%20This%20Month) + ![Build Status](https://github.com/amithkoujalgi/ollama4j/actions/workflows/maven-publish.yml/badge.svg) [//]: # (![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Famithkoujalgi%2Follama4j&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false)) -- 2.47.2 From c6141634dbc396cd879859513ed582f2e46f74af Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Mon, 15 Jul 2024 22:29:36 +0530 Subject: [PATCH 059/101] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 238683f..63ab4db 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,8 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). ![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-pr-closed-raw/amithkoujalgi/ollama4j) ![GitHub Discussions](https://img.shields.io/github/discussions/amithkoujalgi/ollama4j) -![JitPack Downloads this month Badge](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fjitpack.io%2Fapi%2Fdownloads%2Fio.github.amithkoujalgi%2Follama4j&query=%24.month&label=JitPack%20Downloads%20-%20This%20Month) +![JitPack Downloads This Month Badge](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fjitpack.io%2Fapi%2Fdownloads%2Fio.github.amithkoujalgi%2Follama4j&query=%24.month&label=JitPack%20Downloads%20-%20This%20Month) +![JitPack Downloads This Month Week](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fjitpack.io%2Fapi%2Fdownloads%2Fio.github.amithkoujalgi%2Follama4j&query=%24.week&label=JitPack%20Downloads%20-%20This%20Week) ![Build Status](https://github.com/amithkoujalgi/ollama4j/actions/workflows/maven-publish.yml/badge.svg) -- 2.47.2 From f3778f8786d98b0b53ad5f9dbc928fc3ae7ed002 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Mon, 15 Jul 2024 22:52:11 +0530 Subject: [PATCH 060/101] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 63ab4db..6d6ae8a 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). ![JitPack Downloads This Month Badge](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fjitpack.io%2Fapi%2Fdownloads%2Fio.github.amithkoujalgi%2Follama4j&query=%24.month&label=JitPack%20Downloads%20-%20This%20Month) ![JitPack Downloads This Month Week](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fjitpack.io%2Fapi%2Fdownloads%2Fio.github.amithkoujalgi%2Follama4j&query=%24.week&label=JitPack%20Downloads%20-%20This%20Week) +![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/amithkoujalgi/ollama4j/total?label=GitHub%20Package%20Downloads) ![Build Status](https://github.com/amithkoujalgi/ollama4j/actions/workflows/maven-publish.yml/badge.svg) -- 2.47.2 From 02116b7025c6a78e46b850a314730e4429918512 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Mon, 15 Jul 2024 22:57:01 +0530 Subject: [PATCH 061/101] Create CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 128 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..1739c61 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,128 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +koujalgi.amith@gmail.com. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. -- 2.47.2 From 2f8577a24d488f00e6d332d9d38b645fac4f9a7d Mon Sep 17 00:00:00 2001 From: "koujalgi.amith@gmail.com" Date: Tue, 16 Jul 2024 09:42:47 +0530 Subject: [PATCH 062/101] updated README.md Signed-off-by: koujalgi.amith@gmail.com --- README.md | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 6d6ae8a..aa9d5dd 100644 --- a/README.md +++ b/README.md @@ -15,23 +15,20 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). ![Contributors](https://img.shields.io/github/contributors/amithkoujalgi/ollama4j?style=social) ![GitHub License](https://img.shields.io/github/license/amithkoujalgi/ollama4j) -![GitHub repo size](https://img.shields.io/github/repo-size/amithkoujalgi/ollama4j) -![GitHub top language](https://img.shields.io/github/languages/top/amithkoujalgi/ollama4j) -![GitHub last commit](https://img.shields.io/github/last-commit/amithkoujalgi/ollama4j?color=green) -[![codecov](https://codecov.io/gh/amithkoujalgi/ollama4j/graph/badge.svg?token=U0TE7BGP8L)](https://codecov.io/gh/amithkoujalgi/ollama4j) +[//]: # (![GitHub repo size](https://img.shields.io/github/repo-size/amithkoujalgi/ollama4j)) + +[//]: # (![GitHub top language](https://img.shields.io/github/languages/top/amithkoujalgi/ollama4j)) -![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-raw/amithkoujalgi/ollama4j) -![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-closed-raw/amithkoujalgi/ollama4j) -![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-pr-raw/amithkoujalgi/ollama4j) -![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-pr-closed-raw/amithkoujalgi/ollama4j) -![GitHub Discussions](https://img.shields.io/github/discussions/amithkoujalgi/ollama4j) ![JitPack Downloads This Month Badge](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fjitpack.io%2Fapi%2Fdownloads%2Fio.github.amithkoujalgi%2Follama4j&query=%24.month&label=JitPack%20Downloads%20-%20This%20Month) ![JitPack Downloads This Month Week](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fjitpack.io%2Fapi%2Fdownloads%2Fio.github.amithkoujalgi%2Follama4j&query=%24.week&label=JitPack%20Downloads%20-%20This%20Week) ![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/amithkoujalgi/ollama4j/total?label=GitHub%20Package%20Downloads) +![GitHub last commit](https://img.shields.io/github/last-commit/amithkoujalgi/ollama4j?color=green) +[![codecov](https://codecov.io/gh/amithkoujalgi/ollama4j/graph/badge.svg?token=U0TE7BGP8L)](https://codecov.io/gh/amithkoujalgi/ollama4j) ![Build Status](https://github.com/amithkoujalgi/ollama4j/actions/workflows/maven-publish.yml/badge.svg) + [//]: # (![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Famithkoujalgi%2Follama4j&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false)) [//]: # (![GitHub language count](https://img.shields.io/github/languages/count/amithkoujalgi/ollama4j)) @@ -84,7 +81,6 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). > Track the releases [here](https://github.com/amithkoujalgi/ollama4j/releases) and update the dependency version > according to your requirements. - ### For Maven #### Using [JitPack](https://jitpack.io/) @@ -281,6 +277,28 @@ Newer artifacts are published via GitHub Actions CI workflow when a new release ### Get Involved + + + +[//]: # (![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-raw/amithkoujalgi/ollama4j)) + +[//]: # (![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-closed-raw/amithkoujalgi/ollama4j)) + +[//]: # (![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-pr-raw/amithkoujalgi/ollama4j)) + +[//]: # (![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-pr-closed-raw/amithkoujalgi/ollama4j)) + +[//]: # (![GitHub Discussions](https://img.shields.io/github/discussions/amithkoujalgi/ollama4j)) + + Contributions are most welcome! Whether it's reporting a bug, proposing an enhancement, or helping with code - any sort of contribution is much appreciated. -- 2.47.2 From 5c9e0b7d8aa16386312de93caca5657515d2b578 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Tue, 16 Jul 2024 23:40:12 +0530 Subject: [PATCH 063/101] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index aa9d5dd..4d99a7b 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). ![JitPack Downloads This Month Badge](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fjitpack.io%2Fapi%2Fdownloads%2Fio.github.amithkoujalgi%2Follama4j&query=%24.month&label=JitPack%20Downloads%20-%20This%20Month) ![JitPack Downloads This Month Week](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fjitpack.io%2Fapi%2Fdownloads%2Fio.github.amithkoujalgi%2Follama4j&query=%24.week&label=JitPack%20Downloads%20-%20This%20Week) +https://jitpack.io/v/amithkoujalgi/ollama4j/month.svg ![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/amithkoujalgi/ollama4j/total?label=GitHub%20Package%20Downloads) ![GitHub last commit](https://img.shields.io/github/last-commit/amithkoujalgi/ollama4j?color=green) -- 2.47.2 From 4cbb783a61fafc613ae9150cb3e4682f06bc6f18 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Tue, 16 Jul 2024 23:41:29 +0530 Subject: [PATCH 064/101] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4d99a7b..157647b 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,8 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). ![JitPack Downloads This Month Badge](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fjitpack.io%2Fapi%2Fdownloads%2Fio.github.amithkoujalgi%2Follama4j&query=%24.month&label=JitPack%20Downloads%20-%20This%20Month) -![JitPack Downloads This Month Week](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fjitpack.io%2Fapi%2Fdownloads%2Fio.github.amithkoujalgi%2Follama4j&query=%24.week&label=JitPack%20Downloads%20-%20This%20Week) -https://jitpack.io/v/amithkoujalgi/ollama4j/month.svg +![JitPack Downloads This Week Badge](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fjitpack.io%2Fapi%2Fdownloads%2Fio.github.amithkoujalgi%2Follama4j&query=%24.week&label=JitPack%20Downloads%20-%20This%20Week) +![JitPack Downloads Per Month Badge](https://jitpack.io/v/amithkoujalgi/ollama4j/month.svg) ![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/amithkoujalgi/ollama4j/total?label=GitHub%20Package%20Downloads) ![GitHub last commit](https://img.shields.io/github/last-commit/amithkoujalgi/ollama4j?color=green) -- 2.47.2 From f2f740a2a02c57a34808be3e0f6c10dbdfb7bd47 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Tue, 16 Jul 2024 23:42:47 +0530 Subject: [PATCH 065/101] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 157647b..7a0cdd4 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). ![JitPack Downloads This Month Badge](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fjitpack.io%2Fapi%2Fdownloads%2Fio.github.amithkoujalgi%2Follama4j&query=%24.month&label=JitPack%20Downloads%20-%20This%20Month) ![JitPack Downloads This Week Badge](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fjitpack.io%2Fapi%2Fdownloads%2Fio.github.amithkoujalgi%2Follama4j&query=%24.week&label=JitPack%20Downloads%20-%20This%20Week) -![JitPack Downloads Per Month Badge](https://jitpack.io/v/amithkoujalgi/ollama4j/month.svg) +![JitPack Downloads Per Month Badge](https://jitpack.io/v/amithkoujalgi/ollama4j/month.svg?label=JitPack%20Downloads%20-%20Per%20Month) ![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/amithkoujalgi/ollama4j/total?label=GitHub%20Package%20Downloads) ![GitHub last commit](https://img.shields.io/github/last-commit/amithkoujalgi/ollama4j?color=green) -- 2.47.2 From bc4e8303aa09f20d2b26bcb0fb8b0e7b120ca949 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Tue, 16 Jul 2024 23:43:55 +0530 Subject: [PATCH 066/101] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7a0cdd4..157647b 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). ![JitPack Downloads This Month Badge](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fjitpack.io%2Fapi%2Fdownloads%2Fio.github.amithkoujalgi%2Follama4j&query=%24.month&label=JitPack%20Downloads%20-%20This%20Month) ![JitPack Downloads This Week Badge](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fjitpack.io%2Fapi%2Fdownloads%2Fio.github.amithkoujalgi%2Follama4j&query=%24.week&label=JitPack%20Downloads%20-%20This%20Week) -![JitPack Downloads Per Month Badge](https://jitpack.io/v/amithkoujalgi/ollama4j/month.svg?label=JitPack%20Downloads%20-%20Per%20Month) +![JitPack Downloads Per Month Badge](https://jitpack.io/v/amithkoujalgi/ollama4j/month.svg) ![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/amithkoujalgi/ollama4j/total?label=GitHub%20Package%20Downloads) ![GitHub last commit](https://img.shields.io/github/last-commit/amithkoujalgi/ollama4j?color=green) -- 2.47.2 From cfa8aa14d7f38ccabf38969dcfa4ff1ab5506396 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Fri, 26 Jul 2024 23:57:19 +0530 Subject: [PATCH 067/101] updated publishing config --- .github/workflows/gh-mvn-publish.yml | 58 ++++++++++ .github/workflows/maven-publish.yml | 68 +++++++++-- pom.xml | 162 +++++++++++++-------------- 3 files changed, 200 insertions(+), 88 deletions(-) create mode 100644 .github/workflows/gh-mvn-publish.yml diff --git a/.github/workflows/gh-mvn-publish.yml b/.github/workflows/gh-mvn-publish.yml new file mode 100644 index 0000000..3070e3e --- /dev/null +++ b/.github/workflows/gh-mvn-publish.yml @@ -0,0 +1,58 @@ +name: Release Artifacts to GitHub Maven Packages + +on: + release: + types: [ created ] + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + server-id: github + settings-path: ${{ github.workspace }} + + - name: maven-settings-xml-action + uses: whelk-io/maven-settings-xml-action@v22 + with: + servers: '[{ "id": "${repo.id}", "username": "${repo.user}", "password": "${repo.pass}" }]' + + - name: Find and Replace + uses: jacobtomlinson/gha-find-replace@v3 + with: + find: "ollama4j-revision" + replace: ${{ github.ref_name }} + regex: false + + - name: Find and Replace + uses: jacobtomlinson/gha-find-replace@v3 + with: + find: "mvn-repo-id" + replace: github + regex: false + + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@v6 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.GPG_PASSPHRASE }} + - name: List keys + run: gpg -K + + - name: Build with Maven + run: mvn --file pom.xml -U clean package -Punit-tests + + - name: Publish to GitHub Packages Apache Maven + run: mvn deploy -Punit-tests -s $GITHUB_WORKSPACE/settings.xml -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} -Drepo.id=github -Drepo.user=${{ secrets.GH_MVN_USER }} -Drepo.pass=${{ secrets.GH_MVN_PASS }} -DaltDeploymentRepository=github::default::https://maven.pkg.github.com/ollama4j/ollama4j + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 7b2466a..036ccb6 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -1,22 +1,31 @@ # This workflow will build a package using Maven and then publish it to GitHub packages when a release is created # For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path -name: Release Artifacts +name: Release Artifacts to Maven Central on: release: types: [ created ] + +#on: +# pull_request: +# types: [ opened, reopened ] +# branches: [ "main" ] + + jobs: build: runs-on: ubuntu-latest + permissions: - contents: read + contents: write packages: write steps: - uses: actions/checkout@v3 + - name: Set up JDK 17 uses: actions/setup-java@v3 with: @@ -25,6 +34,19 @@ jobs: server-id: github # Value of the distributionManagement/repository/id field of the pom.xml settings-path: ${{ github.workspace }} # location for the settings.xml file + - name: maven-settings-xml-action + uses: whelk-io/maven-settings-xml-action@v22 + with: + servers: '[{ "id": "${repo.id}", "username": "${repo.user}", "password": "${repo.pass}" }]' + + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@v6 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.GPG_PASSPHRASE }} + - name: List keys + run: gpg -K + - name: Find and Replace uses: jacobtomlinson/gha-find-replace@v3 with: @@ -32,10 +54,42 @@ jobs: replace: ${{ github.ref_name }} regex: false - - name: Build with Maven - run: mvn --file pom.xml -U clean package -Punit-tests + - name: Find and Replace + uses: jacobtomlinson/gha-find-replace@v3 + with: + find: "mvn-repo-id" + replace: central + regex: false - - name: Publish to GitHub Packages Apache Maven - run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml --file pom.xml + - name: Publish to Maven Central + run: mvn deploy -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} -Drepo.id=central -Drepo.user=${{ secrets.MVN_USER }} -Drepo.pass=${{ secrets.MVN_PASS }} + + - name: Upload Release Asset - JAR + uses: actions/upload-release-asset@v1 env: - GITHUB_TOKEN: ${{ github.token }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: target/ollama4j-${{ github.ref_name }}.jar + asset_name: ollama4j-${{ github.ref_name }}.jar + asset_content_type: application/x-jar + + - name: Upload Release Asset - Javadoc JAR + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: target/ollama4j-${{ github.ref_name }}-javadoc.jar + asset_name: ollama4j-${{ github.ref_name }}-javadoc.jar + asset_content_type: application/x-jar + + - name: Upload Release Asset - Sources JAR + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: target/ollama4j-${{ github.ref_name }}-sources.jar + asset_name: ollama4j-${{ github.ref_name }}-sources.jar + asset_content_type: application/x-jar \ No newline at end of file diff --git a/pom.xml b/pom.xml index 5b70591..231756a 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - io.github.amithkoujalgi + io.github.ollama4j ollama4j ollama4j-revision @@ -41,7 +41,7 @@ scm:git:git@github.com:amithkoujalgi/ollama4j.git scm:git:https://github.com/amithkoujalgi/ollama4j.git https://github.com/amithkoujalgi/ollama4j - v1.0.16 + ollama4j-revision @@ -72,27 +72,7 @@ - - - - - - - - - - - - - - - - - - - - - + org.apache.maven.plugins @@ -129,15 +109,23 @@ - - - - - - - - - + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + +
@@ -189,27 +177,39 @@ - - - - - - - - - - - - - github - GitHub Packages - https://maven.pkg.github.com/amithkoujalgi/ollama4j + mvn-repo-id + + ossrh + + true + + + gpg2 + unit + false + true + + + + + org.sonatype.central + central-publishing-maven-plugin + 0.5.0 + true + + mvn-repo-id + false + + + + + unit-tests @@ -218,7 +218,7 @@ true - true + false @@ -261,39 +261,39 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + org.apache.maven.plugins + maven-gpg-plugin + 3.1.0 + + + sign-artifacts + verify + + sign + + + + + --pinentry-mode + loopback + + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.13 + true + + ossrh + https://s01.oss.sonatype.org/ + true + + org.jacoco -- 2.47.2 From da273402b56617a249c44214b7f044eec639380d Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 27 Jul 2024 00:16:44 +0530 Subject: [PATCH 068/101] updated links --- Makefile | 4 +- README.md | 130 +++++++++++++++++++++--------------------------------- pom.xml | 2 +- 3 files changed, 53 insertions(+), 83 deletions(-) diff --git a/Makefile b/Makefile index 6ec1612..7c5f2df 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ build: mvn -B clean install -ut: +unit-tests: mvn clean test -Punit-tests -it: +integration-tests: mvn clean verify -Pintegration-tests doxygen: diff --git a/README.md b/README.md index 157647b..c733cce 100644 --- a/README.md +++ b/README.md @@ -1,46 +1,46 @@ ### Ollama4j

- ollama4j-icon + ollama4j-icon

A Java library (wrapper/binding) for [Ollama](https://ollama.ai/) server. -Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). +Find more details on the [website](https://ollama4j.github.io/ollama4j/). -![GitHub stars](https://img.shields.io/github/stars/amithkoujalgi/ollama4j) -![GitHub forks](https://img.shields.io/github/forks/amithkoujalgi/ollama4j) -![GitHub watchers](https://img.shields.io/github/watchers/amithkoujalgi/ollama4j) -![Contributors](https://img.shields.io/github/contributors/amithkoujalgi/ollama4j?style=social) -![GitHub License](https://img.shields.io/github/license/amithkoujalgi/ollama4j) +![GitHub stars](https://img.shields.io/github/stars/ollama4j/ollama4j) +![GitHub forks](https://img.shields.io/github/forks/ollama4j/ollama4j) +![GitHub watchers](https://img.shields.io/github/watchers/ollama4j/ollama4j) +![Contributors](https://img.shields.io/github/contributors/ollama4j/ollama4j?style=social) +![GitHub License](https://img.shields.io/github/license/ollama4j/ollama4j) -[//]: # (![GitHub repo size](https://img.shields.io/github/repo-size/amithkoujalgi/ollama4j)) +[//]: # (![GitHub repo size](https://img.shields.io/github/repo-size/ollama4j/ollama4j)) -[//]: # (![GitHub top language](https://img.shields.io/github/languages/top/amithkoujalgi/ollama4j)) +[//]: # (![GitHub top language](https://img.shields.io/github/languages/top/ollama4j/ollama4j)) -![JitPack Downloads This Month Badge](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fjitpack.io%2Fapi%2Fdownloads%2Fio.github.amithkoujalgi%2Follama4j&query=%24.month&label=JitPack%20Downloads%20-%20This%20Month) -![JitPack Downloads This Week Badge](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fjitpack.io%2Fapi%2Fdownloads%2Fio.github.amithkoujalgi%2Follama4j&query=%24.week&label=JitPack%20Downloads%20-%20This%20Week) -![JitPack Downloads Per Month Badge](https://jitpack.io/v/amithkoujalgi/ollama4j/month.svg) -![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/amithkoujalgi/ollama4j/total?label=GitHub%20Package%20Downloads) +[//]: # (![JitPack Downloads This Month Badge](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)) +[//]: # (![JitPack Downloads This Week Badge](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)) +[//]: # (![JitPack Downloads Per Month Badge](https://jitpack.io/v/ollama4j/ollama4j/month.svg)) +![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/ollama4j/ollama4j/total?label=GitHub%20Package%20Downloads) -![GitHub last commit](https://img.shields.io/github/last-commit/amithkoujalgi/ollama4j?color=green) -[![codecov](https://codecov.io/gh/amithkoujalgi/ollama4j/graph/badge.svg?token=U0TE7BGP8L)](https://codecov.io/gh/amithkoujalgi/ollama4j) -![Build Status](https://github.com/amithkoujalgi/ollama4j/actions/workflows/maven-publish.yml/badge.svg) +![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) +![Build Status](https://github.com/ollama4j/ollama4j/actions/workflows/maven-publish.yml/badge.svg) -[//]: # (![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Famithkoujalgi%2Follama4j&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false)) +[//]: # (![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Follama4j%2Follama4j&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false)) -[//]: # (![GitHub language count](https://img.shields.io/github/languages/count/amithkoujalgi/ollama4j)) +[//]: # (![GitHub language count](https://img.shields.io/github/languages/count/ollama4j/ollama4j)) ## Table of Contents - [How does it work?](#how-does-it-work) - [Requirements](#requirements) - [Installation](#installation) -- [API Spec](https://amithkoujalgi.github.io/ollama4j/docs/category/apis---model-management) -- [Javadoc](https://amithkoujalgi.github.io/ollama4j/apidocs/) +- [API Spec](https://ollama4j.github.io/ollama4j/docs/category/apis---model-management) +- [Javadoc](https://ollama4j.github.io/ollama4j/apidocs/) - [Development](#development) - [Contributions](#get-involved) - [References](#references) @@ -79,37 +79,21 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). > 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. > -> Track the releases [here](https://github.com/amithkoujalgi/ollama4j/releases) and update the dependency version +> Track the releases [here](https://github.com/ollama4j/ollama4j/releases) and update the dependency version > according to your requirements. ### For Maven -#### Using [JitPack](https://jitpack.io/) +#### Using [Maven Central](https://central.sonatype.com/) -[//]: # ([![](https://jitpack.io/v/amithkoujalgi/ollama4j.svg)](https://jitpack.io/#amithkoujalgi/ollama4j)) - -![JitPack](https://img.shields.io/jitpack/version/io.github.amithkoujalgi/ollama4j?style=for-the-badge&label=From%20JitPack) - -1. Add `jitpack.io` repository to your project's `pom.xml` or your `settings.xml`: - -```xml - - - - jitpack.io - https://jitpack.io - - -``` - -2. In your Maven project, add this dependency: +1In your Maven project, add this dependency: ```xml - io.github.amithkoujalgi + io.github.ollama4j ollama4j - 1.0.74 + 1.0.78 ``` @@ -117,9 +101,9 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). [![][ollama4j-releases-shield]][ollama4j-releases-link] -[ollama4j-releases-link]: https://github.com/amithkoujalgi/ollama4j/releases +[ollama4j-releases-link]: https://github.com/ollama4j/ollama4j/releases -[ollama4j-releases-shield]: https://img.shields.io/github/v/release/amithkoujalgi/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%20 1. Add `GitHub Maven Packages` repository to your project's `pom.xml` or your `settings.xml`: @@ -129,7 +113,7 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). github GitHub Apache Maven Packages - https://maven.pkg.github.com/amithkoujalgi/ollama4j + https://maven.pkg.github.com/ollama4j/ollama4j true @@ -163,33 +147,19 @@ Find more details on the [website](https://amithkoujalgi.github.io/ollama4j/). ```xml - io.github.amithkoujalgi + io.github.ollama4j ollama4j - 1.0.74 + 1.0.78 ``` ##### For Gradle -1. Add the `JitPack` repository to your build file - -Add it in your root `build.gradle` at the end of repositories: - -```groovy -dependencyResolutionManagement { - repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) - repositories { - mavenCentral() - maven { url 'https://jitpack.io' } - } -} -``` - -2. Add the dependency +1. Add the dependency ```groovy dependencies { - implementation 'com.github.amithkoujalgi:ollama4j:Tag' + implementation 'com.github.ollama4j:ollama4j:Tag' } ``` @@ -197,20 +167,20 @@ dependencies { [//]: # () -[//]: # (![Maven Central](https://img.shields.io/maven-central/v/io.github.amithkoujalgi/ollama4j)) +[//]: # (![Maven Central](https://img.shields.io/maven-central/v/io.github.ollama4j/ollama4j)) [//]: # () [//]: # ([![][lib-shield]][lib]) -[lib]: https://central.sonatype.com/artifact/io.github.amithkoujalgi/ollama4j +[lib]: https://central.sonatype.com/artifact/io.github.ollama4j/ollama4j [lib-shield]: https://img.shields.io/badge/ollama4j-get_latest_version-blue.svg?style=just-the-message&labelColor=gray #### API Spec > [!TIP] -> Find the full API specifications on the [website](https://amithkoujalgi.github.io/ollama4j/). +> Find the full API specifications on the [website](https://ollama4j.github.io/ollama4j/). #### Development @@ -223,13 +193,13 @@ make build Run unit tests: ```shell -make ut +make unit-tests ``` Run integration tests: ```shell -make it +make integration-tests ``` #### Releases @@ -248,7 +218,7 @@ Newer artifacts are published via GitHub Actions CI workflow when a new release #### Traction -[![Star History Chart](https://api.star-history.com/svg?repos=amithkoujalgi/ollama4j&type=Date)](https://star-history.com/#amithkoujalgi/ollama4j&Date) +[![Star History Chart](https://api.star-history.com/svg?repos=ollama4j/ollama4j&type=Date)](https://star-history.com/#ollama4j/ollama4j&Date) ### Areas of improvement @@ -280,24 +250,24 @@ Newer artifacts are published via GitHub Actions CI workflow when a new release
-![Open Issues](https://img.shields.io/github/issues-raw/amithkoujalgi/ollama4j) -![Closed Issues](https://img.shields.io/github/issues-closed-raw/amithkoujalgi/ollama4j) -![Open PRs](https://img.shields.io/github/issues-pr-raw/amithkoujalgi/ollama4j) -![Closed PRs](https://img.shields.io/github/issues-pr-closed-raw/amithkoujalgi/ollama4j) -![Discussions](https://img.shields.io/github/discussions/amithkoujalgi/ollama4j) +![Open Issues](https://img.shields.io/github/issues-raw/ollama4j/ollama4j) +![Closed Issues](https://img.shields.io/github/issues-closed-raw/ollama4j/ollama4j) +![Open PRs](https://img.shields.io/github/issues-pr-raw/ollama4j/ollama4j) +![Closed PRs](https://img.shields.io/github/issues-pr-closed-raw/ollama4j/ollama4j) +![Discussions](https://img.shields.io/github/discussions/ollama4j/ollama4j)
-[//]: # (![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-raw/amithkoujalgi/ollama4j)) +[//]: # (![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-raw/ollama4j/ollama4j)) -[//]: # (![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-closed-raw/amithkoujalgi/ollama4j)) +[//]: # (![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-closed-raw/ollama4j/ollama4j)) -[//]: # (![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-pr-raw/amithkoujalgi/ollama4j)) +[//]: # (![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-pr-raw/ollama4j/ollama4j)) -[//]: # (![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-pr-closed-raw/amithkoujalgi/ollama4j)) +[//]: # (![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-pr-closed-raw/ollama4j/ollama4j)) -[//]: # (![GitHub Discussions](https://img.shields.io/github/discussions/amithkoujalgi/ollama4j)) +[//]: # (![GitHub Discussions](https://img.shields.io/github/discussions/ollama4j/ollama4j)) Contributions are most welcome! Whether it's reporting a bug, proposing an enhancement, or helping @@ -316,8 +286,8 @@ project. **Thanks to the amazing contributors**

- - + +

diff --git a/pom.xml b/pom.xml index 231756a..305405a 100644 --- a/pom.xml +++ b/pom.xml @@ -204,7 +204,7 @@ true mvn-repo-id - false + true
-- 2.47.2 From 4589a9032c10399197535769a05ff943e3ac02bf Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 27 Jul 2024 00:21:34 +0530 Subject: [PATCH 069/101] updated links --- docs/blog/2023-12-22-release-post.md | 2 +- docs/docs/apis-extras/options-builder.md | 2 +- docs/docs/apis-generate/generate.md | 2 +- docs/docusaurus.config.js | 14 +++++++------- pom.xml | 10 +++++----- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/blog/2023-12-22-release-post.md b/docs/blog/2023-12-22-release-post.md index 0a0b95d..4a9f020 100644 --- a/docs/blog/2023-12-22-release-post.md +++ b/docs/blog/2023-12-22-release-post.md @@ -11,7 +11,7 @@ Hey there, my fellow Java Developers! 🚀 I am glad to announce the release of Ollama4j, a library that unites Ollama (an LLM manager and runner) and your Java applications! 🌐🚀 -👉 GitHub Repository: Ollama4j on GitHub (https://github.com/amithkoujalgi/ollama4j) +👉 GitHub Repository: Ollama4j on GitHub (https://github.com/ollama4j/ollama4j) 🌟 Key Features: diff --git a/docs/docs/apis-extras/options-builder.md b/docs/docs/apis-extras/options-builder.md index 7fb7d68..f7f8ed8 100644 --- a/docs/docs/apis-extras/options-builder.md +++ b/docs/docs/apis-extras/options-builder.md @@ -31,7 +31,7 @@ Link to [source](https://github.com/jmorganca/ollama/blob/main/docs/modelfile.md Also, see how to set those Ollama parameters using the `OptionsBuilder` -from [javadoc](https://amithkoujalgi.github.io/ollama4j/apidocs/io/github/amithkoujalgi/ollama4j/core/utils/OptionsBuilder.html). +from [javadoc](https://ollama4j.github.io/ollama4j/apidocs/io/github/ollama4j/ollama4j/core/utils/OptionsBuilder.html). ## Build an empty `Options` object diff --git a/docs/docs/apis-generate/generate.md b/docs/docs/apis-generate/generate.md index 0469f26..4754c54 100644 --- a/docs/docs/apis-generate/generate.md +++ b/docs/docs/apis-generate/generate.md @@ -141,7 +141,7 @@ public class Main { ``` _Note: Here I've used -a [sample prompt](https://github.com/amithkoujalgi/ollama4j/blob/main/src/main/resources/sample-db-prompt-template.txt) +a [sample prompt](https://github.com/ollama4j/ollama4j/blob/main/src/main/resources/sample-db-prompt-template.txt) containing a database schema from within this library for demonstration purposes._ You'd then get a response from the model: diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index f675c8a..341048c 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -20,7 +20,7 @@ const config = { // GitHub pages deployment config. // If you aren't using GitHub pages, you don't need these. - organizationName: 'amithkoujalgi', // Usually your GitHub org/user name. + organizationName: 'ollama4j', // Usually your GitHub org/user name. projectName: 'ollama4j', // Usually your repo name. onBrokenLinks: 'throw', @@ -46,14 +46,14 @@ const config = { // Please change this to your repo. // Remove this to remove the "edit this page" links. editUrl: - 'https://github.com/amithkoujalgi/ollama4j/blob/main/docs', + 'https://github.com/ollama4j/ollama4j/blob/main/docs', }, blog: { showReadingTime: true, // Please change this to your repo. // Remove this to remove the "edit this page" links. editUrl: - 'https://github.com/amithkoujalgi/ollama4j/blob/main/docs', + 'https://github.com/ollama4j/ollama4j/blob/main/docs', }, theme: { customCss: './src/css/custom.css', @@ -80,11 +80,11 @@ const config = { position: 'left', label: 'Docs', }, - {to: 'https://amithkoujalgi.github.io/ollama4j/apidocs/', label: 'Javadoc', position: 'left'}, - {to: 'https://amithkoujalgi.github.io/ollama4j/doxygen/html/', label: 'Doxygen', position: 'left'}, + {to: 'https://ollama4j.github.io/ollama4j/apidocs/', label: 'Javadoc', position: 'left'}, + {to: 'https://ollama4j.github.io/ollama4j/doxygen/html/', label: 'Doxygen', position: 'left'}, {to: '/blog', label: 'Blog', position: 'left'}, { - href: 'https://github.com/amithkoujalgi/ollama4j', + href: 'https://github.com/ollama4j/ollama4j', label: 'GitHub', position: 'right', }, @@ -124,7 +124,7 @@ const config = { }, { label: 'GitHub', - href: 'https://github.com/amithkoujalgi/ollama4j', + href: 'https://github.com/ollama4j/ollama4j', }, ], }, diff --git a/pom.xml b/pom.xml index 305405a..71bdf02 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ Ollama4j Java library for interacting with Ollama API. - https://github.com/amithkoujalgi/ollama4j + https://github.com/ollama4j/ollama4j jar @@ -33,14 +33,14 @@ MIT License - https://raw.githubusercontent.com/amithkoujalgi/ollama4j/main/LICENSE + https://raw.githubusercontent.com/ollama4j/ollama4j/main/LICENSE - scm:git:git@github.com:amithkoujalgi/ollama4j.git - scm:git:https://github.com/amithkoujalgi/ollama4j.git - https://github.com/amithkoujalgi/ollama4j + scm:git:git@github.com:ollama4j/ollama4j.git + scm:git:https://github.com/ollama4j/ollama4j.git + https://github.com/ollama4j/ollama4j ollama4j-revision -- 2.47.2 From cc6934162043b3b1e474f9da739852defe2040fe Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 27 Jul 2024 00:22:16 +0530 Subject: [PATCH 070/101] updated links Signed-off-by: Amith Koujalgi --- docs/docs/intro.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/intro.md b/docs/docs/intro.md index b75cce6..c5b7555 100644 --- a/docs/docs/intro.md +++ b/docs/docs/intro.md @@ -84,7 +84,7 @@ Add the dependency to your project's `pom.xml`. ``` -Find the latest version of the library [here](https://central.sonatype.com/artifact/io.github.amithkoujalgi/ollama4j). +Find the latest version of the library [here](https://central.sonatype.com/artifact/io.github.ollama4j/ollama4j). You might want to include an implementation of [SL4J](https://www.slf4j.org/) logger in your `pom.xml` file. For example, -- 2.47.2 From 2db6a22cc72d4234e1ebdee396a87e53d3486470 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 27 Jul 2024 00:39:42 +0530 Subject: [PATCH 071/101] updated README.md Signed-off-by: Amith Koujalgi --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c733cce..61d0eb0 100644 --- a/README.md +++ b/README.md @@ -159,7 +159,7 @@ Find more details on the [website](https://ollama4j.github.io/ollama4j/). ```groovy dependencies { - implementation 'com.github.ollama4j:ollama4j:Tag' + implementation 'com.github.ollama4j:ollama4j:1.0.78' } ``` -- 2.47.2 From 3ab9e4c283ce57a4de3d72ed3b2b86c440c33311 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 27 Jul 2024 00:45:20 +0530 Subject: [PATCH 072/101] Update README.md --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 61d0eb0..d52ab22 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,12 @@ Find more details on the [website](https://ollama4j.github.io/ollama4j/). #### Using [Maven Central](https://central.sonatype.com/) +[![][ollama4j-mvn-releases-shield]][ollama4j-mvn-releases-link] + +[ollama4j-mvn-releases-link]: https://github.com/ollama4j/ollama4j/releases + +[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 + 1In your Maven project, add this dependency: ```xml @@ -101,7 +107,7 @@ Find more details on the [website](https://ollama4j.github.io/ollama4j/). [![][ollama4j-releases-shield]][ollama4j-releases-link] -[ollama4j-releases-link]: https://github.com/ollama4j/ollama4j/releases +[ollama4j-releases-link]: https://central.sonatype.com/artifact/io.github.ollama4j/ollama4j/overview [ollama4j-releases-shield]: https://img.shields.io/github/v/release/ollama4j/ollama4j?display_name=release&style=for-the-badge&label=From%20GitHub%20Packages%20 -- 2.47.2 From 6e282124bf3bcfb7d698b3e2341bc6de9d48dd3b Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 27 Jul 2024 00:56:57 +0530 Subject: [PATCH 073/101] updated README.md Signed-off-by: Amith Koujalgi --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d52ab22..dd7497d 100644 --- a/README.md +++ b/README.md @@ -88,11 +88,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 +107,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`: -- 2.47.2 From 51563f276f3d7850ff44642de8f9c9fd55c8daba Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 27 Jul 2024 00:57:55 +0530 Subject: [PATCH 074/101] updated README.md Signed-off-by: Amith Koujalgi --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dd7497d..c2f91c5 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,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) -- 2.47.2 From bd56ccfef77a3be6a6c6d34f18a3bb9e6420a63f Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 27 Jul 2024 02:45:36 +0530 Subject: [PATCH 075/101] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index c2f91c5..a6a9143 100644 --- a/README.md +++ b/README.md @@ -76,8 +76,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. -- 2.47.2 From 12802be0bc58e0e1fbab617c6cc0812e5ad09e91 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 27 Jul 2024 15:35:35 +0530 Subject: [PATCH 076/101] updated README.md Signed-off-by: Amith Koujalgi --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a6a9143..46331ce 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,12 @@ Find more details on the [website](https://ollama4j.github.io/ollama4j/). [//]: # (![JitPack Downloads This Month Badge](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)) + [//]: # (![JitPack Downloads This Week Badge](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)) + [//]: # (![JitPack Downloads Per Month Badge](https://jitpack.io/v/ollama4j/ollama4j/month.svg)) -![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/ollama4j/ollama4j/total?label=GitHub%20Package%20Downloads) + +[//]: # (![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/ollama4j/ollama4j/total?label=GitHub%20Package%20Downloads)) ![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) @@ -63,7 +66,13 @@ 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] +
+ +| Direct Installation | Docker Installation | +|-----------------------------------|--------------------------------------------| +| [![][ollama-shield]][ollama-link] | [![][ollama-docker-shield]][ollama-docker] | + +
[ollama-link]: https://ollama.ai/ -- 2.47.2 From bb6f8aa343d5cd3e3b3544a53156ad7897861077 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 27 Jul 2024 15:56:36 +0530 Subject: [PATCH 077/101] updated README.md Signed-off-by: Amith Koujalgi --- README.md | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 53 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 46331ce..f230fb8 100644 --- a/README.md +++ b/README.md @@ -66,13 +66,61 @@ 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) -
-| Direct Installation | Docker Installation | -|-----------------------------------|--------------------------------------------| -| [![][ollama-shield]][ollama-link] | [![][ollama-docker-shield]][ollama-docker] | + + + + + + + + + + +
- +[![][ollama-shield]][ollama-link] + + + +[![][ollama-docker-shield]][ollama-docker] + +
+ + + +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 + + + + + + +CPU only + +```shell +docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama +``` + +NVIDIA GPU + +```shell +docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama +``` + +
[ollama-link]: https://ollama.ai/ -- 2.47.2 From 68fd8b7cc8f16694f51d29dba941f06b1d232482 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 27 Jul 2024 15:57:38 +0530 Subject: [PATCH 078/101] updated README.md Signed-off-by: Amith Koujalgi --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f230fb8..c2299ed 100644 --- a/README.md +++ b/README.md @@ -109,13 +109,22 @@ https://ollama.com/download/OllamaSetup.exe CPU only ```shell -docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama +docker run -d \ + -v ollama:/root/.ollama \ + -p 11434:11434 \ + --name ollama \ + ollama/ollama ``` NVIDIA GPU ```shell -docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama +docker run -d \ + --gpus=all \ + -v ollama:/root/.ollama \ + -p 11434:11434 \ + --name ollama \ + ollama/ollama ``` -- 2.47.2 From 6c6062b7574bae4c936346f4960c81bf70ecb0f5 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 27 Jul 2024 15:58:24 +0530 Subject: [PATCH 079/101] updated README.md Signed-off-by: Amith Koujalgi --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c2299ed..599754e 100644 --- a/README.md +++ b/README.md @@ -109,9 +109,8 @@ https://ollama.com/download/OllamaSetup.exe CPU only ```shell -docker run -d \ +docker run -d -p 11434:11434 \ -v ollama:/root/.ollama \ - -p 11434:11434 \ --name ollama \ ollama/ollama ``` @@ -119,10 +118,9 @@ docker run -d \ NVIDIA GPU ```shell -docker run -d \ +docker run -d -p 11434:11434 \ --gpus=all \ -v ollama:/root/.ollama \ - -p 11434:11434 \ --name ollama \ ollama/ollama ``` -- 2.47.2 From 0b041f4340f2b10fd9a8562a47932a655242da85 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 27 Jul 2024 15:59:23 +0530 Subject: [PATCH 080/101] updated README.md Signed-off-by: Amith Koujalgi --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 599754e..9755474 100644 --- a/README.md +++ b/README.md @@ -222,7 +222,7 @@ In your Maven project, add this dependency: ``` -##### For Gradle +### For Gradle 1. Add the dependency -- 2.47.2 From e43bd3acb43b7562047cfd75046e605489988a17 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 27 Jul 2024 16:37:47 +0530 Subject: [PATCH 081/101] Refactored the package structure to use `io.github.ollama4j` instead of the old naming `io.github.amithkoujalgi.ollama4j.core` Signed-off-by: Amith Koujalgi --- .gitignore | 1 - docs/blog/2023-12-22-release-post.md | 4 +- docs/docs/apis-extras/basic-auth.md | 2 + docs/docs/apis-extras/options-builder.md | 9 ++-- docs/docs/apis-extras/ping.md | 2 + docs/docs/apis-extras/request-timeout.md | 2 + docs/docs/apis-extras/verbosity.md | 2 + docs/docs/apis-generate/chat.md | 44 ++++++++++++++++++- docs/docs/apis-generate/generate-async.md | 10 +++-- .../docs/apis-generate/generate-embeddings.md | 4 ++ .../generate-with-image-files.md | 11 ++++- .../apis-generate/generate-with-image-urls.md | 10 ++++- .../docs/apis-generate/generate-with-tools.md | 20 +++++---- docs/docs/apis-generate/generate.md | 21 +++++++++ docs/docs/apis-generate/prompt-builder.md | 15 ++++--- .../apis-model-management/create-model.md | 2 + .../apis-model-management/delete-model.md | 2 + .../get-model-details.md | 4 ++ .../docs/apis-model-management/list-models.md | 5 +++ docs/docs/apis-model-management/pull-model.md | 5 ++- docs/docs/intro.md | 6 ++- .../ollama4j/core => ollama4j}/OllamaAPI.java | 34 +++++++------- .../core => ollama4j}/OllamaResultStream.java | 2 +- .../exceptions/OllamaBaseException.java | 2 +- .../exceptions/ToolInvocationException.java | 2 +- .../exceptions/ToolNotFoundException.java | 2 +- .../impl/ConsoleOutputStreamHandler.java | 4 +- .../core => ollama4j}/models/BasicAuth.java | 2 +- .../models/ListModelsResponse.java | 2 +- .../core => ollama4j}/models/Model.java | 5 +-- .../core => ollama4j}/models/ModelDetail.java | 4 +- .../core => ollama4j}/models/ModelMeta.java | 4 +- .../models/ModelPullResponse.java | 2 +- .../models/OllamaAsyncResultStreamer.java | 12 ++--- .../models/OllamaCommonRequestModel.java | 6 +-- .../models/OllamaErrorResponseModel.java | 2 +- .../models/OllamaResult.java | 4 +- .../models/chat/OllamaChatMessage.java | 6 +-- .../models/chat/OllamaChatMessageRole.java | 2 +- .../models/chat/OllamaChatRequestBuilder.java | 6 +-- .../models/chat/OllamaChatRequestModel.java | 7 +-- .../models/chat/OllamaChatResponseModel.java | 2 +- .../models/chat/OllamaChatResult.java | 4 +- .../models/chat/OllamaChatStreamObserver.java | 4 +- .../OllamaEmbeddingResponseModel.java | 2 +- .../OllamaEmbeddingsRequestBuilder.java | 4 +- .../OllamaEmbeddingsRequestModel.java | 4 +- .../OllamaGenerateRequestBuilder.java | 6 +-- .../generate/OllamaGenerateRequestModel.java | 6 +-- .../generate/OllamaGenerateResponseModel.java | 2 +- .../OllamaGenerateStreamObserver.java | 2 +- .../models/generate/OllamaStreamHandler.java | 2 +- .../CustomModelFileContentsRequest.java | 4 +- .../request/CustomModelFilePathRequest.java | 4 +- .../models/request/ModelRequest.java | 4 +- .../request/OllamaChatEndpointCaller.java | 18 ++++---- .../models/request/OllamaEndpointCaller.java | 16 +++---- .../request/OllamaGenerateEndpointCaller.java | 18 ++++---- .../tools/OllamaToolsResult.java | 4 +- .../core => ollama4j}/tools/ToolFunction.java | 2 +- .../tools/ToolFunctionCallSpec.java | 2 +- .../core => ollama4j}/tools/ToolRegistry.java | 2 +- .../core => ollama4j}/tools/Tools.java | 4 +- .../types/OllamaModelType.java | 2 +- .../BooleanToJsonFormatFlagSerializer.java | 2 +- .../utils/FileToBase64Serializer.java | 2 +- .../utils/OllamaRequestBody.java | 2 +- .../core => ollama4j}/utils/Options.java | 2 +- .../utils/OptionsBuilder.java | 2 +- .../utils/PromptBuilder.java | 2 +- .../utils/SamplePrompts.java | 4 +- .../core => ollama4j}/utils/Utils.java | 2 +- .../integrationtests/TestRealAPIs.java | 24 +++++----- .../ollama4j/unittests/TestMockedAPIs.java | 16 +++---- .../jackson/AbstractSerializationTest.java | 4 +- .../jackson/TestChatRequestSerialization.java | 10 ++--- .../TestEmbeddingsRequestSerialization.java | 8 ++-- .../TestGenerateRequestSerialization.java | 8 ++-- .../TestModelRequestSerialization.java | 4 +- 79 files changed, 308 insertions(+), 193 deletions(-) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/OllamaAPI.java (95%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/OllamaResultStream.java (91%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/exceptions/OllamaBaseException.java (68%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/exceptions/ToolInvocationException.java (71%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/exceptions/ToolNotFoundException.java (68%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/impl/ConsoleOutputStreamHandler.java (71%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/BasicAuth.java (79%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/ListModelsResponse.java (68%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/Model.java (87%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/ModelDetail.java (86%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/ModelMeta.java (87%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/ModelPullResponse.java (83%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/OllamaAsyncResultStreamer.java (91%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/OllamaCommonRequestModel.java (82%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/OllamaErrorResponseModel.java (78%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/OllamaResult.java (88%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/chat/OllamaChatMessage.java (83%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/chat/OllamaChatMessageRole.java (85%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/chat/OllamaChatRequestBuilder.java (95%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/chat/OllamaChatRequestModel.java (79%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/chat/OllamaChatResponseModel.java (93%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/chat/OllamaChatResult.java (88%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/chat/OllamaChatStreamObserver.java (84%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/embeddings/OllamaEmbeddingResponseModel.java (79%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/embeddings/OllamaEmbeddingsRequestBuilder.java (86%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/embeddings/OllamaEmbeddingsRequestModel.java (83%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/generate/OllamaGenerateRequestBuilder.java (84%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/generate/OllamaGenerateRequestModel.java (80%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/generate/OllamaGenerateResponseModel.java (92%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/generate/OllamaGenerateStreamObserver.java (92%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/generate/OllamaStreamHandler.java (68%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/request/CustomModelFileContentsRequest.java (76%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/request/CustomModelFilePathRequest.java (76%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/request/ModelRequest.java (74%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/request/OllamaChatEndpointCaller.java (71%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/request/OllamaEndpointCaller.java (91%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/models/request/OllamaGenerateEndpointCaller.java (70%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/tools/OllamaToolsResult.java (88%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/tools/ToolFunction.java (70%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/tools/ToolFunctionCallSpec.java (83%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/tools/ToolRegistry.java (87%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/tools/Tools.java (97%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/types/OllamaModelType.java (98%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/utils/BooleanToJsonFormatFlagSerializer.java (91%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/utils/FileToBase64Serializer.java (92%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/utils/OllamaRequestBody.java (94%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/utils/Options.java (75%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/utils/OptionsBuilder.java (99%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/utils/PromptBuilder.java (97%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/utils/SamplePrompts.java (88%) rename src/main/java/io/github/{amithkoujalgi/ollama4j/core => ollama4j}/utils/Utils.java (95%) rename src/test/java/io/github/{amithkoujalgi => }/ollama4j/integrationtests/TestRealAPIs.java (94%) rename src/test/java/io/github/{amithkoujalgi => }/ollama4j/unittests/TestMockedAPIs.java (92%) rename src/test/java/io/github/{amithkoujalgi => }/ollama4j/unittests/jackson/AbstractSerializationTest.java (89%) rename src/test/java/io/github/{amithkoujalgi => }/ollama4j/unittests/jackson/TestChatRequestSerialization.java (92%) rename src/test/java/io/github/{amithkoujalgi => }/ollama4j/unittests/jackson/TestEmbeddingsRequestSerialization.java (80%) rename src/test/java/io/github/{amithkoujalgi => }/ollama4j/unittests/jackson/TestGenerateRequestSerialization.java (85%) rename src/test/java/io/github/{amithkoujalgi => }/ollama4j/unittests/jackson/TestModelRequestSerialization.java (93%) diff --git a/.gitignore b/.gitignore index f8c9181..1c00e11 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,5 @@ build/ ### Mac OS ### .DS_Store /.idea/ -/src/main/java/io/github/amithkoujalgi/ollama4j/core/localtests/ pom.xml.* release.properties \ No newline at end of file diff --git a/docs/blog/2023-12-22-release-post.md b/docs/blog/2023-12-22-release-post.md index 4a9f020..aba2a53 100644 --- a/docs/blog/2023-12-22-release-post.md +++ b/docs/blog/2023-12-22-release-post.md @@ -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). diff --git a/docs/docs/apis-extras/basic-auth.md b/docs/docs/apis-extras/basic-auth.md index 226a18f..15f681c 100644 --- a/docs/docs/apis-extras/basic-auth.md +++ b/docs/docs/apis-extras/basic-auth.md @@ -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) { diff --git a/docs/docs/apis-extras/options-builder.md b/docs/docs/apis-extras/options-builder.md index f7f8ed8..10aeea5 100644 --- a/docs/docs/apis-extras/options-builder.md +++ b/docs/docs/apis-extras/options-builder.md @@ -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 { diff --git a/docs/docs/apis-extras/ping.md b/docs/docs/apis-extras/ping.md index cc69f3d..2c9d8d3 100644 --- a/docs/docs/apis-extras/ping.md +++ b/docs/docs/apis-extras/ping.md @@ -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) { diff --git a/docs/docs/apis-extras/request-timeout.md b/docs/docs/apis-extras/request-timeout.md index ff3f40f..f22971a 100644 --- a/docs/docs/apis-extras/request-timeout.md +++ b/docs/docs/apis-extras/request-timeout.md @@ -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) { diff --git a/docs/docs/apis-extras/verbosity.md b/docs/docs/apis-extras/verbosity.md index 35a150e..c8809c9 100644 --- a/docs/docs/apis-extras/verbosity.md +++ b/docs/docs/apis-extras/verbosity.md @@ -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) { diff --git a/docs/docs/apis-generate/chat.md b/docs/docs/apis-generate/chat.md index b4d51b1..78827bd 100644 --- a/docs/docs/apis-generate/chat.md +++ b/docs/docs/apis-generate/chat.md @@ -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()); diff --git a/docs/docs/apis-generate/generate-async.md b/docs/docs/apis-generate/generate-async.md index e71d2a7..ad5b786 100644 --- a/docs/docs/apis-generate/generate-async.md +++ b/docs/docs/apis-generate/generate-async.md @@ -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. \ No newline at end of file +``` \ No newline at end of file diff --git a/docs/docs/apis-generate/generate-embeddings.md b/docs/docs/apis-generate/generate-embeddings.md index 1da45e1..586b215 100644 --- a/docs/docs/apis-generate/generate-embeddings.md +++ b/docs/docs/apis-generate/generate-embeddings.md @@ -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) { diff --git a/docs/docs/apis-generate/generate-with-image-files.md b/docs/docs/apis-generate/generate-with-image-files.md index 1e1f9f9..4e4214a 100644 --- a/docs/docs/apis-generate/generate-with-image-files.md +++ b/docs/docs/apis-generate/generate-with-image-files.md @@ -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()); } } diff --git a/docs/docs/apis-generate/generate-with-image-urls.md b/docs/docs/apis-generate/generate-with-image-urls.md index 2fd3941..04573b9 100644 --- a/docs/docs/apis-generate/generate-with-image-urls.md +++ b/docs/docs/apis-generate/generate-with-image-urls.md @@ -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()); } } diff --git a/docs/docs/apis-generate/generate-with-tools.md b/docs/docs/apis-generate/generate-with-tools.md index dfa1ec0..3a40150 100644 --- a/docs/docs/apis-generate/generate-with-tools.md +++ b/docs/docs/apis-generate/generate-with-tools.md @@ -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 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: diff --git a/docs/docs/apis-generate/generate.md b/docs/docs/apis-generate/generate.md index 4754c54..70bbb89 100644 --- a/docs/docs/apis-generate/generate.md +++ b/docs/docs/apis-generate/generate.md @@ -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) { diff --git a/docs/docs/apis-generate/prompt-builder.md b/docs/docs/apis-generate/prompt-builder.md index ffe57d7..150f3cd 100644 --- a/docs/docs/apis-generate/prompt-builder.md +++ b/docs/docs/apis-generate/prompt-builder.md @@ -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()); } } diff --git a/docs/docs/apis-model-management/create-model.md b/docs/docs/apis-model-management/create-model.md index 437e291..866cf73 100644 --- a/docs/docs/apis-model-management/create-model.md +++ b/docs/docs/apis-model-management/create-model.md @@ -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) { diff --git a/docs/docs/apis-model-management/delete-model.md b/docs/docs/apis-model-management/delete-model.md index 16bca70..edb8197 100644 --- a/docs/docs/apis-model-management/delete-model.md +++ b/docs/docs/apis-model-management/delete-model.md @@ -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) { diff --git a/docs/docs/apis-model-management/get-model-details.md b/docs/docs/apis-model-management/get-model-details.md index 184a55a..d415a5c 100644 --- a/docs/docs/apis-model-management/get-model-details.md +++ b/docs/docs/apis-model-management/get-model-details.md @@ -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) { diff --git a/docs/docs/apis-model-management/list-models.md b/docs/docs/apis-model-management/list-models.md index 0840470..19738da 100644 --- a/docs/docs/apis-model-management/list-models.md +++ b/docs/docs/apis-model-management/list-models.md @@ -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) { diff --git a/docs/docs/apis-model-management/pull-model.md b/docs/docs/apis-model-management/pull-model.md index 1e248ef..bfe2e26 100644 --- a/docs/docs/apis-model-management/pull-model.md +++ b/docs/docs/apis-model-management/pull-model.md @@ -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); diff --git a/docs/docs/intro.md b/docs/docs/intro.md index c5b7555..77ada7b 100644 --- a/docs/docs/intro.md +++ b/docs/docs/intro.md @@ -78,9 +78,9 @@ Add the dependency to your project's `pom.xml`. ```xml - io.github.amithkoujalgi + io.github.ollama4j ollama4j - 1.0.27 + 1.0.78 ``` @@ -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) { diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaAPI.java b/src/main/java/io/github/ollama4j/OllamaAPI.java similarity index 95% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaAPI.java rename to src/main/java/io/github/ollama4j/OllamaAPI.java index 516ca19..32f6ede 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaAPI.java +++ b/src/main/java/io/github/ollama4j/OllamaAPI.java @@ -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; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaResultStream.java b/src/main/java/io/github/ollama4j/OllamaResultStream.java similarity index 91% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaResultStream.java rename to src/main/java/io/github/ollama4j/OllamaResultStream.java index 21a15b1..7530421 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/OllamaResultStream.java +++ b/src/main/java/io/github/ollama4j/OllamaResultStream.java @@ -1,4 +1,4 @@ -package io.github.amithkoujalgi.ollama4j.core; +package io.github.ollama4j; import java.util.Iterator; import java.util.LinkedList; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/exceptions/OllamaBaseException.java b/src/main/java/io/github/ollama4j/exceptions/OllamaBaseException.java similarity index 68% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/exceptions/OllamaBaseException.java rename to src/main/java/io/github/ollama4j/exceptions/OllamaBaseException.java index 7c8612f..9474d72 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/exceptions/OllamaBaseException.java +++ b/src/main/java/io/github/ollama4j/exceptions/OllamaBaseException.java @@ -1,4 +1,4 @@ -package io.github.amithkoujalgi.ollama4j.core.exceptions; +package io.github.ollama4j.exceptions; public class OllamaBaseException extends Exception { diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/exceptions/ToolInvocationException.java b/src/main/java/io/github/ollama4j/exceptions/ToolInvocationException.java similarity index 71% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/exceptions/ToolInvocationException.java rename to src/main/java/io/github/ollama4j/exceptions/ToolInvocationException.java index 3a1a715..ea81bb9 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/exceptions/ToolInvocationException.java +++ b/src/main/java/io/github/ollama4j/exceptions/ToolInvocationException.java @@ -1,4 +1,4 @@ -package io.github.amithkoujalgi.ollama4j.core.exceptions; +package io.github.ollama4j.exceptions; public class ToolInvocationException extends Exception { diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/exceptions/ToolNotFoundException.java b/src/main/java/io/github/ollama4j/exceptions/ToolNotFoundException.java similarity index 68% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/exceptions/ToolNotFoundException.java rename to src/main/java/io/github/ollama4j/exceptions/ToolNotFoundException.java index 990400e..bd3e007 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/exceptions/ToolNotFoundException.java +++ b/src/main/java/io/github/ollama4j/exceptions/ToolNotFoundException.java @@ -1,4 +1,4 @@ -package io.github.amithkoujalgi.ollama4j.core.exceptions; +package io.github.ollama4j.exceptions; public class ToolNotFoundException extends Exception { diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/impl/ConsoleOutputStreamHandler.java b/src/main/java/io/github/ollama4j/impl/ConsoleOutputStreamHandler.java similarity index 71% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/impl/ConsoleOutputStreamHandler.java rename to src/main/java/io/github/ollama4j/impl/ConsoleOutputStreamHandler.java index 6b3a391..c9f8e36 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/impl/ConsoleOutputStreamHandler.java +++ b/src/main/java/io/github/ollama4j/impl/ConsoleOutputStreamHandler.java @@ -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(); diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/BasicAuth.java b/src/main/java/io/github/ollama4j/models/BasicAuth.java similarity index 79% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/BasicAuth.java rename to src/main/java/io/github/ollama4j/models/BasicAuth.java index dbcf8a7..897e71f 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/BasicAuth.java +++ b/src/main/java/io/github/ollama4j/models/BasicAuth.java @@ -1,4 +1,4 @@ -package io.github.amithkoujalgi.ollama4j.core.models; +package io.github.ollama4j.models; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/ListModelsResponse.java b/src/main/java/io/github/ollama4j/models/ListModelsResponse.java similarity index 68% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/ListModelsResponse.java rename to src/main/java/io/github/ollama4j/models/ListModelsResponse.java index db6f413..e78700d 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/ListModelsResponse.java +++ b/src/main/java/io/github/ollama4j/models/ListModelsResponse.java @@ -1,4 +1,4 @@ -package io.github.amithkoujalgi.ollama4j.core.models; +package io.github.ollama4j.models; import java.util.List; import lombok.Data; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/Model.java b/src/main/java/io/github/ollama4j/models/Model.java similarity index 87% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/Model.java rename to src/main/java/io/github/ollama4j/models/Model.java index 15efd70..5841c8f 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/Model.java +++ b/src/main/java/io/github/ollama4j/models/Model.java @@ -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 diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/ModelDetail.java b/src/main/java/io/github/ollama4j/models/ModelDetail.java similarity index 86% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/ModelDetail.java rename to src/main/java/io/github/ollama4j/models/ModelDetail.java index e81a20e..3d1a397 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/ModelDetail.java +++ b/src/main/java/io/github/ollama4j/models/ModelDetail.java @@ -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 diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/ModelMeta.java b/src/main/java/io/github/ollama4j/models/ModelMeta.java similarity index 87% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/ModelMeta.java rename to src/main/java/io/github/ollama4j/models/ModelMeta.java index e534832..812bf0c 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/ModelMeta.java +++ b/src/main/java/io/github/ollama4j/models/ModelMeta.java @@ -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 diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/ModelPullResponse.java b/src/main/java/io/github/ollama4j/models/ModelPullResponse.java similarity index 83% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/ModelPullResponse.java rename to src/main/java/io/github/ollama4j/models/ModelPullResponse.java index d9db5c1..12afa88 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/ModelPullResponse.java +++ b/src/main/java/io/github/ollama4j/models/ModelPullResponse.java @@ -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; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/OllamaAsyncResultStreamer.java b/src/main/java/io/github/ollama4j/models/OllamaAsyncResultStreamer.java similarity index 91% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/OllamaAsyncResultStreamer.java rename to src/main/java/io/github/ollama4j/models/OllamaAsyncResultStreamer.java index 66dde93..0655b41 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/OllamaAsyncResultStreamer.java +++ b/src/main/java/io/github/ollama4j/models/OllamaAsyncResultStreamer.java @@ -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; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/OllamaCommonRequestModel.java b/src/main/java/io/github/ollama4j/models/OllamaCommonRequestModel.java similarity index 82% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/OllamaCommonRequestModel.java rename to src/main/java/io/github/ollama4j/models/OllamaCommonRequestModel.java index 6f985ab..b6ef074 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/OllamaCommonRequestModel.java +++ b/src/main/java/io/github/ollama4j/models/OllamaCommonRequestModel.java @@ -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 diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/OllamaErrorResponseModel.java b/src/main/java/io/github/ollama4j/models/OllamaErrorResponseModel.java similarity index 78% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/OllamaErrorResponseModel.java rename to src/main/java/io/github/ollama4j/models/OllamaErrorResponseModel.java index be3d8e4..39e8df3 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/OllamaErrorResponseModel.java +++ b/src/main/java/io/github/ollama4j/models/OllamaErrorResponseModel.java @@ -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; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/OllamaResult.java b/src/main/java/io/github/ollama4j/models/OllamaResult.java similarity index 88% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/OllamaResult.java rename to src/main/java/io/github/ollama4j/models/OllamaResult.java index 1276f5f..c7bd08d 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/OllamaResult.java +++ b/src/main/java/io/github/ollama4j/models/OllamaResult.java @@ -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; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatMessage.java b/src/main/java/io/github/ollama4j/models/chat/OllamaChatMessage.java similarity index 83% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatMessage.java rename to src/main/java/io/github/ollama4j/models/chat/OllamaChatMessage.java index 0b14315..d4fe195 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatMessage.java +++ b/src/main/java/io/github/ollama4j/models/chat/OllamaChatMessage.java @@ -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; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatMessageRole.java b/src/main/java/io/github/ollama4j/models/chat/OllamaChatMessageRole.java similarity index 85% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatMessageRole.java rename to src/main/java/io/github/ollama4j/models/chat/OllamaChatMessageRole.java index cbecb00..3986135 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatMessageRole.java +++ b/src/main/java/io/github/ollama4j/models/chat/OllamaChatMessageRole.java @@ -1,4 +1,4 @@ -package io.github.amithkoujalgi.ollama4j.core.models.chat; +package io.github.ollama4j.models.chat; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatRequestBuilder.java b/src/main/java/io/github/ollama4j/models/chat/OllamaChatRequestBuilder.java similarity index 95% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatRequestBuilder.java rename to src/main/java/io/github/ollama4j/models/chat/OllamaChatRequestBuilder.java index e07722f..547fda6 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatRequestBuilder.java +++ b/src/main/java/io/github/ollama4j/models/chat/OllamaChatRequestBuilder.java @@ -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. diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatRequestModel.java b/src/main/java/io/github/ollama4j/models/chat/OllamaChatRequestModel.java similarity index 79% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatRequestModel.java rename to src/main/java/io/github/ollama4j/models/chat/OllamaChatRequestModel.java index e55bf6a..d40739e 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatRequestModel.java +++ b/src/main/java/io/github/ollama4j/models/chat/OllamaChatRequestModel.java @@ -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; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatResponseModel.java b/src/main/java/io/github/ollama4j/models/chat/OllamaChatResponseModel.java similarity index 93% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatResponseModel.java rename to src/main/java/io/github/ollama4j/models/chat/OllamaChatResponseModel.java index 418338f..2ccc731 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatResponseModel.java +++ b/src/main/java/io/github/ollama4j/models/chat/OllamaChatResponseModel.java @@ -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; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatResult.java b/src/main/java/io/github/ollama4j/models/chat/OllamaChatResult.java similarity index 88% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatResult.java rename to src/main/java/io/github/ollama4j/models/chat/OllamaChatResult.java index 6ac6578..c779c60 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatResult.java +++ b/src/main/java/io/github/ollama4j/models/chat/OllamaChatResult.java @@ -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 diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatStreamObserver.java b/src/main/java/io/github/ollama4j/models/chat/OllamaChatStreamObserver.java similarity index 84% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatStreamObserver.java rename to src/main/java/io/github/ollama4j/models/chat/OllamaChatStreamObserver.java index f653001..9f1bf7f 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/chat/OllamaChatStreamObserver.java +++ b/src/main/java/io/github/ollama4j/models/chat/OllamaChatStreamObserver.java @@ -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; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/embeddings/OllamaEmbeddingResponseModel.java b/src/main/java/io/github/ollama4j/models/embeddings/OllamaEmbeddingResponseModel.java similarity index 79% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/embeddings/OllamaEmbeddingResponseModel.java rename to src/main/java/io/github/ollama4j/models/embeddings/OllamaEmbeddingResponseModel.java index 85dba31..24d95bc 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/embeddings/OllamaEmbeddingResponseModel.java +++ b/src/main/java/io/github/ollama4j/models/embeddings/OllamaEmbeddingResponseModel.java @@ -1,4 +1,4 @@ -package io.github.amithkoujalgi.ollama4j.core.models.embeddings; +package io.github.ollama4j.models.embeddings; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/embeddings/OllamaEmbeddingsRequestBuilder.java b/src/main/java/io/github/ollama4j/models/embeddings/OllamaEmbeddingsRequestBuilder.java similarity index 86% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/embeddings/OllamaEmbeddingsRequestBuilder.java rename to src/main/java/io/github/ollama4j/models/embeddings/OllamaEmbeddingsRequestBuilder.java index ef7a84e..b542931 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/embeddings/OllamaEmbeddingsRequestBuilder.java +++ b/src/main/java/io/github/ollama4j/models/embeddings/OllamaEmbeddingsRequestBuilder.java @@ -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 { diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/embeddings/OllamaEmbeddingsRequestModel.java b/src/main/java/io/github/ollama4j/models/embeddings/OllamaEmbeddingsRequestModel.java similarity index 83% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/embeddings/OllamaEmbeddingsRequestModel.java rename to src/main/java/io/github/ollama4j/models/embeddings/OllamaEmbeddingsRequestModel.java index a369124..d700b91 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/embeddings/OllamaEmbeddingsRequestModel.java +++ b/src/main/java/io/github/ollama4j/models/embeddings/OllamaEmbeddingsRequestModel.java @@ -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; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/generate/OllamaGenerateRequestBuilder.java b/src/main/java/io/github/ollama4j/models/generate/OllamaGenerateRequestBuilder.java similarity index 84% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/generate/OllamaGenerateRequestBuilder.java rename to src/main/java/io/github/ollama4j/models/generate/OllamaGenerateRequestBuilder.java index 48b4d18..2bd3dce 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/generate/OllamaGenerateRequestBuilder.java +++ b/src/main/java/io/github/ollama4j/models/generate/OllamaGenerateRequestBuilder.java @@ -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 { diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/generate/OllamaGenerateRequestModel.java b/src/main/java/io/github/ollama4j/models/generate/OllamaGenerateRequestModel.java similarity index 80% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/generate/OllamaGenerateRequestModel.java rename to src/main/java/io/github/ollama4j/models/generate/OllamaGenerateRequestModel.java index b060a4c..3b4c693 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/generate/OllamaGenerateRequestModel.java +++ b/src/main/java/io/github/ollama4j/models/generate/OllamaGenerateRequestModel.java @@ -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; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/generate/OllamaGenerateResponseModel.java b/src/main/java/io/github/ollama4j/models/generate/OllamaGenerateResponseModel.java similarity index 92% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/generate/OllamaGenerateResponseModel.java rename to src/main/java/io/github/ollama4j/models/generate/OllamaGenerateResponseModel.java index a575a7a..9fb975e 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/generate/OllamaGenerateResponseModel.java +++ b/src/main/java/io/github/ollama4j/models/generate/OllamaGenerateResponseModel.java @@ -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; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/generate/OllamaGenerateStreamObserver.java b/src/main/java/io/github/ollama4j/models/generate/OllamaGenerateStreamObserver.java similarity index 92% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/generate/OllamaGenerateStreamObserver.java rename to src/main/java/io/github/ollama4j/models/generate/OllamaGenerateStreamObserver.java index 333ba5a..bc47fa0 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/generate/OllamaGenerateStreamObserver.java +++ b/src/main/java/io/github/ollama4j/models/generate/OllamaGenerateStreamObserver.java @@ -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; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/generate/OllamaStreamHandler.java b/src/main/java/io/github/ollama4j/models/generate/OllamaStreamHandler.java similarity index 68% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/generate/OllamaStreamHandler.java rename to src/main/java/io/github/ollama4j/models/generate/OllamaStreamHandler.java index 1151e9b..e2da640 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/generate/OllamaStreamHandler.java +++ b/src/main/java/io/github/ollama4j/models/generate/OllamaStreamHandler.java @@ -1,4 +1,4 @@ -package io.github.amithkoujalgi.ollama4j.core.models.generate; +package io.github.ollama4j.models.generate; import java.util.function.Consumer; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/CustomModelFileContentsRequest.java b/src/main/java/io/github/ollama4j/models/request/CustomModelFileContentsRequest.java similarity index 76% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/CustomModelFileContentsRequest.java rename to src/main/java/io/github/ollama4j/models/request/CustomModelFileContentsRequest.java index 9e606d3..6841476 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/CustomModelFileContentsRequest.java +++ b/src/main/java/io/github/ollama4j/models/request/CustomModelFileContentsRequest.java @@ -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; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/CustomModelFilePathRequest.java b/src/main/java/io/github/ollama4j/models/request/CustomModelFilePathRequest.java similarity index 76% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/CustomModelFilePathRequest.java rename to src/main/java/io/github/ollama4j/models/request/CustomModelFilePathRequest.java index ea08dbf..2fcda43 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/CustomModelFilePathRequest.java +++ b/src/main/java/io/github/ollama4j/models/request/CustomModelFilePathRequest.java @@ -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; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/ModelRequest.java b/src/main/java/io/github/ollama4j/models/request/ModelRequest.java similarity index 74% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/ModelRequest.java rename to src/main/java/io/github/ollama4j/models/request/ModelRequest.java index d3fdec4..923cd87 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/ModelRequest.java +++ b/src/main/java/io/github/ollama4j/models/request/ModelRequest.java @@ -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; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/OllamaChatEndpointCaller.java b/src/main/java/io/github/ollama4j/models/request/OllamaChatEndpointCaller.java similarity index 71% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/OllamaChatEndpointCaller.java rename to src/main/java/io/github/ollama4j/models/request/OllamaChatEndpointCaller.java index 9184edf..a3314d4 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/OllamaChatEndpointCaller.java +++ b/src/main/java/io/github/ollama4j/models/request/OllamaChatEndpointCaller.java @@ -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; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/OllamaEndpointCaller.java b/src/main/java/io/github/ollama4j/models/request/OllamaEndpointCaller.java similarity index 91% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/OllamaEndpointCaller.java rename to src/main/java/io/github/ollama4j/models/request/OllamaEndpointCaller.java index 350200a..c1aed87 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/OllamaEndpointCaller.java +++ b/src/main/java/io/github/ollama4j/models/request/OllamaEndpointCaller.java @@ -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; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/OllamaGenerateEndpointCaller.java b/src/main/java/io/github/ollama4j/models/request/OllamaGenerateEndpointCaller.java similarity index 70% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/OllamaGenerateEndpointCaller.java rename to src/main/java/io/github/ollama4j/models/request/OllamaGenerateEndpointCaller.java index 54457ae..da73316 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/models/request/OllamaGenerateEndpointCaller.java +++ b/src/main/java/io/github/ollama4j/models/request/OllamaGenerateEndpointCaller.java @@ -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; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/OllamaToolsResult.java b/src/main/java/io/github/ollama4j/tools/OllamaToolsResult.java similarity index 88% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/OllamaToolsResult.java rename to src/main/java/io/github/ollama4j/tools/OllamaToolsResult.java index 1ff3656..bf048b0 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/OllamaToolsResult.java +++ b/src/main/java/io/github/ollama4j/tools/OllamaToolsResult.java @@ -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; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolFunction.java b/src/main/java/io/github/ollama4j/tools/ToolFunction.java similarity index 70% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolFunction.java rename to src/main/java/io/github/ollama4j/tools/ToolFunction.java index d670aa7..51ab8c5 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolFunction.java +++ b/src/main/java/io/github/ollama4j/tools/ToolFunction.java @@ -1,4 +1,4 @@ -package io.github.amithkoujalgi.ollama4j.core.tools; +package io.github.ollama4j.tools; import java.util.Map; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolFunctionCallSpec.java b/src/main/java/io/github/ollama4j/tools/ToolFunctionCallSpec.java similarity index 83% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolFunctionCallSpec.java rename to src/main/java/io/github/ollama4j/tools/ToolFunctionCallSpec.java index 1ce69cb..7a4f7fd 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolFunctionCallSpec.java +++ b/src/main/java/io/github/ollama4j/tools/ToolFunctionCallSpec.java @@ -1,4 +1,4 @@ -package io.github.amithkoujalgi.ollama4j.core.tools; +package io.github.ollama4j.tools; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolRegistry.java b/src/main/java/io/github/ollama4j/tools/ToolRegistry.java similarity index 87% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolRegistry.java rename to src/main/java/io/github/ollama4j/tools/ToolRegistry.java index 432a4d7..2ead13a 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/ToolRegistry.java +++ b/src/main/java/io/github/ollama4j/tools/ToolRegistry.java @@ -1,4 +1,4 @@ -package io.github.amithkoujalgi.ollama4j.core.tools; +package io.github.ollama4j.tools; import java.util.HashMap; import java.util.Map; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/Tools.java b/src/main/java/io/github/ollama4j/tools/Tools.java similarity index 97% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/Tools.java rename to src/main/java/io/github/ollama4j/tools/Tools.java index 5315d19..986302f 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/tools/Tools.java +++ b/src/main/java/io/github/ollama4j/tools/Tools.java @@ -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; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/types/OllamaModelType.java b/src/main/java/io/github/ollama4j/types/OllamaModelType.java similarity index 98% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/types/OllamaModelType.java rename to src/main/java/io/github/ollama4j/types/OllamaModelType.java index 2613d86..dc7b447 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/types/OllamaModelType.java +++ b/src/main/java/io/github/ollama4j/types/OllamaModelType.java @@ -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. diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/utils/BooleanToJsonFormatFlagSerializer.java b/src/main/java/io/github/ollama4j/utils/BooleanToJsonFormatFlagSerializer.java similarity index 91% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/utils/BooleanToJsonFormatFlagSerializer.java rename to src/main/java/io/github/ollama4j/utils/BooleanToJsonFormatFlagSerializer.java index f4d4ab3..a94e4d1 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/utils/BooleanToJsonFormatFlagSerializer.java +++ b/src/main/java/io/github/ollama4j/utils/BooleanToJsonFormatFlagSerializer.java @@ -1,4 +1,4 @@ -package io.github.amithkoujalgi.ollama4j.core.utils; +package io.github.ollama4j.utils; import java.io.IOException; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/utils/FileToBase64Serializer.java b/src/main/java/io/github/ollama4j/utils/FileToBase64Serializer.java similarity index 92% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/utils/FileToBase64Serializer.java rename to src/main/java/io/github/ollama4j/utils/FileToBase64Serializer.java index 8e862ab..235ebde 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/utils/FileToBase64Serializer.java +++ b/src/main/java/io/github/ollama4j/utils/FileToBase64Serializer.java @@ -1,4 +1,4 @@ -package io.github.amithkoujalgi.ollama4j.core.utils; +package io.github.ollama4j.utils; import java.io.IOException; import java.util.Base64; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/utils/OllamaRequestBody.java b/src/main/java/io/github/ollama4j/utils/OllamaRequestBody.java similarity index 94% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/utils/OllamaRequestBody.java rename to src/main/java/io/github/ollama4j/utils/OllamaRequestBody.java index f787cee..5a2dfab 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/utils/OllamaRequestBody.java +++ b/src/main/java/io/github/ollama4j/utils/OllamaRequestBody.java @@ -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; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/utils/Options.java b/src/main/java/io/github/ollama4j/utils/Options.java similarity index 75% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/utils/Options.java rename to src/main/java/io/github/ollama4j/utils/Options.java index 2339969..c6e5e53 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/utils/Options.java +++ b/src/main/java/io/github/ollama4j/utils/Options.java @@ -1,4 +1,4 @@ -package io.github.amithkoujalgi.ollama4j.core.utils; +package io.github.ollama4j.utils; import java.util.Map; import lombok.Data; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/utils/OptionsBuilder.java b/src/main/java/io/github/ollama4j/utils/OptionsBuilder.java similarity index 99% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/utils/OptionsBuilder.java rename to src/main/java/io/github/ollama4j/utils/OptionsBuilder.java index d605f81..c71818a 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/utils/OptionsBuilder.java +++ b/src/main/java/io/github/ollama4j/utils/OptionsBuilder.java @@ -1,4 +1,4 @@ -package io.github.amithkoujalgi.ollama4j.core.utils; +package io.github.ollama4j.utils; import java.util.HashMap; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/utils/PromptBuilder.java b/src/main/java/io/github/ollama4j/utils/PromptBuilder.java similarity index 97% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/utils/PromptBuilder.java rename to src/main/java/io/github/ollama4j/utils/PromptBuilder.java index be487d9..bb24ef8 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/utils/PromptBuilder.java +++ b/src/main/java/io/github/ollama4j/utils/PromptBuilder.java @@ -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 diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/utils/SamplePrompts.java b/src/main/java/io/github/ollama4j/utils/SamplePrompts.java similarity index 88% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/utils/SamplePrompts.java rename to src/main/java/io/github/ollama4j/utils/SamplePrompts.java index 1e5dfdc..89a7f83 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/utils/SamplePrompts.java +++ b/src/main/java/io/github/ollama4j/utils/SamplePrompts.java @@ -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; diff --git a/src/main/java/io/github/amithkoujalgi/ollama4j/core/utils/Utils.java b/src/main/java/io/github/ollama4j/utils/Utils.java similarity index 95% rename from src/main/java/io/github/amithkoujalgi/ollama4j/core/utils/Utils.java rename to src/main/java/io/github/ollama4j/utils/Utils.java index 96b07ae..d854df1 100644 --- a/src/main/java/io/github/amithkoujalgi/ollama4j/core/utils/Utils.java +++ b/src/main/java/io/github/ollama4j/utils/Utils.java @@ -1,4 +1,4 @@ -package io.github.amithkoujalgi.ollama4j.core.utils; +package io.github.ollama4j.utils; import java.io.ByteArrayOutputStream; import java.io.IOException; diff --git a/src/test/java/io/github/amithkoujalgi/ollama4j/integrationtests/TestRealAPIs.java b/src/test/java/io/github/ollama4j/integrationtests/TestRealAPIs.java similarity index 94% rename from src/test/java/io/github/amithkoujalgi/ollama4j/integrationtests/TestRealAPIs.java rename to src/test/java/io/github/ollama4j/integrationtests/TestRealAPIs.java index 58e55a1..7c21ec9 100644 --- a/src/test/java/io/github/amithkoujalgi/ollama4j/integrationtests/TestRealAPIs.java +++ b/src/test/java/io/github/ollama4j/integrationtests/TestRealAPIs.java @@ -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; diff --git a/src/test/java/io/github/amithkoujalgi/ollama4j/unittests/TestMockedAPIs.java b/src/test/java/io/github/ollama4j/unittests/TestMockedAPIs.java similarity index 92% rename from src/test/java/io/github/amithkoujalgi/ollama4j/unittests/TestMockedAPIs.java rename to src/test/java/io/github/ollama4j/unittests/TestMockedAPIs.java index 3b1613f..61023e9 100644 --- a/src/test/java/io/github/amithkoujalgi/ollama4j/unittests/TestMockedAPIs.java +++ b/src/test/java/io/github/ollama4j/unittests/TestMockedAPIs.java @@ -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; diff --git a/src/test/java/io/github/amithkoujalgi/ollama4j/unittests/jackson/AbstractSerializationTest.java b/src/test/java/io/github/ollama4j/unittests/jackson/AbstractSerializationTest.java similarity index 89% rename from src/test/java/io/github/amithkoujalgi/ollama4j/unittests/jackson/AbstractSerializationTest.java rename to src/test/java/io/github/ollama4j/unittests/jackson/AbstractSerializationTest.java index d0ffc2c..6e03566 100644 --- a/src/test/java/io/github/amithkoujalgi/ollama4j/unittests/jackson/AbstractSerializationTest.java +++ b/src/test/java/io/github/ollama4j/unittests/jackson/AbstractSerializationTest.java @@ -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 { diff --git a/src/test/java/io/github/amithkoujalgi/ollama4j/unittests/jackson/TestChatRequestSerialization.java b/src/test/java/io/github/ollama4j/unittests/jackson/TestChatRequestSerialization.java similarity index 92% rename from src/test/java/io/github/amithkoujalgi/ollama4j/unittests/jackson/TestChatRequestSerialization.java rename to src/test/java/io/github/ollama4j/unittests/jackson/TestChatRequestSerialization.java index 3ad049c..fc9a1ea 100644 --- a/src/test/java/io/github/amithkoujalgi/ollama4j/unittests/jackson/TestChatRequestSerialization.java +++ b/src/test/java/io/github/ollama4j/unittests/jackson/TestChatRequestSerialization.java @@ -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 { diff --git a/src/test/java/io/github/amithkoujalgi/ollama4j/unittests/jackson/TestEmbeddingsRequestSerialization.java b/src/test/java/io/github/ollama4j/unittests/jackson/TestEmbeddingsRequestSerialization.java similarity index 80% rename from src/test/java/io/github/amithkoujalgi/ollama4j/unittests/jackson/TestEmbeddingsRequestSerialization.java rename to src/test/java/io/github/ollama4j/unittests/jackson/TestEmbeddingsRequestSerialization.java index a546d6d..7cb0297 100644 --- a/src/test/java/io/github/amithkoujalgi/ollama4j/unittests/jackson/TestEmbeddingsRequestSerialization.java +++ b/src/test/java/io/github/ollama4j/unittests/jackson/TestEmbeddingsRequestSerialization.java @@ -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 { diff --git a/src/test/java/io/github/amithkoujalgi/ollama4j/unittests/jackson/TestGenerateRequestSerialization.java b/src/test/java/io/github/ollama4j/unittests/jackson/TestGenerateRequestSerialization.java similarity index 85% rename from src/test/java/io/github/amithkoujalgi/ollama4j/unittests/jackson/TestGenerateRequestSerialization.java rename to src/test/java/io/github/ollama4j/unittests/jackson/TestGenerateRequestSerialization.java index 8e95288..58de683 100644 --- a/src/test/java/io/github/amithkoujalgi/ollama4j/unittests/jackson/TestGenerateRequestSerialization.java +++ b/src/test/java/io/github/ollama4j/unittests/jackson/TestGenerateRequestSerialization.java @@ -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 { diff --git a/src/test/java/io/github/amithkoujalgi/ollama4j/unittests/jackson/TestModelRequestSerialization.java b/src/test/java/io/github/ollama4j/unittests/jackson/TestModelRequestSerialization.java similarity index 93% rename from src/test/java/io/github/amithkoujalgi/ollama4j/unittests/jackson/TestModelRequestSerialization.java rename to src/test/java/io/github/ollama4j/unittests/jackson/TestModelRequestSerialization.java index 712e507..ac6213e 100644 --- a/src/test/java/io/github/amithkoujalgi/ollama4j/unittests/jackson/TestModelRequestSerialization.java +++ b/src/test/java/io/github/ollama4j/unittests/jackson/TestModelRequestSerialization.java @@ -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 { -- 2.47.2 From 17ca2bdee3f2ffb5a8c97bfa8469785b6b06083a Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 27 Jul 2024 16:46:53 +0530 Subject: [PATCH 082/101] updated README.md Signed-off-by: Amith Koujalgi --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9755474..9de3300 100644 --- a/README.md +++ b/README.md @@ -284,6 +284,8 @@ Newer artifacts are published via GitHub Actions CI workflow when a new release - `ollama-translator`: Minecraft 1.20.6 spigot plugin allows to easily break language barriers by using ollama on the server to translate all messages into a specfic target language. - https://github.com/liebki/ollama-translator +- `Ollama4j UI`: A web UI for Ollama written in Java using Spring Boot and Vaadin framework and + Ollama4j. https://github.com/ollama4j/ollama4j-web-ui #### Traction -- 2.47.2 From 73aabd7ca6676acccfd72364ff40a981f7a24387 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 27 Jul 2024 16:48:05 +0530 Subject: [PATCH 083/101] updated README.md Signed-off-by: Amith Koujalgi --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9de3300..6f5c95e 100644 --- a/README.md +++ b/README.md @@ -162,7 +162,7 @@ In your Maven project, add this dependency: io.github.ollama4j ollama4j - 1.0.78 + 1.0.79 ``` @@ -218,7 +218,7 @@ In your Maven project, add this dependency: io.github.ollama4j ollama4j - 1.0.78 + 1.0.79 ``` @@ -228,7 +228,7 @@ In your Maven project, add this dependency: ```groovy dependencies { - implementation 'com.github.ollama4j:ollama4j:1.0.78' + implementation 'com.github.ollama4j:ollama4j:1.0.79' } ``` -- 2.47.2 From 2f0c4fdcc926db5e678efede06be8432f04cc7aa Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 27 Jul 2024 16:54:34 +0530 Subject: [PATCH 084/101] updated README.md Signed-off-by: Amith Koujalgi --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 6f5c95e..de69b5e 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,15 @@ A Java library (wrapper/binding) for [Ollama](https://ollama.ai/) server. Find more details on the [website](https://ollama4j.github.io/ollama4j/). +
+ ![GitHub stars](https://img.shields.io/github/stars/ollama4j/ollama4j) ![GitHub forks](https://img.shields.io/github/forks/ollama4j/ollama4j) ![GitHub watchers](https://img.shields.io/github/watchers/ollama4j/ollama4j) ![Contributors](https://img.shields.io/github/contributors/ollama4j/ollama4j?style=social) ![GitHub License](https://img.shields.io/github/license/ollama4j/ollama4j) + [//]: # (![GitHub repo size](https://img.shields.io/github/repo-size/ollama4j/ollama4j)) [//]: # (![GitHub top language](https://img.shields.io/github/languages/top/ollama4j/ollama4j)) @@ -32,6 +35,7 @@ Find more details on the [website](https://ollama4j.github.io/ollama4j/). [![codecov](https://codecov.io/gh/ollama4j/ollama4j/graph/badge.svg?token=U0TE7BGP8L)](https://codecov.io/gh/ollama4j/ollama4j) ![Build Status](https://github.com/ollama4j/ollama4j/actions/workflows/maven-publish.yml/badge.svg) +
[//]: # (![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Follama4j%2Follama4j&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false)) -- 2.47.2 From 887708864e2be66f467b8573762ef5e8fb72572c Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 27 Jul 2024 16:56:19 +0530 Subject: [PATCH 085/101] updated README.md Signed-off-by: Amith Koujalgi --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index de69b5e..3ad3eb4 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,6 @@ 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) - @@ -325,7 +325,7 @@ project.

- +

-- 2.47.2 From 30250f79d9f763e72ae57e6cfb8c85ec28aff505 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sun, 28 Jul 2024 00:06:55 +0530 Subject: [PATCH 095/101] updated README.md Signed-off-by: Amith Koujalgi --- .gitignore | 1 + .idea/icon.svg | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 .idea/icon.svg diff --git a/.gitignore b/.gitignore index 928b77d..788123e 100644 --- a/.gitignore +++ b/.gitignore @@ -39,5 +39,6 @@ build/ /.idea/ pom.xml.* release.properties +!.idea/icon.svg src/main/java/io/github/ollama4j/localtests \ No newline at end of file diff --git a/.idea/icon.svg b/.idea/icon.svg new file mode 100644 index 0000000..47529e1 --- /dev/null +++ b/.idea/icon.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + -- 2.47.2 From 51dd3f3e1e09d4782f1ad61973af2d96a219c556 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Tue, 6 Aug 2024 10:46:35 +0530 Subject: [PATCH 096/101] Added Json ignore properties for `ModelsProcessResponse` Signed-off-by: Amith Koujalgi --- src/main/java/io/github/ollama4j/OllamaAPI.java | 9 ++++++++- .../github/ollama4j/models/ps/ModelsProcessResponse.java | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/ollama4j/OllamaAPI.java b/src/main/java/io/github/ollama4j/OllamaAPI.java index 64ccb18..d3c68a2 100644 --- a/src/main/java/io/github/ollama4j/OllamaAPI.java +++ b/src/main/java/io/github/ollama4j/OllamaAPI.java @@ -58,7 +58,14 @@ public class OllamaAPI { private final ToolRegistry toolRegistry = new ToolRegistry(); /** - * Instantiates the Ollama API. + * Instantiates the Ollama API with default Ollama host: http://localhost:11434 + **/ + public OllamaAPI() { + this.host = "http://localhost:11434"; + } + + /** + * Instantiates the Ollama API with specified Ollama host address. * * @param host the host address of Ollama server */ diff --git a/src/main/java/io/github/ollama4j/models/ps/ModelsProcessResponse.java b/src/main/java/io/github/ollama4j/models/ps/ModelsProcessResponse.java index 8c5fb2f..0f086fd 100644 --- a/src/main/java/io/github/ollama4j/models/ps/ModelsProcessResponse.java +++ b/src/main/java/io/github/ollama4j/models/ps/ModelsProcessResponse.java @@ -1,5 +1,6 @@ package io.github.ollama4j.models.ps; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.Data; import lombok.NoArgsConstructor; @@ -7,6 +8,7 @@ import java.util.List; @Data @NoArgsConstructor +@JsonIgnoreProperties(ignoreUnknown = true) public class ModelsProcessResponse { private List models; -- 2.47.2 From 75e6576a1341857e4db96093a47cdf97a8063eee Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Tue, 6 Aug 2024 11:00:54 +0530 Subject: [PATCH 097/101] 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", -- 2.47.2 From 422601c0fc89ff06efb168d0299269c7dda92f5b Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Tue, 6 Aug 2024 11:11:15 +0530 Subject: [PATCH 098/101] Updated `ModelsProcessResponse` class to support `ps()` API Signed-off-by: Amith Koujalgi --- .../models/ps/ModelsProcessResponse.java | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/ollama4j/models/ps/ModelsProcessResponse.java b/src/main/java/io/github/ollama4j/models/ps/ModelsProcessResponse.java index 0f086fd..490d362 100644 --- a/src/main/java/io/github/ollama4j/models/ps/ModelsProcessResponse.java +++ b/src/main/java/io/github/ollama4j/models/ps/ModelsProcessResponse.java @@ -1,6 +1,7 @@ package io.github.ollama4j.models.ps; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; @@ -10,28 +11,53 @@ import java.util.List; @NoArgsConstructor @JsonIgnoreProperties(ignoreUnknown = true) public class ModelsProcessResponse { + @JsonProperty("models") private List models; @Data @NoArgsConstructor public static class ModelProcess { + @JsonProperty("name") private String name; + + @JsonProperty("model") private String model; + + @JsonProperty("size") private long size; + + @JsonProperty("digest") private String digest; + + @JsonProperty("details") private ModelDetails details; - private String expiresAt; + + @JsonProperty("expires_at") + private String expiresAt; // Consider using LocalDateTime if you need to process date/time + + @JsonProperty("size_vram") private long sizeVram; } @Data @NoArgsConstructor public static class ModelDetails { + @JsonProperty("parent_model") private String parentModel; + + @JsonProperty("format") private String format; + + @JsonProperty("family") private String family; + + @JsonProperty("families") private List families; + + @JsonProperty("parameter_size") private String parameterSize; + + @JsonProperty("quantization_level") private String quantizationLevel; } } -- 2.47.2 From 11a98a72a1b8e78bffb347cd106e4d7cbf219ec5 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Tue, 6 Aug 2024 11:22:37 +0530 Subject: [PATCH 099/101] Updated docusaurus.config.js Signed-off-by: Amith Koujalgi --- docs/docusaurus.config.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 0559d8f..f9366c6 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -37,12 +37,6 @@ const config = { presets: [ [ 'classic', - { - gtag: { - trackingID: 'G-G7FLH6FNDC', - anonymizeIP: false, - }, - }, /** @type {import('@docusaurus/preset-classic').Options} */ ({ docs: { @@ -64,6 +58,10 @@ const config = { theme: { customCss: './src/css/custom.css', }, + gtag: { + trackingID: 'G-G7FLH6FNDC', + anonymizeIP: false, + }, }), ], ], -- 2.47.2 From 3aa0fc77cbe879245c9da65c44d4c45490f9e15b Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Fri, 9 Aug 2024 01:30:47 +0530 Subject: [PATCH 100/101] Updated `withMessages` method of `OllamaChatRequestBuilder` to reset the messages --- docs/docs/apis-generate/chat.md | 27 +++++++++ .../models/chat/OllamaChatRequestBuilder.java | 60 +++++++++---------- 2 files changed, 55 insertions(+), 32 deletions(-) diff --git a/docs/docs/apis-generate/chat.md b/docs/docs/apis-generate/chat.md index af23ac4..9ed9e79 100644 --- a/docs/docs/apis-generate/chat.md +++ b/docs/docs/apis-generate/chat.md @@ -82,6 +82,33 @@ You will get a response similar to: ] ``` +## Conversational loop + +```java +public class Main { + + public static void main(String[] args) { + + OllamaAPI ollamaAPI = new OllamaAPI(); + ollamaAPI.setRequestTimeoutSeconds(60); + + OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance(""); + + OllamaChatRequest requestModel = builder.withMessage(OllamaChatMessageRole.USER, "").build(); + OllamaChatResult initialChatResult = ollamaAPI.chat(requestModel); + System.out.println(initialChatResult.getResponse()); + + List history = initialChatResult.getChatHistory(); + + while (true) { + OllamaChatResult chatResult = ollamaAPI.chat(builder.withMessages(history).withMessage(OllamaChatMessageRole.USER, " messages){ + private OllamaChatRequestBuilder(String model, List messages) { request = new OllamaChatRequest(model, messages); } private OllamaChatRequest request; - public static OllamaChatRequestBuilder getInstance(String model){ + public static OllamaChatRequestBuilder getInstance(String model) { return new OllamaChatRequestBuilder(model, new ArrayList<>()); } - public OllamaChatRequest build(){ + public OllamaChatRequest build() { return request; } - public void reset(){ + public void reset() { request = new OllamaChatRequest(request.getModel(), new ArrayList<>()); } - public OllamaChatRequestBuilder withMessage(OllamaChatMessageRole role, String content, List images){ + public OllamaChatRequestBuilder withMessage(OllamaChatMessageRole role, String content, List images) { List messages = this.request.getMessages(); List binaryImages = images.stream().map(file -> { try { return Files.readAllBytes(file.toPath()); } catch (IOException e) { - LOG.warn(String.format("File '%s' could not be accessed, will not add to message!",file.toPath()), e); + LOG.warn(String.format("File '%s' could not be accessed, will not add to message!", file.toPath()), e); return new byte[0]; } }).collect(Collectors.toList()); - messages.add(new OllamaChatMessage(role,content,binaryImages)); + messages.add(new OllamaChatMessage(role, content, binaryImages)); return this; } - public OllamaChatRequestBuilder withMessage(OllamaChatMessageRole role, String content, String... imageUrls){ + public OllamaChatRequestBuilder withMessage(OllamaChatMessageRole role, String content, String... imageUrls) { List messages = this.request.getMessages(); List binaryImages = null; - if(imageUrls.length>0){ + if (imageUrls.length > 0) { binaryImages = new ArrayList<>(); for (String imageUrl : imageUrls) { - try{ + try { binaryImages.add(Utils.loadImageBytesFromUrl(imageUrl)); - } - catch (URISyntaxException e){ - LOG.warn(String.format("URL '%s' could not be accessed, will not add to message!",imageUrl), e); - } - catch (IOException e){ - LOG.warn(String.format("Content of URL '%s' could not be read, will not add to message!",imageUrl), e); + } catch (URISyntaxException e) { + LOG.warn(String.format("URL '%s' could not be accessed, will not add to message!", imageUrl), e); + } catch (IOException e) { + LOG.warn(String.format("Content of URL '%s' could not be read, will not add to message!", imageUrl), e); } } } - - messages.add(new OllamaChatMessage(role,content,binaryImages)); + + messages.add(new OllamaChatMessage(role, content, binaryImages)); return this; } - public OllamaChatRequestBuilder withMessages(List messages){ - this.request.getMessages().addAll(messages); - return this; + public OllamaChatRequestBuilder withMessages(List messages) { + return new OllamaChatRequestBuilder(request.getModel(), messages); } - public OllamaChatRequestBuilder withOptions(Options options){ + public OllamaChatRequestBuilder withOptions(Options options) { this.request.setOptions(options.getOptionsMap()); return this; } - public OllamaChatRequestBuilder withGetJsonResponse(){ + public OllamaChatRequestBuilder withGetJsonResponse() { this.request.setReturnFormatJson(true); return this; } - public OllamaChatRequestBuilder withTemplate(String template){ + public OllamaChatRequestBuilder withTemplate(String template) { this.request.setTemplate(template); return this; } - public OllamaChatRequestBuilder withStreaming(){ + public OllamaChatRequestBuilder withStreaming() { this.request.setStream(true); return this; } - public OllamaChatRequestBuilder withKeepAlive(String keepAlive){ + public OllamaChatRequestBuilder withKeepAlive(String keepAlive) { this.request.setKeepAlive(keepAlive); return this; } -- 2.47.2 From bbebd26d0764ca4ad5bd14084ced7b7a89a4325c Mon Sep 17 00:00:00 2001 From: peaster Date: Fri, 9 Aug 2024 16:24:43 -0400 Subject: [PATCH 101/101] correct Gradle dependency example to use correct declaration --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cac6a46..b937f61 100644 --- a/README.md +++ b/README.md @@ -221,7 +221,7 @@ In your Maven project, add this dependency: ```groovy dependencies { - implementation 'com.github.ollama4j:ollama4j:1.0.79' + implementation 'io.github.ollama4j:ollama4j:1.0.79' } ``` -- 2.47.2
-- 2.47.2 From a304c011946eadfb96e4b93ca7d4382dadca3778 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 27 Jul 2024 16:58:43 +0530 Subject: [PATCH 086/101] updated README.md Signed-off-by: Amith Koujalgi --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3ad3eb4..9a3ffcc 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,7 @@ In your Maven project, add this dependency: io.github.ollama4j ollama4j - 1.0.79 + 1.0.79 ``` @@ -221,7 +221,7 @@ In your Maven project, add this dependency: io.github.ollama4j ollama4j - 1.0.79 + 1.0.79 ``` @@ -231,7 +231,7 @@ In your Maven project, add this dependency: ```groovy dependencies { - implementation 'com.github.ollama4j:ollama4j:1.0.79' + implementation 'com.github.ollama4j:ollama4j:1.0.79' } ``` -- 2.47.2 From 0af80865c3c36f2619b9ec29f7925c4be441dabc Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 27 Jul 2024 16:59:15 +0530 Subject: [PATCH 087/101] updated README.md Signed-off-by: Amith Koujalgi --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9a3ffcc..3b8eed9 100644 --- a/README.md +++ b/README.md @@ -287,7 +287,7 @@ Newer artifacts are published via GitHub Actions CI workflow when a new release - `ollama-translator`: Minecraft 1.20.6 spigot plugin allows to easily break language barriers by using ollama on the server to translate all messages into a specfic target language. - https://github.com/liebki/ollama-translator -- `Ollama4j UI`: A web UI for Ollama written in Java using Spring Boot and Vaadin framework and +- `Ollama4j Web UI`: A web UI for Ollama written in Java using Spring Boot and Vaadin framework and Ollama4j. https://github.com/ollama4j/ollama4j-web-ui #### Traction -- 2.47.2 From f9cf11ecdf8b48d53d8e2d49140fb0a1221ba6a1 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 27 Jul 2024 20:54:04 +0530 Subject: [PATCH 088/101] Added `ps()` API Signed-off-by: Amith Koujalgi --- docs/docs/apis-extras/ps.md | 30 ++++++++++++++++ .../java/io/github/ollama4j/OllamaAPI.java | 33 +++++++++++++++++ .../models/ps/ModelsProcessResponse.java | 35 +++++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 docs/docs/apis-extras/ps.md create mode 100644 src/main/java/io/github/ollama4j/models/ps/ModelsProcessResponse.java diff --git a/docs/docs/apis-extras/ps.md b/docs/docs/apis-extras/ps.md new file mode 100644 index 0000000..4f37e04 --- /dev/null +++ b/docs/docs/apis-extras/ps.md @@ -0,0 +1,30 @@ +--- +sidebar_position: 4 +--- + +# PS + +This API provides a list of running models and details about each model currently loaded into memory. + +This API corresponds to the [PS](https://github.com/ollama/ollama/blob/main/docs/api.md#list-running-models) API. + +```java +package io.github.ollama4j.localtests; + +import io.github.ollama4j.OllamaAPI; +import io.github.ollama4j.exceptions.OllamaBaseException; +import io.github.ollama4j.models.ps.ModelsProcessResponse; + +import java.io.IOException; + +public class Main { + public static void main(String[] args) { + + OllamaAPI ollamaAPI = new OllamaAPI("http://localhost:11434"); + + ModelsProcessResponse response = ollamaAPI.ps(); + + System.out.println(response); + } +} +``` \ No newline at end of file diff --git a/src/main/java/io/github/ollama4j/OllamaAPI.java b/src/main/java/io/github/ollama4j/OllamaAPI.java index 32f6ede..8cc89e8 100644 --- a/src/main/java/io/github/ollama4j/OllamaAPI.java +++ b/src/main/java/io/github/ollama4j/OllamaAPI.java @@ -1,5 +1,6 @@ package io.github.ollama4j; +import com.fasterxml.jackson.core.JsonProcessingException; import io.github.ollama4j.exceptions.OllamaBaseException; import io.github.ollama4j.exceptions.ToolInvocationException; import io.github.ollama4j.exceptions.ToolNotFoundException; @@ -12,6 +13,7 @@ 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.ps.ModelsProcessResponse; import io.github.ollama4j.models.request.*; import io.github.ollama4j.tools.*; import io.github.ollama4j.utils.Options; @@ -110,6 +112,37 @@ public class OllamaAPI { return statusCode == 200; } + /** + * List models that are currently loaded into memory. + * + * @return ModelsProcessResponse + */ + public ModelsProcessResponse ps() throws IOException, InterruptedException, OllamaBaseException { + String url = this.host + "/api/ps"; + HttpClient httpClient = HttpClient.newHttpClient(); + HttpRequest httpRequest = null; + try { + httpRequest = + getRequestBuilderDefault(new URI(url)) + .header("Accept", "application/json") + .header("Content-type", "application/json") + .GET() + .build(); + } catch (URISyntaxException e) { + throw new RuntimeException(e); + } + HttpResponse response = null; + response = httpClient.send(httpRequest, HttpResponse.BodyHandlers.ofString()); + int statusCode = response.statusCode(); + String responseString = response.body(); + if (statusCode == 200) { + return Utils.getObjectMapper() + .readValue(responseString, ModelsProcessResponse.class); + } else { + throw new OllamaBaseException(statusCode + " - " + responseString); + } + } + /** * List available models from Ollama server. * diff --git a/src/main/java/io/github/ollama4j/models/ps/ModelsProcessResponse.java b/src/main/java/io/github/ollama4j/models/ps/ModelsProcessResponse.java new file mode 100644 index 0000000..8c5fb2f --- /dev/null +++ b/src/main/java/io/github/ollama4j/models/ps/ModelsProcessResponse.java @@ -0,0 +1,35 @@ +package io.github.ollama4j.models.ps; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +@Data +@NoArgsConstructor +public class ModelsProcessResponse { + private List models; + + @Data + @NoArgsConstructor + public static class ModelProcess { + private String name; + private String model; + private long size; + private String digest; + private ModelDetails details; + private String expiresAt; + private long sizeVram; + } + + @Data + @NoArgsConstructor + public static class ModelDetails { + private String parentModel; + private String format; + private String family; + private List families; + private String parameterSize; + private String quantizationLevel; + } +} -- 2.47.2 From 9a2194334f908a11c5d49baf52a1754c36ad06eb Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 27 Jul 2024 20:58:53 +0530 Subject: [PATCH 089/101] Added `ps()` API Signed-off-by: Amith Koujalgi --- src/main/java/io/github/ollama4j/OllamaAPI.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/ollama4j/OllamaAPI.java b/src/main/java/io/github/ollama4j/OllamaAPI.java index 8cc89e8..2e04e81 100644 --- a/src/main/java/io/github/ollama4j/OllamaAPI.java +++ b/src/main/java/io/github/ollama4j/OllamaAPI.java @@ -113,7 +113,7 @@ public class OllamaAPI { } /** - * List models that are currently loaded into memory. + * Provides a list of running models and details about each model currently loaded into memory. * * @return ModelsProcessResponse */ -- 2.47.2 From 00c9b16556efa8f619c1ebb6f9cd14b9ea58271d Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 27 Jul 2024 23:20:18 +0530 Subject: [PATCH 090/101] Refactored classes into `request` and `response` packages Signed-off-by: Amith Koujalgi --- .gitignore | 4 ++- docs/docs/apis-generate/chat.md | 20 +++++------ docs/docs/apis-generate/generate-async.md | 2 +- .../generate-with-image-files.md | 3 +- .../apis-generate/generate-with-image-urls.md | 3 +- docs/docs/apis-generate/generate.md | 8 ++--- docs/docs/apis-generate/prompt-builder.md | 2 +- .../get-model-details.md | 2 +- .../docs/apis-model-management/list-models.md | 2 +- .../java/io/github/ollama4j/OllamaAPI.java | 25 +++++++------- ...questModel.java => OllamaChatRequest.java} | 10 +++--- .../models/chat/OllamaChatRequestBuilder.java | 10 +++--- .../models/chat/OllamaChatResult.java | 2 +- ...tModel.java => OllamaGenerateRequest.java} | 12 +++---- .../OllamaGenerateRequestBuilder.java | 8 ++--- .../models/{ => request}/BasicAuth.java | 2 +- .../request/OllamaChatEndpointCaller.java | 3 +- .../OllamaCommonRequest.java} | 4 +-- .../models/request/OllamaEndpointCaller.java | 17 +++++----- .../request/OllamaGenerateEndpointCaller.java | 3 +- .../{ => response}/ListModelsResponse.java | 3 +- .../ollama4j/models/{ => response}/Model.java | 2 +- .../models/{ => response}/ModelDetail.java | 2 +- .../models/{ => response}/ModelMeta.java | 2 +- .../{ => response}/ModelPullResponse.java | 2 +- .../OllamaAsyncResultStreamer.java | 13 ++++--- .../OllamaErrorResponse.java} | 4 +-- .../models/{ => response}/OllamaResult.java | 2 +- .../response}/OllamaResultStream.java | 2 +- .../ollama4j/tools/OllamaToolsResult.java | 2 +- .../integrationtests/TestRealAPIs.java | 16 ++++----- .../ollama4j/unittests/TestMockedAPIs.java | 6 ++-- .../jackson/TestChatRequestSerialization.java | 34 +++++++++---------- .../TestGenerateRequestSerialization.java | 14 ++++---- .../TestModelRequestSerialization.java | 2 +- 35 files changed, 124 insertions(+), 124 deletions(-) rename src/main/java/io/github/ollama4j/models/chat/{OllamaChatRequestModel.java => OllamaChatRequest.java} (66%) rename src/main/java/io/github/ollama4j/models/generate/{OllamaGenerateRequestModel.java => OllamaGenerateRequest.java} (58%) rename src/main/java/io/github/ollama4j/models/{ => request}/BasicAuth.java (83%) rename src/main/java/io/github/ollama4j/models/{OllamaCommonRequestModel.java => request/OllamaCommonRequest.java} (91%) rename src/main/java/io/github/ollama4j/models/{ => response}/ListModelsResponse.java (72%) rename src/main/java/io/github/ollama4j/models/{ => response}/Model.java (96%) rename src/main/java/io/github/ollama4j/models/{ => response}/ModelDetail.java (94%) rename src/main/java/io/github/ollama4j/models/{ => response}/ModelMeta.java (95%) rename src/main/java/io/github/ollama4j/models/{ => response}/ModelPullResponse.java (86%) rename src/main/java/io/github/ollama4j/models/{ => response}/OllamaAsyncResultStreamer.java (92%) rename src/main/java/io/github/ollama4j/models/{OllamaErrorResponseModel.java => response/OllamaErrorResponse.java} (67%) rename src/main/java/io/github/ollama4j/models/{ => response}/OllamaResult.java (96%) rename src/main/java/io/github/ollama4j/{ => models/response}/OllamaResultStream.java (91%) diff --git a/.gitignore b/.gitignore index 1c00e11..928b77d 100644 --- a/.gitignore +++ b/.gitignore @@ -38,4 +38,6 @@ build/ .DS_Store /.idea/ pom.xml.* -release.properties \ No newline at end of file +release.properties + +src/main/java/io/github/ollama4j/localtests \ No newline at end of file diff --git a/docs/docs/apis-generate/chat.md b/docs/docs/apis-generate/chat.md index 78827bd..af23ac4 100644 --- a/docs/docs/apis-generate/chat.md +++ b/docs/docs/apis-generate/chat.md @@ -13,7 +13,7 @@ information using the history of already asked questions and the respective answ 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.OllamaChatRequest; import io.github.ollama4j.models.chat.OllamaChatResult; import io.github.ollama4j.types.OllamaModelType; @@ -27,7 +27,7 @@ public class Main { OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance(OllamaModelType.LLAMA2); // create first user question - OllamaChatRequestModel requestModel = builder.withMessage(OllamaChatMessageRole.USER, "What is the capital of France?") + OllamaChatRequest requestModel = builder.withMessage(OllamaChatMessageRole.USER, "What is the capital of France?") .build(); // start conversation with model @@ -87,8 +87,8 @@ You will get a response similar to: ```java import io.github.ollama4j.OllamaAPI; import io.github.ollama4j.models.chat.OllamaChatMessageRole; +import io.github.ollama4j.models.chat.OllamaChatRequest; 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; @@ -101,7 +101,7 @@ public class Main { OllamaAPI ollamaAPI = new OllamaAPI(host); OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance(config.getModel()); - OllamaChatRequestModel requestModel = builder.withMessage(OllamaChatMessageRole.USER, + OllamaChatRequest requestModel = builder.withMessage(OllamaChatMessageRole.USER, "What is the capital of France? And what's France's connection with Mona Lisa?") .build(); @@ -132,7 +132,7 @@ 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.chat.OllamaChatRequest; import io.github.ollama4j.models.generate.OllamaStreamHandler; import io.github.ollama4j.types.OllamaModelType; @@ -142,7 +142,7 @@ public class Main { OllamaAPI ollamaAPI = new OllamaAPI(host); OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance(OllamaModelType.LLAMA2); - OllamaChatRequestModel requestModel = builder.withMessage(OllamaChatMessageRole.USER, "List all cricket world cup teams of 2019. Name the teams!") + OllamaChatRequest requestModel = builder.withMessage(OllamaChatMessageRole.USER, "List all cricket world cup teams of 2019. Name the teams!") .build(); OllamaStreamHandler streamHandler = new ConsoleOutputStreamHandler(); ollamaAPI.chat(requestModel, streamHandler); @@ -156,7 +156,7 @@ public class Main { 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.OllamaChatRequest; import io.github.ollama4j.models.chat.OllamaChatResult; import io.github.ollama4j.types.OllamaModelType; @@ -171,7 +171,7 @@ public class Main { OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance(OllamaModelType.LLAMA2); // create request with system-prompt (overriding the model defaults) and user question - OllamaChatRequestModel requestModel = builder.withMessage(OllamaChatMessageRole.SYSTEM, "You are a silent bot that only says 'NI'. Do not say anything else under any circumstances!") + OllamaChatRequest requestModel = builder.withMessage(OllamaChatMessageRole.SYSTEM, "You are a silent bot that only says 'NI'. Do not say anything else under any circumstances!") .withMessage(OllamaChatMessageRole.USER, "What is the capital of France? And what's France's connection with Mona Lisa?") .build(); @@ -193,8 +193,8 @@ You will get a response similar to: ```java import io.github.ollama4j.OllamaAPI; import io.github.ollama4j.models.chat.OllamaChatMessageRole; +import io.github.ollama4j.models.chat.OllamaChatRequest; 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; @@ -211,7 +211,7 @@ public class Main { OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance(OllamaModelType.LLAVA); // Load Image from File and attach to user message (alternatively images could also be added via URL) - OllamaChatRequestModel requestModel = + OllamaChatRequest requestModel = builder.withMessage(OllamaChatMessageRole.USER, "What's in the picture?", List.of( new File("/path/to/image"))).build(); diff --git a/docs/docs/apis-generate/generate-async.md b/docs/docs/apis-generate/generate-async.md index ad5b786..1b8b47c 100644 --- a/docs/docs/apis-generate/generate-async.md +++ b/docs/docs/apis-generate/generate-async.md @@ -13,7 +13,7 @@ the [completion](https://github.com/jmorganca/ollama/blob/main/docs/api.md#gener ```java import io.github.ollama4j.OllamaAPI; -import io.github.ollama4j.models.OllamaAsyncResultStreamer; +import io.github.ollama4j.models.response.OllamaAsyncResultStreamer; import io.github.ollama4j.types.OllamaModelType; public class Main { diff --git a/docs/docs/apis-generate/generate-with-image-files.md b/docs/docs/apis-generate/generate-with-image-files.md index 4e4214a..b26f9ba 100644 --- a/docs/docs/apis-generate/generate-with-image-files.md +++ b/docs/docs/apis-generate/generate-with-image-files.md @@ -23,9 +23,10 @@ If you have this image downloaded and you pass the path to the downloaded image ```java import io.github.ollama4j.OllamaAPI; -import io.github.ollama4j.models.OllamaResult; +import io.github.ollama4j.models.response.OllamaResult; import io.github.ollama4j.types.OllamaModelType; import io.github.ollama4j.utils.OptionsBuilder; + import java.io.File; import java.util.List; diff --git a/docs/docs/apis-generate/generate-with-image-urls.md b/docs/docs/apis-generate/generate-with-image-urls.md index 04573b9..cf9e755 100644 --- a/docs/docs/apis-generate/generate-with-image-urls.md +++ b/docs/docs/apis-generate/generate-with-image-urls.md @@ -23,9 +23,10 @@ Passing the link of this image the following code: ```java import io.github.ollama4j.OllamaAPI; -import io.github.ollama4j.models.OllamaResult; +import io.github.ollama4j.models.response.OllamaResult; import io.github.ollama4j.types.OllamaModelType; import io.github.ollama4j.utils.OptionsBuilder; + import java.util.List; public class Main { diff --git a/docs/docs/apis-generate/generate.md b/docs/docs/apis-generate/generate.md index 70bbb89..1cd6a47 100644 --- a/docs/docs/apis-generate/generate.md +++ b/docs/docs/apis-generate/generate.md @@ -17,7 +17,7 @@ to [this](/apis-extras/options-builder). ```java import io.github.ollama4j.OllamaAPI; -import io.github.ollama4j.models.OllamaResult; +import io.github.ollama4j.models.response.OllamaResult; import io.github.ollama4j.types.OllamaModelType; import io.github.ollama4j.utils.OptionsBuilder; @@ -50,7 +50,7 @@ You will get a response similar to: ```java import io.github.ollama4j.OllamaAPI; -import io.github.ollama4j.models.OllamaResult; +import io.github.ollama4j.models.response.OllamaResult; import io.github.ollama4j.models.generate.OllamaStreamHandler; import io.github.ollama4j.utils.OptionsBuilder; @@ -91,7 +91,7 @@ You will get a response similar to: ```java import io.github.ollama4j.OllamaAPI; -import io.github.ollama4j.models.OllamaResult; +import io.github.ollama4j.models.response.OllamaResult; import io.github.ollama4j.types.OllamaModelType; import io.github.ollama4j.utils.OptionsBuilder; @@ -139,7 +139,7 @@ You'd then get a response from the model: ```java import io.github.ollama4j.OllamaAPI; -import io.github.ollama4j.models.OllamaResult; +import io.github.ollama4j.models.response.OllamaResult; import io.github.ollama4j.types.OllamaModelType; import io.github.ollama4j.utils.OptionsBuilder; import io.github.ollama4j.utils.SamplePrompts; diff --git a/docs/docs/apis-generate/prompt-builder.md b/docs/docs/apis-generate/prompt-builder.md index 150f3cd..b947dca 100644 --- a/docs/docs/apis-generate/prompt-builder.md +++ b/docs/docs/apis-generate/prompt-builder.md @@ -9,7 +9,7 @@ inferences. ```java import io.github.ollama4j.OllamaAPI; -import io.github.ollama4j.models.OllamaResult; +import io.github.ollama4j.models.response.OllamaResult; import io.github.ollama4j.types.OllamaModelType; import io.github.ollama4j.utils.OptionsBuilder; import io.github.ollama4j.utils.PromptBuilder; diff --git a/docs/docs/apis-model-management/get-model-details.md b/docs/docs/apis-model-management/get-model-details.md index d415a5c..0162e29 100644 --- a/docs/docs/apis-model-management/get-model-details.md +++ b/docs/docs/apis-model-management/get-model-details.md @@ -8,7 +8,7 @@ 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.models.response.ModelDetail; import io.github.ollama4j.types.OllamaModelType; public class Main { diff --git a/docs/docs/apis-model-management/list-models.md b/docs/docs/apis-model-management/list-models.md index 19738da..cb594ef 100644 --- a/docs/docs/apis-model-management/list-models.md +++ b/docs/docs/apis-model-management/list-models.md @@ -8,7 +8,7 @@ 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 io.github.ollama4j.models.response.Model; import java.util.List; diff --git a/src/main/java/io/github/ollama4j/OllamaAPI.java b/src/main/java/io/github/ollama4j/OllamaAPI.java index 2e04e81..64ccb18 100644 --- a/src/main/java/io/github/ollama4j/OllamaAPI.java +++ b/src/main/java/io/github/ollama4j/OllamaAPI.java @@ -1,20 +1,19 @@ package io.github.ollama4j; -import com.fasterxml.jackson.core.JsonProcessingException; 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.OllamaChatRequest; 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.OllamaGenerateRequest; import io.github.ollama4j.models.generate.OllamaStreamHandler; import io.github.ollama4j.models.ps.ModelsProcessResponse; import io.github.ollama4j.models.request.*; +import io.github.ollama4j.models.response.*; import io.github.ollama4j.tools.*; import io.github.ollama4j.utils.Options; import io.github.ollama4j.utils.Utils; @@ -384,7 +383,7 @@ public class OllamaAPI { */ public OllamaResult generate(String model, String prompt, boolean raw, Options options, OllamaStreamHandler streamHandler) throws OllamaBaseException, IOException, InterruptedException { - OllamaGenerateRequestModel ollamaRequestModel = new OllamaGenerateRequestModel(model, prompt); + OllamaGenerateRequest ollamaRequestModel = new OllamaGenerateRequest(model, prompt); ollamaRequestModel.setRaw(raw); ollamaRequestModel.setOptions(options.getOptionsMap()); return generateSyncForOllamaRequestModel(ollamaRequestModel, streamHandler); @@ -453,7 +452,7 @@ public class OllamaAPI { * @return the ollama async result callback handle */ public OllamaAsyncResultStreamer generateAsync(String model, String prompt, boolean raw) { - OllamaGenerateRequestModel ollamaRequestModel = new OllamaGenerateRequestModel(model, prompt); + OllamaGenerateRequest ollamaRequestModel = new OllamaGenerateRequest(model, prompt); ollamaRequestModel.setRaw(raw); URI uri = URI.create(this.host + "/api/generate"); OllamaAsyncResultStreamer ollamaAsyncResultStreamer = @@ -483,7 +482,7 @@ public class OllamaAPI { for (File imageFile : imageFiles) { images.add(encodeFileToBase64(imageFile)); } - OllamaGenerateRequestModel ollamaRequestModel = new OllamaGenerateRequestModel(model, prompt, images); + OllamaGenerateRequest ollamaRequestModel = new OllamaGenerateRequest(model, prompt, images); ollamaRequestModel.setOptions(options.getOptionsMap()); return generateSyncForOllamaRequestModel(ollamaRequestModel, streamHandler); } @@ -519,7 +518,7 @@ public class OllamaAPI { for (String imageURL : imageURLs) { images.add(encodeByteArrayToBase64(Utils.loadImageBytesFromUrl(imageURL))); } - OllamaGenerateRequestModel ollamaRequestModel = new OllamaGenerateRequestModel(model, prompt, images); + OllamaGenerateRequest ollamaRequestModel = new OllamaGenerateRequest(model, prompt, images); ollamaRequestModel.setOptions(options.getOptionsMap()); return generateSyncForOllamaRequestModel(ollamaRequestModel, streamHandler); } @@ -553,7 +552,7 @@ public class OllamaAPI { } /** - * Ask a question to a model using an {@link OllamaChatRequestModel}. This can be constructed using an {@link OllamaChatRequestBuilder}. + * Ask a question to a model using an {@link OllamaChatRequest}. This can be constructed using an {@link OllamaChatRequestBuilder}. *

* Hint: the OllamaChatRequestModel#getStream() property is not implemented. * @@ -563,12 +562,12 @@ public class OllamaAPI { * @throws IOException in case the responseStream can not be read * @throws InterruptedException in case the server is not reachable or network issues happen */ - public OllamaChatResult chat(OllamaChatRequestModel request) throws OllamaBaseException, IOException, InterruptedException { + public OllamaChatResult chat(OllamaChatRequest request) throws OllamaBaseException, IOException, InterruptedException { return chat(request, null); } /** - * Ask a question to a model using an {@link OllamaChatRequestModel}. This can be constructed using an {@link OllamaChatRequestBuilder}. + * Ask a question to a model using an {@link OllamaChatRequest}. This can be constructed using an {@link OllamaChatRequestBuilder}. *

* Hint: the OllamaChatRequestModel#getStream() property is not implemented. * @@ -579,7 +578,7 @@ public class OllamaAPI { * @throws IOException in case the responseStream can not be read * @throws InterruptedException in case the server is not reachable or network issues happen */ - public OllamaChatResult chat(OllamaChatRequestModel request, OllamaStreamHandler streamHandler) throws OllamaBaseException, IOException, InterruptedException { + public OllamaChatResult chat(OllamaChatRequest request, OllamaStreamHandler streamHandler) throws OllamaBaseException, IOException, InterruptedException { OllamaChatEndpointCaller requestCaller = new OllamaChatEndpointCaller(host, basicAuth, requestTimeoutSeconds, verbose); OllamaResult result; if (streamHandler != null) { @@ -606,7 +605,7 @@ public class OllamaAPI { } private OllamaResult generateSyncForOllamaRequestModel( - OllamaGenerateRequestModel ollamaRequestModel, OllamaStreamHandler streamHandler) + OllamaGenerateRequest ollamaRequestModel, OllamaStreamHandler streamHandler) throws OllamaBaseException, IOException, InterruptedException { OllamaGenerateEndpointCaller requestCaller = new OllamaGenerateEndpointCaller(host, basicAuth, requestTimeoutSeconds, verbose); diff --git a/src/main/java/io/github/ollama4j/models/chat/OllamaChatRequestModel.java b/src/main/java/io/github/ollama4j/models/chat/OllamaChatRequest.java similarity index 66% rename from src/main/java/io/github/ollama4j/models/chat/OllamaChatRequestModel.java rename to src/main/java/io/github/ollama4j/models/chat/OllamaChatRequest.java index d40739e..e6e528d 100644 --- a/src/main/java/io/github/ollama4j/models/chat/OllamaChatRequestModel.java +++ b/src/main/java/io/github/ollama4j/models/chat/OllamaChatRequest.java @@ -2,7 +2,7 @@ package io.github.ollama4j.models.chat; import java.util.List; -import io.github.ollama4j.models.OllamaCommonRequestModel; +import io.github.ollama4j.models.request.OllamaCommonRequest; import io.github.ollama4j.utils.OllamaRequestBody; import lombok.Getter; @@ -17,20 +17,20 @@ import lombok.Setter; */ @Getter @Setter -public class OllamaChatRequestModel extends OllamaCommonRequestModel implements OllamaRequestBody { +public class OllamaChatRequest extends OllamaCommonRequest implements OllamaRequestBody { private List messages; - public OllamaChatRequestModel() {} + public OllamaChatRequest() {} - public OllamaChatRequestModel(String model, List messages) { + public OllamaChatRequest(String model, List messages) { this.model = model; this.messages = messages; } @Override public boolean equals(Object o) { - if (!(o instanceof OllamaChatRequestModel)) { + if (!(o instanceof OllamaChatRequest)) { return false; } diff --git a/src/main/java/io/github/ollama4j/models/chat/OllamaChatRequestBuilder.java b/src/main/java/io/github/ollama4j/models/chat/OllamaChatRequestBuilder.java index 547fda6..1d7aa0b 100644 --- a/src/main/java/io/github/ollama4j/models/chat/OllamaChatRequestBuilder.java +++ b/src/main/java/io/github/ollama4j/models/chat/OllamaChatRequestBuilder.java @@ -15,28 +15,28 @@ import io.github.ollama4j.utils.Options; import io.github.ollama4j.utils.Utils; /** - * Helper class for creating {@link OllamaChatRequestModel} objects using the builder-pattern. + * Helper class for creating {@link OllamaChatRequest} objects using the builder-pattern. */ public class OllamaChatRequestBuilder { private static final Logger LOG = LoggerFactory.getLogger(OllamaChatRequestBuilder.class); private OllamaChatRequestBuilder(String model, List messages){ - request = new OllamaChatRequestModel(model, messages); + request = new OllamaChatRequest(model, messages); } - private OllamaChatRequestModel request; + private OllamaChatRequest request; public static OllamaChatRequestBuilder getInstance(String model){ return new OllamaChatRequestBuilder(model, new ArrayList<>()); } - public OllamaChatRequestModel build(){ + public OllamaChatRequest build(){ return request; } public void reset(){ - request = new OllamaChatRequestModel(request.getModel(), new ArrayList<>()); + request = new OllamaChatRequest(request.getModel(), new ArrayList<>()); } public OllamaChatRequestBuilder withMessage(OllamaChatMessageRole role, String content, List images){ diff --git a/src/main/java/io/github/ollama4j/models/chat/OllamaChatResult.java b/src/main/java/io/github/ollama4j/models/chat/OllamaChatResult.java index c779c60..b105e81 100644 --- a/src/main/java/io/github/ollama4j/models/chat/OllamaChatResult.java +++ b/src/main/java/io/github/ollama4j/models/chat/OllamaChatResult.java @@ -2,7 +2,7 @@ package io.github.ollama4j.models.chat; import java.util.List; -import io.github.ollama4j.models.OllamaResult; +import io.github.ollama4j.models.response.OllamaResult; /** * Specific chat-API result that contains the chat history sent to the model and appends the answer as {@link OllamaChatResult} given by the diff --git a/src/main/java/io/github/ollama4j/models/generate/OllamaGenerateRequestModel.java b/src/main/java/io/github/ollama4j/models/generate/OllamaGenerateRequest.java similarity index 58% rename from src/main/java/io/github/ollama4j/models/generate/OllamaGenerateRequestModel.java rename to src/main/java/io/github/ollama4j/models/generate/OllamaGenerateRequest.java index 3b4c693..de767dc 100644 --- a/src/main/java/io/github/ollama4j/models/generate/OllamaGenerateRequestModel.java +++ b/src/main/java/io/github/ollama4j/models/generate/OllamaGenerateRequest.java @@ -1,7 +1,7 @@ package io.github.ollama4j.models.generate; -import io.github.ollama4j.models.OllamaCommonRequestModel; +import io.github.ollama4j.models.request.OllamaCommonRequest; import io.github.ollama4j.utils.OllamaRequestBody; import java.util.List; @@ -11,7 +11,7 @@ import lombok.Setter; @Getter @Setter -public class OllamaGenerateRequestModel extends OllamaCommonRequestModel implements OllamaRequestBody{ +public class OllamaGenerateRequest extends OllamaCommonRequest implements OllamaRequestBody{ private String prompt; private List images; @@ -20,15 +20,15 @@ public class OllamaGenerateRequestModel extends OllamaCommonRequestModel impleme private String context; private boolean raw; - public OllamaGenerateRequestModel() { + public OllamaGenerateRequest() { } - public OllamaGenerateRequestModel(String model, String prompt) { + public OllamaGenerateRequest(String model, String prompt) { this.model = model; this.prompt = prompt; } - public OllamaGenerateRequestModel(String model, String prompt, List images) { + public OllamaGenerateRequest(String model, String prompt, List images) { this.model = model; this.prompt = prompt; this.images = images; @@ -36,7 +36,7 @@ public class OllamaGenerateRequestModel extends OllamaCommonRequestModel impleme @Override public boolean equals(Object o) { - if (!(o instanceof OllamaGenerateRequestModel)) { + if (!(o instanceof OllamaGenerateRequest)) { return false; } diff --git a/src/main/java/io/github/ollama4j/models/generate/OllamaGenerateRequestBuilder.java b/src/main/java/io/github/ollama4j/models/generate/OllamaGenerateRequestBuilder.java index 2bd3dce..f802094 100644 --- a/src/main/java/io/github/ollama4j/models/generate/OllamaGenerateRequestBuilder.java +++ b/src/main/java/io/github/ollama4j/models/generate/OllamaGenerateRequestBuilder.java @@ -3,22 +3,22 @@ package io.github.ollama4j.models.generate; import io.github.ollama4j.utils.Options; /** - * Helper class for creating {@link OllamaGenerateRequestModel} + * Helper class for creating {@link OllamaGenerateRequest} * objects using the builder-pattern. */ public class OllamaGenerateRequestBuilder { private OllamaGenerateRequestBuilder(String model, String prompt){ - request = new OllamaGenerateRequestModel(model, prompt); + request = new OllamaGenerateRequest(model, prompt); } - private OllamaGenerateRequestModel request; + private OllamaGenerateRequest request; public static OllamaGenerateRequestBuilder getInstance(String model){ return new OllamaGenerateRequestBuilder(model,""); } - public OllamaGenerateRequestModel build(){ + public OllamaGenerateRequest build(){ return request; } diff --git a/src/main/java/io/github/ollama4j/models/BasicAuth.java b/src/main/java/io/github/ollama4j/models/request/BasicAuth.java similarity index 83% rename from src/main/java/io/github/ollama4j/models/BasicAuth.java rename to src/main/java/io/github/ollama4j/models/request/BasicAuth.java index 897e71f..f3372a9 100644 --- a/src/main/java/io/github/ollama4j/models/BasicAuth.java +++ b/src/main/java/io/github/ollama4j/models/request/BasicAuth.java @@ -1,4 +1,4 @@ -package io.github.ollama4j.models; +package io.github.ollama4j.models.request; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/src/main/java/io/github/ollama4j/models/request/OllamaChatEndpointCaller.java b/src/main/java/io/github/ollama4j/models/request/OllamaChatEndpointCaller.java index a3314d4..b875bf8 100644 --- a/src/main/java/io/github/ollama4j/models/request/OllamaChatEndpointCaller.java +++ b/src/main/java/io/github/ollama4j/models/request/OllamaChatEndpointCaller.java @@ -2,8 +2,7 @@ package io.github.ollama4j.models.request; import com.fasterxml.jackson.core.JsonProcessingException; import io.github.ollama4j.exceptions.OllamaBaseException; -import io.github.ollama4j.models.BasicAuth; -import io.github.ollama4j.models.OllamaResult; +import io.github.ollama4j.models.response.OllamaResult; import io.github.ollama4j.models.chat.OllamaChatResponseModel; import io.github.ollama4j.models.chat.OllamaChatStreamObserver; import io.github.ollama4j.models.generate.OllamaStreamHandler; diff --git a/src/main/java/io/github/ollama4j/models/OllamaCommonRequestModel.java b/src/main/java/io/github/ollama4j/models/request/OllamaCommonRequest.java similarity index 91% rename from src/main/java/io/github/ollama4j/models/OllamaCommonRequestModel.java rename to src/main/java/io/github/ollama4j/models/request/OllamaCommonRequest.java index b6ef074..2e6ed7e 100644 --- a/src/main/java/io/github/ollama4j/models/OllamaCommonRequestModel.java +++ b/src/main/java/io/github/ollama4j/models/request/OllamaCommonRequest.java @@ -1,4 +1,4 @@ -package io.github.ollama4j.models; +package io.github.ollama4j.models.request; import java.util.Map; import com.fasterxml.jackson.annotation.JsonInclude; @@ -12,7 +12,7 @@ import lombok.Data; @Data @JsonInclude(JsonInclude.Include.NON_NULL) -public abstract class OllamaCommonRequestModel { +public abstract class OllamaCommonRequest { protected String model; @JsonSerialize(using = BooleanToJsonFormatFlagSerializer.class) diff --git a/src/main/java/io/github/ollama4j/models/request/OllamaEndpointCaller.java b/src/main/java/io/github/ollama4j/models/request/OllamaEndpointCaller.java index c1aed87..8529c18 100644 --- a/src/main/java/io/github/ollama4j/models/request/OllamaEndpointCaller.java +++ b/src/main/java/io/github/ollama4j/models/request/OllamaEndpointCaller.java @@ -2,9 +2,8 @@ package io.github.ollama4j.models.request; 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.models.response.OllamaErrorResponse; +import io.github.ollama4j.models.response.OllamaResult; import io.github.ollama4j.utils.OllamaRequestBody; import io.github.ollama4j.utils.Utils; import org.slf4j.Logger; @@ -78,19 +77,19 @@ public abstract class OllamaEndpointCaller { while ((line = reader.readLine()) != null) { if (statusCode == 404) { LOG.warn("Status code: 404 (Not Found)"); - OllamaErrorResponseModel ollamaResponseModel = - Utils.getObjectMapper().readValue(line, OllamaErrorResponseModel.class); + OllamaErrorResponse ollamaResponseModel = + Utils.getObjectMapper().readValue(line, OllamaErrorResponse.class); responseBuffer.append(ollamaResponseModel.getError()); } else if (statusCode == 401) { LOG.warn("Status code: 401 (Unauthorized)"); - OllamaErrorResponseModel ollamaResponseModel = + OllamaErrorResponse ollamaResponseModel = Utils.getObjectMapper() - .readValue("{\"error\":\"Unauthorized\"}", OllamaErrorResponseModel.class); + .readValue("{\"error\":\"Unauthorized\"}", OllamaErrorResponse.class); responseBuffer.append(ollamaResponseModel.getError()); } else if (statusCode == 400) { LOG.warn("Status code: 400 (Bad Request)"); - OllamaErrorResponseModel ollamaResponseModel = Utils.getObjectMapper().readValue(line, - OllamaErrorResponseModel.class); + OllamaErrorResponse ollamaResponseModel = Utils.getObjectMapper().readValue(line, + OllamaErrorResponse.class); responseBuffer.append(ollamaResponseModel.getError()); } else { boolean finished = parseResponseAndAddToBuffer(line, responseBuffer); diff --git a/src/main/java/io/github/ollama4j/models/request/OllamaGenerateEndpointCaller.java b/src/main/java/io/github/ollama4j/models/request/OllamaGenerateEndpointCaller.java index da73316..f4afb2c 100644 --- a/src/main/java/io/github/ollama4j/models/request/OllamaGenerateEndpointCaller.java +++ b/src/main/java/io/github/ollama4j/models/request/OllamaGenerateEndpointCaller.java @@ -2,8 +2,7 @@ package io.github.ollama4j.models.request; import com.fasterxml.jackson.core.JsonProcessingException; import io.github.ollama4j.exceptions.OllamaBaseException; -import io.github.ollama4j.models.BasicAuth; -import io.github.ollama4j.models.OllamaResult; +import io.github.ollama4j.models.response.OllamaResult; import io.github.ollama4j.models.generate.OllamaGenerateResponseModel; import io.github.ollama4j.models.generate.OllamaGenerateStreamObserver; import io.github.ollama4j.models.generate.OllamaStreamHandler; diff --git a/src/main/java/io/github/ollama4j/models/ListModelsResponse.java b/src/main/java/io/github/ollama4j/models/response/ListModelsResponse.java similarity index 72% rename from src/main/java/io/github/ollama4j/models/ListModelsResponse.java rename to src/main/java/io/github/ollama4j/models/response/ListModelsResponse.java index e78700d..62f151b 100644 --- a/src/main/java/io/github/ollama4j/models/ListModelsResponse.java +++ b/src/main/java/io/github/ollama4j/models/response/ListModelsResponse.java @@ -1,6 +1,7 @@ -package io.github.ollama4j.models; +package io.github.ollama4j.models.response; import java.util.List; + import lombok.Data; @Data diff --git a/src/main/java/io/github/ollama4j/models/Model.java b/src/main/java/io/github/ollama4j/models/response/Model.java similarity index 96% rename from src/main/java/io/github/ollama4j/models/Model.java rename to src/main/java/io/github/ollama4j/models/response/Model.java index 5841c8f..e03049e 100644 --- a/src/main/java/io/github/ollama4j/models/Model.java +++ b/src/main/java/io/github/ollama4j/models/response/Model.java @@ -1,4 +1,4 @@ -package io.github.ollama4j.models; +package io.github.ollama4j.models.response; import java.time.OffsetDateTime; diff --git a/src/main/java/io/github/ollama4j/models/ModelDetail.java b/src/main/java/io/github/ollama4j/models/response/ModelDetail.java similarity index 94% rename from src/main/java/io/github/ollama4j/models/ModelDetail.java rename to src/main/java/io/github/ollama4j/models/response/ModelDetail.java index 3d1a397..cf7e6bb 100644 --- a/src/main/java/io/github/ollama4j/models/ModelDetail.java +++ b/src/main/java/io/github/ollama4j/models/response/ModelDetail.java @@ -1,4 +1,4 @@ -package io.github.ollama4j.models; +package io.github.ollama4j.models.response; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/io/github/ollama4j/models/ModelMeta.java b/src/main/java/io/github/ollama4j/models/response/ModelMeta.java similarity index 95% rename from src/main/java/io/github/ollama4j/models/ModelMeta.java rename to src/main/java/io/github/ollama4j/models/response/ModelMeta.java index 812bf0c..eb7f176 100644 --- a/src/main/java/io/github/ollama4j/models/ModelMeta.java +++ b/src/main/java/io/github/ollama4j/models/response/ModelMeta.java @@ -1,4 +1,4 @@ -package io.github.ollama4j.models; +package io.github.ollama4j.models.response; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/io/github/ollama4j/models/ModelPullResponse.java b/src/main/java/io/github/ollama4j/models/response/ModelPullResponse.java similarity index 86% rename from src/main/java/io/github/ollama4j/models/ModelPullResponse.java rename to src/main/java/io/github/ollama4j/models/response/ModelPullResponse.java index 12afa88..dc8349e 100644 --- a/src/main/java/io/github/ollama4j/models/ModelPullResponse.java +++ b/src/main/java/io/github/ollama4j/models/response/ModelPullResponse.java @@ -1,4 +1,4 @@ -package io.github.ollama4j.models; +package io.github.ollama4j.models.response; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.Data; diff --git a/src/main/java/io/github/ollama4j/models/OllamaAsyncResultStreamer.java b/src/main/java/io/github/ollama4j/models/response/OllamaAsyncResultStreamer.java similarity index 92% rename from src/main/java/io/github/ollama4j/models/OllamaAsyncResultStreamer.java rename to src/main/java/io/github/ollama4j/models/response/OllamaAsyncResultStreamer.java index 0655b41..11c726c 100644 --- a/src/main/java/io/github/ollama4j/models/OllamaAsyncResultStreamer.java +++ b/src/main/java/io/github/ollama4j/models/response/OllamaAsyncResultStreamer.java @@ -1,8 +1,7 @@ -package io.github.ollama4j.models; +package io.github.ollama4j.models.response; -import io.github.ollama4j.OllamaResultStream; import io.github.ollama4j.exceptions.OllamaBaseException; -import io.github.ollama4j.models.generate.OllamaGenerateRequestModel; +import io.github.ollama4j.models.generate.OllamaGenerateRequest; import io.github.ollama4j.models.generate.OllamaGenerateResponseModel; import io.github.ollama4j.utils.Utils; import lombok.Data; @@ -25,7 +24,7 @@ import java.time.Duration; @SuppressWarnings("unused") public class OllamaAsyncResultStreamer extends Thread { private final HttpRequest.Builder requestBuilder; - private final OllamaGenerateRequestModel ollamaRequestModel; + private final OllamaGenerateRequest ollamaRequestModel; private final OllamaResultStream stream = new OllamaResultStream(); private String completeResponse; @@ -56,7 +55,7 @@ public class OllamaAsyncResultStreamer extends Thread { public OllamaAsyncResultStreamer( HttpRequest.Builder requestBuilder, - OllamaGenerateRequestModel ollamaRequestModel, + OllamaGenerateRequest ollamaRequestModel, long requestTimeoutSeconds) { this.requestBuilder = requestBuilder; this.ollamaRequestModel = ollamaRequestModel; @@ -91,8 +90,8 @@ public class OllamaAsyncResultStreamer extends Thread { StringBuilder responseBuffer = new StringBuilder(); while ((line = reader.readLine()) != null) { if (statusCode == 404) { - OllamaErrorResponseModel ollamaResponseModel = - Utils.getObjectMapper().readValue(line, OllamaErrorResponseModel.class); + OllamaErrorResponse ollamaResponseModel = + Utils.getObjectMapper().readValue(line, OllamaErrorResponse.class); stream.add(ollamaResponseModel.getError()); responseBuffer.append(ollamaResponseModel.getError()); } else { diff --git a/src/main/java/io/github/ollama4j/models/OllamaErrorResponseModel.java b/src/main/java/io/github/ollama4j/models/response/OllamaErrorResponse.java similarity index 67% rename from src/main/java/io/github/ollama4j/models/OllamaErrorResponseModel.java rename to src/main/java/io/github/ollama4j/models/response/OllamaErrorResponse.java index 39e8df3..bbc78c1 100644 --- a/src/main/java/io/github/ollama4j/models/OllamaErrorResponseModel.java +++ b/src/main/java/io/github/ollama4j/models/response/OllamaErrorResponse.java @@ -1,11 +1,11 @@ -package io.github.ollama4j.models; +package io.github.ollama4j.models.response; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.Data; @Data @JsonIgnoreProperties(ignoreUnknown = true) -public class OllamaErrorResponseModel { +public class OllamaErrorResponse { private String error; } diff --git a/src/main/java/io/github/ollama4j/models/OllamaResult.java b/src/main/java/io/github/ollama4j/models/response/OllamaResult.java similarity index 96% rename from src/main/java/io/github/ollama4j/models/OllamaResult.java rename to src/main/java/io/github/ollama4j/models/response/OllamaResult.java index c7bd08d..beb01ec 100644 --- a/src/main/java/io/github/ollama4j/models/OllamaResult.java +++ b/src/main/java/io/github/ollama4j/models/response/OllamaResult.java @@ -1,4 +1,4 @@ -package io.github.ollama4j.models; +package io.github.ollama4j.models.response; import static io.github.ollama4j.utils.Utils.getObjectMapper; diff --git a/src/main/java/io/github/ollama4j/OllamaResultStream.java b/src/main/java/io/github/ollama4j/models/response/OllamaResultStream.java similarity index 91% rename from src/main/java/io/github/ollama4j/OllamaResultStream.java rename to src/main/java/io/github/ollama4j/models/response/OllamaResultStream.java index 7530421..de44d63 100644 --- a/src/main/java/io/github/ollama4j/OllamaResultStream.java +++ b/src/main/java/io/github/ollama4j/models/response/OllamaResultStream.java @@ -1,4 +1,4 @@ -package io.github.ollama4j; +package io.github.ollama4j.models.response; import java.util.Iterator; import java.util.LinkedList; diff --git a/src/main/java/io/github/ollama4j/tools/OllamaToolsResult.java b/src/main/java/io/github/ollama4j/tools/OllamaToolsResult.java index bf048b0..c855bd2 100644 --- a/src/main/java/io/github/ollama4j/tools/OllamaToolsResult.java +++ b/src/main/java/io/github/ollama4j/tools/OllamaToolsResult.java @@ -1,6 +1,6 @@ package io.github.ollama4j.tools; -import io.github.ollama4j.models.OllamaResult; +import io.github.ollama4j.models.response.OllamaResult; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; diff --git a/src/test/java/io/github/ollama4j/integrationtests/TestRealAPIs.java b/src/test/java/io/github/ollama4j/integrationtests/TestRealAPIs.java index 7c21ec9..d584747 100644 --- a/src/test/java/io/github/ollama4j/integrationtests/TestRealAPIs.java +++ b/src/test/java/io/github/ollama4j/integrationtests/TestRealAPIs.java @@ -2,11 +2,11 @@ package io.github.ollama4j.integrationtests; 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.response.ModelDetail; +import io.github.ollama4j.models.chat.OllamaChatRequest; +import io.github.ollama4j.models.response.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; @@ -177,7 +177,7 @@ class TestRealAPIs { testEndpointReachability(); try { OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance(config.getModel()); - OllamaChatRequestModel requestModel = builder.withMessage(OllamaChatMessageRole.USER, "What is the capital of France?") + OllamaChatRequest requestModel = builder.withMessage(OllamaChatMessageRole.USER, "What is the capital of France?") .withMessage(OllamaChatMessageRole.ASSISTANT, "Should be Paris!") .withMessage(OllamaChatMessageRole.USER, "And what is the second larges city?") .build(); @@ -197,7 +197,7 @@ class TestRealAPIs { testEndpointReachability(); try { OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance(config.getModel()); - OllamaChatRequestModel requestModel = builder.withMessage(OllamaChatMessageRole.SYSTEM, + OllamaChatRequest requestModel = builder.withMessage(OllamaChatMessageRole.SYSTEM, "You are a silent bot that only says 'NI'. Do not say anything else under any circumstances!") .withMessage(OllamaChatMessageRole.USER, "What is the capital of France? And what's France's connection with Mona Lisa?") @@ -219,7 +219,7 @@ class TestRealAPIs { testEndpointReachability(); try { OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance(config.getModel()); - OllamaChatRequestModel requestModel = builder.withMessage(OllamaChatMessageRole.USER, + OllamaChatRequest requestModel = builder.withMessage(OllamaChatMessageRole.USER, "What is the capital of France? And what's France's connection with Mona Lisa?") .build(); @@ -245,7 +245,7 @@ class TestRealAPIs { try { OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance(config.getImageModel()); - OllamaChatRequestModel requestModel = + OllamaChatRequest requestModel = builder.withMessage(OllamaChatMessageRole.USER, "What's in the picture?", List.of(getImageFileFromClasspath("dog-on-a-boat.jpg"))).build(); @@ -275,7 +275,7 @@ class TestRealAPIs { testEndpointReachability(); try { OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance(config.getImageModel()); - OllamaChatRequestModel requestModel = builder.withMessage(OllamaChatMessageRole.USER, "What's in the picture?", + OllamaChatRequest requestModel = builder.withMessage(OllamaChatMessageRole.USER, "What's in the picture?", "https://t3.ftcdn.net/jpg/02/96/63/80/360_F_296638053_0gUVA4WVBKceGsIr7LNqRWSnkusi07dq.jpg") .build(); diff --git a/src/test/java/io/github/ollama4j/unittests/TestMockedAPIs.java b/src/test/java/io/github/ollama4j/unittests/TestMockedAPIs.java index 61023e9..921ccf7 100644 --- a/src/test/java/io/github/ollama4j/unittests/TestMockedAPIs.java +++ b/src/test/java/io/github/ollama4j/unittests/TestMockedAPIs.java @@ -2,9 +2,9 @@ package io.github.ollama4j.unittests; 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.models.response.ModelDetail; +import io.github.ollama4j.models.response.OllamaAsyncResultStreamer; +import io.github.ollama4j.models.response.OllamaResult; import io.github.ollama4j.types.OllamaModelType; import io.github.ollama4j.utils.OptionsBuilder; import org.junit.jupiter.api.Test; diff --git a/src/test/java/io/github/ollama4j/unittests/jackson/TestChatRequestSerialization.java b/src/test/java/io/github/ollama4j/unittests/jackson/TestChatRequestSerialization.java index fc9a1ea..2391a94 100644 --- a/src/test/java/io/github/ollama4j/unittests/jackson/TestChatRequestSerialization.java +++ b/src/test/java/io/github/ollama4j/unittests/jackson/TestChatRequestSerialization.java @@ -5,16 +5,16 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.File; import java.util.List; +import io.github.ollama4j.models.chat.OllamaChatRequest; import org.json.JSONObject; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; 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 { +public class TestChatRequestSerialization extends AbstractSerializationTest { private OllamaChatRequestBuilder builder; @@ -25,32 +25,32 @@ public class TestChatRequestSerialization extends AbstractSerializationTest { +public class TestGenerateRequestSerialization extends AbstractSerializationTest { private OllamaGenerateRequestBuilder builder; @@ -22,27 +22,27 @@ public class TestGenerateRequestSerialization extends AbstractSerializationTest< @Test public void testRequestOnlyMandatoryFields() { - OllamaGenerateRequestModel req = builder.withPrompt("Some prompt").build(); + OllamaGenerateRequest req = builder.withPrompt("Some prompt").build(); String jsonRequest = serialize(req); - assertEqualsAfterUnmarshalling(deserialize(jsonRequest, OllamaGenerateRequestModel.class), req); + assertEqualsAfterUnmarshalling(deserialize(jsonRequest, OllamaGenerateRequest.class), req); } @Test public void testRequestWithOptions() { OptionsBuilder b = new OptionsBuilder(); - OllamaGenerateRequestModel req = + OllamaGenerateRequest req = builder.withPrompt("Some prompt").withOptions(b.setMirostat(1).build()).build(); String jsonRequest = serialize(req); - OllamaGenerateRequestModel deserializeRequest = deserialize(jsonRequest, OllamaGenerateRequestModel.class); + OllamaGenerateRequest deserializeRequest = deserialize(jsonRequest, OllamaGenerateRequest.class); assertEqualsAfterUnmarshalling(deserializeRequest, req); assertEquals(1, deserializeRequest.getOptions().get("mirostat")); } @Test public void testWithJsonFormat() { - OllamaGenerateRequestModel req = + OllamaGenerateRequest req = builder.withPrompt("Some prompt").withGetJsonResponse().build(); String jsonRequest = serialize(req); diff --git a/src/test/java/io/github/ollama4j/unittests/jackson/TestModelRequestSerialization.java b/src/test/java/io/github/ollama4j/unittests/jackson/TestModelRequestSerialization.java index ac6213e..5bc44f3 100644 --- a/src/test/java/io/github/ollama4j/unittests/jackson/TestModelRequestSerialization.java +++ b/src/test/java/io/github/ollama4j/unittests/jackson/TestModelRequestSerialization.java @@ -1,6 +1,6 @@ package io.github.ollama4j.unittests.jackson; -import io.github.ollama4j.models.Model; +import io.github.ollama4j.models.response.Model; import org.junit.jupiter.api.Test; public class TestModelRequestSerialization extends AbstractSerializationTest { -- 2.47.2 From a84230bbd1def02cdba0b6499148d481e76b05a4 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 27 Jul 2024 23:30:53 +0530 Subject: [PATCH 091/101] updated README.md Signed-off-by: Amith Koujalgi --- README.md | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/README.md b/README.md index 3b8eed9..0766db9 100644 --- a/README.md +++ b/README.md @@ -294,32 +294,6 @@ Newer artifacts are published via GitHub Actions CI workflow when a new release [![Star History Chart](https://api.star-history.com/svg?repos=ollama4j/ollama4j&type=Date)](https://star-history.com/#ollama4j/ollama4j&Date) -### Areas of improvement - -- [x] Use Java-naming conventions for attributes in the request/response models instead of the - snake-case conventions. ( - possibly with Jackson-mapper's `@JsonProperty`) -- [x] Fix deprecated HTTP client code -- [x] Setup logging -- [x] Use lombok -- [x] Update request body creation with Java objects -- [ ] Async APIs for images -- [ ] Support for function calling with models like Mistral - - [x] generate in sync mode - - [ ] generate in async mode -- [ ] Add custom headers to requests -- [x] Add additional params for `ask` APIs such as: - - [x] `options`: additional model parameters for the Modelfile such as `temperature` - - Supported [params](https://github.com/jmorganca/ollama/blob/main/docs/modelfile.md#valid-parameters-and-values). - - [x] `system`: system prompt to (overrides what is defined in the Modelfile) - - [x] `template`: the full prompt or prompt template (overrides what is defined in the Modelfile) - - [x] `context`: the context parameter returned from a previous request, which can be used to keep a - short - conversational memory - - [x] `stream`: Add support for streaming responses from the model -- [ ] Add test cases -- [ ] Handle exceptions better (maybe throw more appropriate exceptions) - ### Get Involved

-- 2.47.2 From b5b1a26941c7cb2d58b38614c599a381eb573575 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 27 Jul 2024 23:52:00 +0530 Subject: [PATCH 092/101] updated README.md Signed-off-by: Amith Koujalgi --- README.md | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 0766db9..9486473 100644 --- a/README.md +++ b/README.md @@ -70,38 +70,36 @@ 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](https://img.shields.io/badge/v0.3.0-green.svg?style=for-the-badge&labelColor=gray&label=Ollama&color=blue) + + @@ -132,13 +130,6 @@ docker run -d -p 11434:11434 \
-[![][ollama-shield]][ollama-link] +Local Installation -[![][ollama-docker-shield]][ollama-docker] +Docker Installation
+Download for macOS +Download for Windows -macOS - -https://ollama.com/download/Ollama-darwin.zip - -Linux +Install on Linux ```shell curl -fsSL https://ollama.com/install.sh \| sh ``` -Windows - -https://ollama.com/download/OllamaSetup.exe
-[ollama-link]: https://ollama.ai/ - -[ollama-shield]: https://img.shields.io/badge/Ollama-Local_Installation-blue.svg?style=for-the-badge&labelColor=gray - -[ollama-docker]: https://hub.docker.com/r/ollama/ollama - -[ollama-docker-shield]: https://img.shields.io/badge/Ollama-Docker-blue.svg?style=for-the-badge&labelColor=gray ## Installation -- 2.47.2 From 4412ac683ab49e3ab3cb12e5c8093aa03b198cc7 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 27 Jul 2024 23:53:54 +0530 Subject: [PATCH 093/101] updated README.md Signed-off-by: Amith Koujalgi --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9486473..51caf18 100644 --- a/README.md +++ b/README.md @@ -70,8 +70,10 @@ 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](https://img.shields.io/badge/v0.3.0-green.svg?style=for-the-badge&labelColor=gray&label=Ollama&color=blue) + + + @@ -100,8 +102,6 @@ Install on Linux curl -fsSL https://ollama.com/install.sh \| sh ``` - -
@@ -130,7 +130,6 @@ docker run -d -p 11434:11434 \
- ## Installation > [!NOTE] -- 2.47.2 From d4ee9ed051d372edf506cc0c0a08d5a90d72be2b Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Sat, 27 Jul 2024 23:55:21 +0530 Subject: [PATCH 094/101] updated README.md Signed-off-by: Amith Koujalgi --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 51caf18..cac6a46 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ 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) - + @@ -79,27 +79,27 @@ Find more details on the [website](https://ollama4j.github.io/ollama4j/).
-Local Installation +Local Installation -Docker Installation +Docker Installation
-Download for macOS +Download for macOS -Download for Windows +Download for Windows Install on Linux ```shell -curl -fsSL https://ollama.com/install.sh \| sh +curl -fsSL https://ollama.com/install.sh | sh ```