961 Commits

Author SHA1 Message Date
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
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
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
amithkoujalgi
751b11881f
Update thinking tool model in integration tests
Replaced the 'deepseek-r1:1.5b' model with 'qwen3:0.6b' for thinking tool tests in OllamaAPIIntegrationTest. Also made minor formatting improvements to comments and string concatenations for better readability.
2025-09-20 00:02:52 +05:30
amithkoujalgi
5da9bc8626
Refactor test method names for clarity
Renamed test methods in OllamaAPIIntegrationTest to use descriptive 'should...' naming conventions, improving readability and clarity of test intent. Removed redundant comments and streamlined assertions for conciseness.
2025-09-19 23:51:32 +05:30
amithkoujalgi
90613c0ec1
Update WithAuth.java 2025-09-19 19:07:42 +05:30
amithkoujalgi
cb0f71ba63
Refactor token handler interfaces and improve streaming
Renamed and refactored token handler interfaces for chat and generate modules to improve clarity and separation. Updated related classes and method signatures to use new handler types. Enhanced error handling and logging in chat and generate request builders. Updated tests and integration code to use new handler classes and configuration properties. Suppressed verbose logs from Docker and Testcontainers in test logging configuration.
2025-09-19 18:05:38 +05:30
amithkoujalgi
d118958ac1
Change logging level from info to debug
Updated OllamaAPI to use LOG.debug instead of LOG.info for model pull status messages. Also changed the root logging level in logback.xml from info to debug to allow debug messages to be displayed during tests.
2025-09-18 02:20:07 +05:30
amithkoujalgi
8df36a9b98
Update GitHub workflows to use JDK 21 (Oracle)
All workflows now use JDK 21 with the Oracle distribution instead of JDK 17 or 11 with Temurin. This ensures consistency and leverages the latest Java features and security updates.
2025-09-18 02:00:55 +05:30
amithkoujalgi
5b71c8eacf
Update OllamaEmbedRequestModel.java 2025-09-18 01:53:28 +05:30
amithkoujalgi
0aeabcc963
Refactor error handling and update tests
Refactored error handling in OllamaChatEndpointCaller by extracting status code checks into a helper method. Improved logging for image loading errors in OllamaChatRequestBuilder. Updated integration and unit tests to relax assertions and clarify comments. Minor documentation formatting fixes and Makefile improvement for reproducible npm installs.
2025-09-18 01:50:23 +05:30
amithkoujalgi
7788f954d6
Improve error handling and code clarity across modules
Enhanced error handling for image URL loading in OllamaChatRequestBuilder, ensuring exceptions are thrown and logged appropriately. Updated test cases to reflect new exception behavior. Improved documentation and code clarity in WeatherTool and test classes. Refactored JSON parsing in response models for conciseness. Minor cleanup in pom.xml and integration test comments for better maintainability.
2025-09-18 01:22:12 +05:30
amithkoujalgi
fe87c4ccc8
Update CI workflows to use JDK 21 with Oracle distribution
Changed Java version from 11 to 21 and switched distribution from 'adopt-hotspot' to 'oracle' in build and documentation publishing workflows for improved compatibility and support.
2025-09-17 21:45:27 +05:30
amithkoujalgi
4f02b299c3
Handle all exceptions when loading image URLs in chat builder
Replaced separate IOException and InterruptedException handling with a single catch for Exception in OllamaChatRequestBuilder, ensuring that any failure when loading image URLs is logged and does not break message building. Updated related unit test to verify builder robustness and usability after invalid image URL input.
2025-09-17 21:41:12 +05:30
amithkoujalgi
274da54d50
Skip unreliable tool call assertions in integration tests
Commented out tool call assertions in OllamaAPIIntegrationTest due to inconsistent model behavior, making the scenario difficult to reproduce reliably. Updated WithAuth test to check for non-null 'isNoon' instead of strict equality.
2025-09-17 21:23:50 +05:30
amithkoujalgi
ca400cfbba
Merge branch 'main' into refactor 2025-09-17 21:11:23 +05:30
amithkoujalgi
e437ba8128
Update OllamaAPIIntegrationTest.java 2025-09-17 21:10:48 +05:30
Amith Koujalgi
5e9f515c66
Merge pull request #182 from ollama4j/dependabot/maven/org.apache.maven.plugins-maven-failsafe-plugin-3.5.4
Some checks failed
CodeQL / Analyze (javascript) (push) Failing after 10s
CodeQL / Analyze (java) (push) Failing after 14s
Mark stale issues / stale (push) Failing after 19s
Mark stale issues and PRs / stale (push) Failing after 1m31s
Bump org.apache.maven.plugins:maven-failsafe-plugin from 3.5.3 to 3.5.4
2025-09-17 21:10:17 +05:30
Amith Koujalgi
5bfdfa2aa1
Merge pull request #181 from ollama4j/dependabot/maven/com.fasterxml.jackson.datatype-jackson-datatype-jsr310-2.20.0
Bump com.fasterxml.jackson.datatype:jackson-datatype-jsr310 from 2.17.1 to 2.20.0
2025-09-17 21:09:57 +05:30
Amith Koujalgi
14666357bd
Merge pull request #180 from ollama4j/dependabot/maven/com.fasterxml.jackson.core-jackson-databind-2.20.0
Bump com.fasterxml.jackson.core:jackson-databind from 2.17.1 to 2.20.0
2025-09-17 21:09:38 +05:30
Amith Koujalgi
b53a391492
Merge pull request #179 from ollama4j/dependabot/maven/org.apache.maven.plugins-maven-javadoc-plugin-3.11.3
Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.11.2 to 3.11.3
2025-09-17 21:09:17 +05:30
Amith Koujalgi
dab2111f10
Merge pull request #178 from ollama4j/dependabot/maven/ch.qos.logback-logback-classic-1.5.18
Bump ch.qos.logback:logback-classic from 1.5.6 to 1.5.18
2025-09-17 21:06:09 +05:30
amithkoujalgi
c15048954c
Update OllamaAPIIntegrationTest.java 2025-09-17 20:54:50 +05:30
amithkoujalgi
ba3d8925f2
Refactor integration tests and update Makefile targets
Refactored OllamaAPIIntegrationTest to simplify stream handlers and remove unused StringBuffer variables. Updated Makefile to ensure formatting is applied before running test targets. Adjusted logback.xml pattern to use full logger name for improved logging clarity.
2025-09-17 20:49:53 +05:30
amithkoujalgi
300f1691e7
Remove hardcoded Ollama host in integration test
Eliminated hardcoded values for 'useExternalOllamaHost' and 'ollamaHost' in OllamaAPIIntegrationTest. The test now relies solely on environment variables for configuration.
2025-09-17 20:38:20 +05:30
amithkoujalgi
a1b5756107
Update Ollama host and clean up integration tests
Changed the remote Ollama host IP in Makefile and test setup to 192.168.29.229. Fixed a typo in a test method name and removed unused StringBuffer variables and related assertions from OllamaAPIIntegrationTest.
2025-09-17 20:28:58 +05:30
amithkoujalgi
b1d3ee54a5
Refactor JSON logging and utility methods
Replaced manual pretty-printing of JSON in OllamaAPI with a new Utils.toJSON method for cleaner logging. Added private constructors to utility classes to prevent instantiation. Updated test and sample code for improved clarity and randomness.
2025-09-17 20:05:18 +05:30
amithkoujalgi
4df4ea1930
Remove deprecated embedding and library model classes
Deleted deprecated classes related to embeddings and library models, including OllamaEmbeddingResponseModel, OllamaEmbeddingsRequestBuilder, OllamaEmbeddingsRequestModel, LibraryModel, LibraryModelDetail, LibraryModelTag, and OllamaModelType. Updated OllamaAPI to remove references to these classes and improve documentation, exception handling, and code clarity.
2025-09-17 19:47:07 +05:30
amithkoujalgi
2f83a5c98c
Improve Makefile output and update pre-commit config
Added colored echo statements to Makefile targets for clearer output and improved developer experience. Updated commitizen hook in .pre-commit-config.yaml to v4.9.1 for latest features and fixes.
2025-09-17 11:56:57 +05:30
Amith Koujalgi
cae8b6e1e4 Update Makefile 2025-09-17 11:17:02 +05:30
Amith Koujalgi
da21bdcf85 Update Makefile 2025-09-17 11:14:01 +05:30
Amith Koujalgi
ac92766c6c Add Spotless plugin and update copyright headers
Introduced the Spotless Maven plugin for code formatting in pom.xml. Updated copyright headers to include 'and contributors' and changed the year to 2025 in all main source files. Minor formatting and import order improvements applied throughout the codebase.
2025-09-17 11:10:55 +05:30
Amith Koujalgi
329381b1ee Refactor and reorganize API docs structure
Moved and renamed several API documentation files for better organization, updated sidebar positions, and merged image generation docs. Added logging documentation and updated Makefile commands for docs build and serve. Improved clarity and consistency in API doc titles and structure.
2025-09-17 10:34:50 +05:30
Amith Koujalgi
fc1f842f6b refactor: enhance generateWithTools method in OllamaAPI
- Updated the generateWithTools method to include a streamHandler parameter for improved response handling.
- Enhanced method documentation to clarify functionality, usage, and error handling.
- Improved the prompt augmentation process by detailing tool invocation based on model output.
2025-09-16 11:00:52 +05:30
Amith Koujalgi
70519e3309 Add configurable timeouts for image URL loading
Introduces connect and read timeout settings for loading images from URLs in OllamaAPI and OllamaChatRequestBuilder. Refactors Utils to use HttpClient for image retrieval with timeout support and improves error handling and logging. Updates unit tests to verify builder robustness against malformed URLs.
2025-09-16 10:31:32 +05:30
Amith Koujalgi
656802b343 refactor: clean up and deprecate unused methods in OllamaAPI and related classes
- Removed deprecated methods and unused imports from `OllamaAPI`.
- Updated method signatures to improve clarity and consistency.
- Refactored embedding request handling to utilize `OllamaEmbedRequestModel`.
- Adjusted integration tests to reflect changes in method usage and removed obsolete tests.
- Enhanced code readability by standardizing formatting and comments across various classes.
2025-09-16 00:27:11 +05:30
Amith Koujalgi
44c6236243 refactor: rename generateAsync method to generate and update image handling in OllamaAPI
- Renamed `generateAsync` to `generate` for clarity.
- Consolidated image handling in `generateWithImages` to accept multiple image types (File, byte[], String).
- Updated request format handling in `OllamaCommonRequest` and related classes to use a more flexible format property.
- Adjusted integration and unit tests to reflect changes in method signatures and functionality.
2025-09-15 23:35:53 +05:30
Amith Koujalgi
51501cf5e1
Merge pull request #177 from ollama4j/dependabot/npm_and_yarn/docs/react-19.1.1
Some checks failed
CodeQL / Analyze (java) (push) Failing after 27s
CodeQL / Analyze (javascript) (push) Failing after 26s
Mark stale issues / stale (push) Failing after 17s
Mark stale issues and PRs / stale (push) Failing after 1m32s
Bump react from 18.2.0 to 19.1.1 in /docs
2025-09-15 20:11:50 +05:30
Amith Koujalgi
9dabf678e5
Merge pull request #176 from ollama4j/dependabot/github_actions/actions/stale-10
Bump actions/stale from 8 to 10
2025-09-15 20:11:37 +05:30
Amith Koujalgi
e2231a0dbd
Merge pull request #175 from ollama4j/dependabot/github_actions/actions/checkout-5
Bump actions/checkout from 3 to 5
2025-09-15 20:11:22 +05:30
Amith Koujalgi
f4ce7e2ec6
Merge pull request #174 from twosom/client-handles-tools-support
feat: add client-side tool handling option
2025-09-15 20:10:58 +05:30
twosom
9fd908bb71 docs: add documentation for client-managed tool calls 2025-09-15 22:57:50 +09:00
dependabot[bot]
c3eedb4785
Bump org.apache.maven.plugins:maven-failsafe-plugin from 3.5.3 to 3.5.4
Bumps [org.apache.maven.plugins:maven-failsafe-plugin](https://github.com/apache/maven-surefire) from 3.5.3 to 3.5.4.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.5.3...surefire-3.5.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-15 00:42:17 +00:00
dependabot[bot]
f6f4dfb9f7
Bump com.fasterxml.jackson.datatype:jackson-datatype-jsr310
Bumps com.fasterxml.jackson.datatype:jackson-datatype-jsr310 from 2.17.1 to 2.20.0.

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.datatype:jackson-datatype-jsr310
  dependency-version: 2.20.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-15 00:41:55 +00:00
dependabot[bot]
739f5213a6
Bump com.fasterxml.jackson.core:jackson-databind from 2.17.1 to 2.20.0
Bumps [com.fasterxml.jackson.core:jackson-databind](https://github.com/FasterXML/jackson) from 2.17.1 to 2.20.0.
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  dependency-version: 2.20.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-15 00:41:52 +00:00
dependabot[bot]
79ebce842d
Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.11.2 to 3.11.3
Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.11.2 to 3.11.3.
- [Release notes](https://github.com/apache/maven-javadoc-plugin/releases)
- [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.11.2...maven-javadoc-plugin-3.11.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-15 00:40:42 +00:00
dependabot[bot]
bafd84b0c9
Bump ch.qos.logback:logback-classic from 1.5.6 to 1.5.18
Bumps [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback) from 1.5.6 to 1.5.18.
- [Release notes](https://github.com/qos-ch/logback/releases)
- [Commits](https://github.com/qos-ch/logback/compare/v_1.5.6...v_1.5.18)

---
updated-dependencies:
- dependency-name: ch.qos.logback:logback-classic
  dependency-version: 1.5.18
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-15 00:40:11 +00:00
dependabot[bot]
cad2654fa2
Bump react from 18.2.0 to 19.1.1 in /docs
Bumps [react](https://github.com/facebook/react/tree/HEAD/packages/react) from 18.2.0 to 19.1.1.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v19.1.1/packages/react)

---
updated-dependencies:
- dependency-name: react
  dependency-version: 19.1.1
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-15 00:40:10 +00:00
dependabot[bot]
dcde3d7738
Bump actions/stale from 8 to 10
Bumps [actions/stale](https://github.com/actions/stale) from 8 to 10.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v8...v10)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-version: '10'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-15 00:36:34 +00:00
dependabot[bot]
5c76ab69a5
Bump actions/checkout from 3 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-15 00:35:34 +00:00