- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.