1008 Commits

Author SHA1 Message Date
amithkoujalgi
453112d09f
Add metrics documentation for Ollama4j library
- Introduced a new `metrics.md` file detailing the metrics available in the Ollama4j library, including total requests, response time, error rate, and active sessions.
- Provided examples of accessing metrics in Java and integrating with monitoring tools like Prometheus and Grafana.
- Included a warning note indicating that the documentation is a work in progress.
2025-10-01 01:14:21 +05:30
amithkoujalgi
fd18a247d7
Update GitHub Actions workflow to use Makefile for test execution
- Replaced Maven commands with Makefile targets for running unit and integration tests in the GitHub Actions workflow.
- Updated the commands to `make unit-tests` and `make integration-tests-basic` for improved consistency and maintainability.
2025-09-29 11:15:21 +05:30
amithkoujalgi
501c35fa44
Refactor integration test targets in Makefile and update workflow
- Renamed integration test targets in the Makefile for clarity: `integration-tests` to `integration-tests-all` and added `integration-tests-basic`.
- Updated GitHub Actions workflow to run the new `integration-tests-basic` target.
- Cleaned up the `WithAuth` test class by removing unused imports and simplifying method signatures.
2025-09-29 10:36:13 +05:30
amithkoujalgi
f114181fe2
Update documentation and refactor code to replace OllamaAPI with Ollama
- Replaced all instances of `OllamaAPI` with `Ollama` in documentation and code examples for consistency.
- Enhanced the configuration for handling broken markdown links in Docusaurus.
- Updated integration tests and example code snippets to reflect the new class structure.
2025-09-29 09:31:32 +05:30
amithkoujalgi
35bf3de62a
Refactor OllamaAPI to Ollama class and update documentation
- Replaced instances of `OllamaAPI` with `Ollama` across the codebase for consistency.
- Updated example code snippets in documentation to reflect the new class name.
- Enhanced metrics collection setup in the documentation.
- Added integration tests for the new `Ollama` class to ensure functionality remains intact.
2025-09-28 23:30:02 +05:30
Amith Koujalgi
6fce6ec777
Merge pull request #183 from ollama4j/refactor
Some checks failed
Mark stale issues / stale (push) Failing after 21s
Mark stale issues and PRs / stale (push) Failing after 1m33s
CodeQL / Analyze (javascript) (push) Failing after 11s
CodeQL / Analyze (java) (push) Failing after 13s
Refactor: with breaking changes
2025-09-28 23:11:19 +05:30
amithkoujalgi
61fe8b2b56
Refactor model response classes and update API methods
- Renamed `ModelProcessesResponse` to `ModelProcessesResult` and updated all related references in the codebase.
- Introduced `OllamaEmbedResult` class to replace `OllamaEmbedResponse`, ensuring consistency across the API.
- Updated method signatures in `OllamaAPI` to reflect the new class names and adjusted integration tests accordingly.
2025-09-28 22:52:24 +05:30
amithkoujalgi
dd1022a990
Add Javadoc generation to Makefile and refactor model classes
- Introduced a new `javadoc` target in the Makefile to generate Javadocs.
- Refactored model classes: renamed `ModelsProcessResponse` to `ModelProcessesResponse` and updated related references.
- Updated `OllamaEmbedRequestModel` and `OllamaEmbedResponseModel` to `OllamaEmbedRequest` and `OllamaEmbedResponse`, respectively, across the codebase.
- Added new classes for `OllamaEmbedRequest` and `OllamaEmbedResponse` to improve clarity and maintainability.
2025-09-28 22:46:37 +05:30
amithkoujalgi
36f7d14c68
Refactor OllamaAPI exception handling to properly manage InterruptedException and improve logging. Remove unused Logback Classic dependency from pom.xml and clean up commented-out code in integration tests. 2025-09-28 22:28:48 +05:30
amithkoujalgi
e9a4599714
Refactor exception handling by replacing OllamaBaseException with OllamaException across the codebase. Update relevant method signatures and import statements accordingly. 2025-09-28 22:01:17 +05:30
amithkoujalgi
e06507a06b
Merge branch 'main' into refactor 2025-09-28 18:09:55 +05:30
amithkoujalgi
195b54e07e
Update README.md 2025-09-28 18:09:37 +05:30
Amith Koujalgi
b05242873d
Merge pull request #186 from ollama4j/dependabot/npm_and_yarn/docs/iconify/react-6.0.2
Some checks failed
CodeQL / Analyze (java) (push) Failing after 13s
CodeQL / Analyze (javascript) (push) Failing after 12s
Bump @iconify/react from 6.0.1 to 6.0.2 in /docs
2025-09-28 18:09:06 +05:30
Amith Koujalgi
eccb052de8
Merge pull request #187 from ollama4j/dependabot/maven/org.sonatype.plugins-nexus-staging-maven-plugin-1.7.0
Bump org.sonatype.plugins:nexus-staging-maven-plugin from 1.6.13 to 1.7.0
2025-09-28 18:08:53 +05:30
Amith Koujalgi
077dd36b3c
Merge pull request #185 from ollama4j/dependabot/npm_and_yarn/docs/docsearch/js-4.0.1
Bump @docsearch/js from 3.9.0 to 4.0.1 in /docs
2025-09-28 18:08:38 +05:30
Amith Koujalgi
6405b36854
Merge pull request #188 from ollama4j/dependabot/maven/org.apache.maven.plugins-maven-surefire-plugin-3.5.4
Bump org.apache.maven.plugins:maven-surefire-plugin from 3.0.0-M5 to 3.5.4
2025-09-28 18:08:21 +05:30
Amith Koujalgi
99f413282c
Merge pull request #189 from ollama4j/dependabot/maven/org.junit.jupiter-junit-jupiter-api-5.13.4
Bump org.junit.jupiter:junit-jupiter-api from 5.10.0 to 5.13.4
2025-09-28 18:07:41 +05:30
Amith Koujalgi
b3e5af30ab
Merge pull request #190 from ollama4j/dependabot/maven/org.apache.maven.plugins-maven-javadoc-plugin-3.12.0
Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.11.3 to 3.12.0
2025-09-28 18:07:19 +05:30
dependabot[bot]
b8b2bb5f7a
Bump @docsearch/js from 3.9.0 to 4.0.1 in /docs
Bumps [@docsearch/js](https://github.com/algolia/docsearch/tree/HEAD/packages/docsearch-js) from 3.9.0 to 4.0.1.
- [Release notes](https://github.com/algolia/docsearch/releases)
- [Changelog](https://github.com/algolia/docsearch/blob/main/CHANGELOG.md)
- [Commits](https://github.com/algolia/docsearch/commits/v4.0.1/packages/docsearch-js)

---
updated-dependencies:
- dependency-name: "@docsearch/js"
  dependency-version: 4.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-28 12:36:56 +00:00
Amith Koujalgi
806fa726c1
Merge pull request #191 from ollama4j/dependabot/maven/org.apache.maven.plugins-maven-gpg-plugin-3.2.8
Bump org.apache.maven.plugins:maven-gpg-plugin from 1.5 to 3.2.8
2025-09-28 18:06:55 +05:30
dependabot[bot]
1f0ea0ac4d
Bump @iconify/react from 6.0.1 to 6.0.2 in /docs
Bumps [@iconify/react](https://github.com/iconify/iconify/tree/HEAD/components/react) from 6.0.1 to 6.0.2.
- [Commits](https://github.com/iconify/iconify/commits/HEAD/components/react)

---
updated-dependencies:
- dependency-name: "@iconify/react"
  dependency-version: 6.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-28 12:36:50 +00:00
Amith Koujalgi
0b271383fd
Merge pull request #192 from ollama4j/snyk-upgrade-a5c4786f199d07c639f3f45c8622620f
[Snyk] Upgrade org.projectlombok:lombok from 1.18.38 to 1.18.40
2025-09-28 18:06:28 +05:30
Amith Koujalgi
11e77a9151
Merge pull request #193 from ollama4j/snyk-fix-af47e785104167f9b9eb8c2947b32c00
[Snyk] Fix for 3 vulnerabilities
2025-09-28 18:05:43 +05:30
snyk-bot
143f7f47a2
fix: docs/package.json & docs/package-lock.json to reduce vulnerabilities
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-WEBPACKDEVSERVER-10300775
- https://snyk.io/vuln/SNYK-JS-INFLIGHT-6095116
- https://snyk.io/vuln/SNYK-JS-WEBPACKDEVSERVER-10300777
2025-09-28 08:48:44 +00:00
snyk-bot
3ea9d5021e
fix: upgrade org.projectlombok:lombok from 1.18.38 to 1.18.40
Snyk has created this PR to upgrade org.projectlombok:lombok from 1.18.38 to 1.18.40.

See this package in maven:
org.projectlombok:lombok

See this project in Snyk:
https://app.snyk.io/org/koujalgi.amith/project/e4176cf5-c6db-4650-af21-3778aa308d33?utm_source=github&utm_medium=referral&page=upgrade-pr
2025-09-27 07:51:05 +00:00
amithkoujalgi
031076b498
Update readme 2025-09-26 23:35:46 +05:30
amithkoujalgi
305bab9819
Refactor OllamaAPI and related classes for improved embedding model support and tool registration
This update modifies the OllamaAPI class to enhance support for embedding models by renaming related classes and introducing new request and response models. The OllamaEmbedRequestModel and OllamaEmbedResponseModel classes have been added, along with their corresponding builder class. Additionally, the tool registration process has been improved with the introduction of annotations for automatic tool discovery. Deprecated methods and commented-out code have been removed for clarity, and Javadoc comments have been updated for consistency across the API.
2025-09-26 22:13:55 +05:30
amithkoujalgi
f5ca5bdca3
Refactor OllamaAPI and related classes to enhance tool management and request handling
This update modifies the OllamaAPI class and associated request classes to improve the handling of tools. The ToolRegistry now manages a list of Tools.Tool objects instead of ToolSpecification, streamlining tool registration and retrieval. The OllamaGenerateRequest and OllamaChatRequest classes have been updated to reflect this change, ensuring consistency across the API. Additionally, several deprecated methods and commented-out code have been removed for clarity. Integration tests have been adjusted to accommodate these changes, enhancing overall test reliability.
2025-09-26 01:26:22 +05:30
amithkoujalgi
fe82550637
Refactor OllamaAPI and related classes for improved functionality and code clarity
This update removes deprecated methods from the OllamaAPI class, enhancing the overall structure and readability. The OllamaGenerateRequest class has been updated to include a list of tools, and the generate methods have been refactored to streamline request handling. Additionally, the WeatherTool class has been removed, and a new sample tool specification has been added for demonstration purposes. Changes in pom.xml include commented-out dependencies for better clarity.
2025-09-25 18:10:18 +05:30
amithkoujalgi
53e4b413ec
Refactor unloadModel test in OllamaAPIIntegrationTest for improved exception handling
Updated the shouldUnloadModel test to use a constant for the model name and assert that no exceptions are thrown during the unload operation. This change enhances the clarity and reliability of the test by focusing on exception handling rather than checking the model's presence in the process list.
2025-09-24 00:57:05 +05:30
amithkoujalgi
07878ddf36
Refactor OllamaAPI and related classes for improved request handling and builder pattern integration
This update refactors the OllamaAPI class and its associated request builders to enhance the handling of generate requests and chat requests. The OllamaGenerateRequest and OllamaChatRequest classes now utilize builder patterns for better readability and maintainability. Additionally, deprecated methods have been removed or marked, and integration tests have been updated to reflect these changes, ensuring consistent usage of the new request structures.
2025-09-24 00:54:09 +05:30
amithkoujalgi
cc232c1383
Refactor OllamaAPI and endpoint callers for improved error handling and metrics recording
Refactor OllamaAPI and endpoint callers for improved error handling and metrics recording

Enhanced the OllamaAPI class by adding detailed error handling and metrics recording for API calls. Updated the OllamaChatEndpointCaller and OllamaGenerateEndpointCaller to use static endpoint constants instead of method suffixes, improving code clarity. Adjusted Javadoc comments for consistency and readability across the classes.
2025-09-23 19:00:44 +05:30
amithkoujalgi
52c60d9d18
Update OllamaAPI.java
Refactor OllamaAPI documentation for clarity and consistency

Updated Javadoc comments throughout the OllamaAPI class to enhance readability and maintain consistency in formatting. Adjusted line breaks and spacing in comments for improved presentation. No functional changes were made to the code.
2025-09-23 18:33:44 +05:30
amithkoujalgi
d400998fa2
Refactor MetricsRecorder and OllamaAPI for improved label handling and documentation clarity 2025-09-23 18:08:57 +05:30
amithkoujalgi
827bedb696
Add Prometheus metrics integration and refactor API error handling
Introduces Prometheus metrics support with a new MetricsRecorder and documentation (METRICS.md). Refactors OllamaAPI methods to improve error handling, reduce checked exceptions, and record metrics for API calls. Updates dependencies in pom.xml to include Prometheus and Guava. Adds MetricsRecorder class and updates tests for metrics integration.
2025-09-23 16:51:26 +05:30
dependabot[bot]
54c48cb106
Bump org.apache.maven.plugins:maven-gpg-plugin from 1.5 to 3.2.8
Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 1.5 to 3.2.8.
- [Release notes](https://github.com/apache/maven-gpg-plugin/releases)
- [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-1.5...maven-gpg-plugin-3.2.8)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-gpg-plugin
  dependency-version: 3.2.8
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-22 00:47:17 +00:00
dependabot[bot]
944178abce
Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.11.3 to 3.12.0
Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.11.3 to 3.12.0.
- [Release notes](https://github.com/apache/maven-javadoc-plugin/releases)
- [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.11.3...maven-javadoc-plugin-3.12.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-javadoc-plugin
  dependency-version: 3.12.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-22 00:47:02 +00:00
dependabot[bot]
9defbb7991
Bump org.junit.jupiter:junit-jupiter-api from 5.10.0 to 5.13.4
Bumps [org.junit.jupiter:junit-jupiter-api](https://github.com/junit-team/junit-framework) from 5.10.0 to 5.13.4.
- [Release notes](https://github.com/junit-team/junit-framework/releases)
- [Commits](https://github.com/junit-team/junit-framework/compare/r5.10.0...r5.13.4)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-api
  dependency-version: 5.13.4
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-22 00:46:47 +00:00
dependabot[bot]
c857453654
Bump org.apache.maven.plugins:maven-surefire-plugin
Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.0.0-M5 to 3.5.4.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.0.0-M5...surefire-3.5.4)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-surefire-plugin
  dependency-version: 3.5.4
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-22 00:46:43 +00:00
dependabot[bot]
d3495c1def
Bump org.sonatype.plugins:nexus-staging-maven-plugin
Bumps org.sonatype.plugins:nexus-staging-maven-plugin from 1.6.13 to 1.7.0.

---
updated-dependencies:
- dependency-name: org.sonatype.plugins:nexus-staging-maven-plugin
  dependency-version: 1.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-22 00:44:54 +00:00
amithkoujalgi
a9f6d4671c
Set keepAlive to 0m in OllamaAPI requests
Added keepAlive parameter with value '0m' to OllamaAPI requests for improved connection handling. Updated integration test to enable tool usage and commented out a test for raw mode and thinking with new model handling.
2025-09-20 23:12:35 +05:30
Amith Koujalgi
5ef1ea906d Remove modelKeepAliveTime property and related code
Eliminated the modelKeepAliveTime field from OllamaAPI and OllamaChatRequest, along with its usage in integration tests and configuration. This streamlines configuration and request handling by removing an unused or deprecated parameter.
2025-09-20 17:48:21 +05:30
Amith Koujalgi
d6f5b5c313 Update workflow and improve test logging
Added environment configuration for GitHub Pages deployment in the build workflow and removed unused environment variable from test workflow. Enhanced logging in OllamaAPIIntegrationTest to include the external host address.
2025-09-20 15:51:31 +05:30
Amith Koujalgi
f0c6ce2b8d Set USE_EXTERNAL_OLLAMA_HOST env in test workflow
Adds USE_EXTERNAL_OLLAMA_HOST environment variable set to 'false' for the run-tests job in the build-on-pull-request workflow. This ensures tests do not use an external Ollama host during pull request builds.
2025-09-20 15:44:47 +05:30
amithkoujalgi
f60491885f
Remove commented pre-commit command from Makefile
Deleted an unused, commented-out pre-commit command from the apply-formatting target to clean up the Makefile.
2025-09-20 15:40:18 +05:30
amithkoujalgi
7a2a307a0a
Add local format-code hook to pre-commit config
Introduces a new local hook 'format-code' that runs 'make apply-formatting' to ensure code formatting is applied automatically during pre-commit. The hook is set to always run.
2025-09-20 15:40:02 +05:30
Amith Koujalgi
f6d52114b8
Merge pull request #184 from ollama4j/snyk-upgrade-af836a84c3838d755d6d2452ec92d418
Some checks failed
CodeQL / Analyze (java) (push) Failing after 11s
CodeQL / Analyze (javascript) (push) Failing after 10s
Mark stale issues / stale (push) Failing after 20s
Mark stale issues and PRs / stale (push) Failing after 1m31s
[Snyk] Upgrade org.jsoup:jsoup from 1.18.1 to 1.21.2
2025-09-20 14:47:46 +05:30
amithkoujalgi
cac94e0faf
Refactor tool handling and add model unload support
Replaces the 'clientHandlesTools' flag with 'useTools' for tool execution control, defaulting to true. Adds support for model unloading via keep_alive parameter. Updates chat request and builder to use the new flag. Improves integration tests and documentation to reflect these changes. Fixes constructor order in OllamaGenerateStreamObserver and adds ignoreUnknown to ModelsProcessResponse.
2025-09-20 14:46:46 +05:30
snyk-bot
e4c14863fb
fix: upgrade org.jsoup:jsoup from 1.18.1 to 1.21.2
Snyk has created this PR to upgrade org.jsoup:jsoup from 1.18.1 to 1.21.2.

See this package in maven:
org.jsoup:jsoup

See this project in Snyk:
https://app.snyk.io/org/koujalgi.amith/project/e4176cf5-c6db-4650-af21-3778aa308d33?utm_source=github&utm_medium=referral&page=upgrade-pr
2025-09-20 08:11:20 +00:00
amithkoujalgi
6147c7d697
Add Javadoc comments to integration tests
Added detailed Javadoc comments to test methods and utility functions in OllamaAPIIntegrationTest.java to improve documentation and clarify test scenarios, usage, and expected outcomes. No functional changes were made.
2025-09-20 00:54:54 +05:30