844 Commits

Author SHA1 Message Date
amithkoujalgi
5f5fa8ecae
Deprecate findModelTagFromLibrary and simplify WeatherTool
Marked findModelTagFromLibrary as deprecated in OllamaAPI due to reliance on unstable HTML structure. Simplified WeatherTool by removing external API calls and returning a static weather response for demonstration purposes.
2025-08-31 01:33:57 +05:30
amithkoujalgi
6ae6f4f25b
Update run-tests.yml 2025-08-30 21:31:54 +05:30
amithkoujalgi
6b69284497
Update workflow job names and refine integration tests
Added descriptive names to jobs in the GitHub Actions workflow for better clarity. In integration tests, replaced GENERAL_PURPOSE_MODEL with TOOLS_MODEL in relevant tests and adjusted logging within lambda expressions for improved output handling.
2025-08-30 21:30:16 +05:30
amithkoujalgi
52d7dbd7ce
Update build-on-pull-request.yml 2025-08-30 21:10:54 +05:30
amithkoujalgi
2070753c5e
Update run-tests.yml 2025-08-30 21:05:30 +05:30
Amith Koujalgi
c1f7fb78d9
Merge branch 'main' into thinking-support 2025-08-30 21:01:50 +05:30
amithkoujalgi
b71cf87ec2
Update build-on-pull-request.yml 2025-08-30 21:00:37 +05:30
amithkoujalgi
0965c3046e
Update build-on-pull-request.yml 2025-08-30 20:57:17 +05:30
amithkoujalgi
8e50bc8d75
Update OllamaAPIIntegrationTest.java 2025-08-30 20:54:18 +05:30
amithkoujalgi
be5b77c4ac
Refactor tool tests and improve tool argument handling
Refactored integration tests to use a reusable employeeFinderTool method and improved assertions for tool call results. Updated tool argument formatting in OllamaAPI for clearer output. Modified AnnotatedTool to use 'numberOfHearts' instead of 'amountOfHearts' and simplified the sayHello method signature and output. Removed redundant and duplicate test code for tool streaming.
2025-08-30 20:53:14 +05:30
amithkoujalgi
6078db6157
Update GitHub Actions workflows for PRs and tests
Enables all pull request event types in build-on-pull-request.yml and cleans up formatting. Removes redundant step for copying workflow file in run-tests.yml to streamline the workflow.
2025-08-30 20:04:42 +05:30
amithkoujalgi
97f457575d
Remove sample prompt utilities and update integration tests
Deleted SamplePrompts.java and sample-db-prompt-template.txt as they are no longer needed. Updated OllamaAPIIntegrationTest to use a new TOOLS_MODEL constant, refactored tool registration and prompt descriptions for employee details, and improved test assertions for tool-based chat interactions.
2025-08-30 20:01:35 +05:30
amithkoujalgi
4df59d8862
Refactor test steps to use run-tests workflow
Replaces separate Maven unit and integration test steps with a call to the reusable run-tests.yml workflow, passing the current branch as input. This simplifies the workflow and centralizes test execution logic.
2025-08-30 18:13:58 +05:30
amithkoujalgi
621004e6d8
Fix logging for model pull retry 2025-08-30 18:10:33 +05:30
Amith Koujalgi
74b2ab13e7
Merge pull request #146 from ollama4j/amithkoujalgi-patch-1
All checks were successful
Mark stale issues / stale (push) Successful in 34s
Update run-tests.yml
2025-08-30 18:09:47 +05:30
Amith Koujalgi
8fef5148d9
Update run-tests.yml 2025-08-30 18:09:35 +05:30
amithkoujalgi
b91f6e6b25
Enhance GitHub Actions workflow for dynamic branch testing
- Added a step to check out the target branch specified in the workflow input.
- Implemented a conditional step to use the workflow file from the checked-out branch, improving flexibility and error handling in CI processes.
2025-08-30 18:06:06 +05:30
amithkoujalgi
0ec20d14b0
Enhance CI workflow and refactor integration tests
- Added setup step for Ollama installation in the GitHub Actions workflow.
- Updated environment variables for integration tests to utilize an external Ollama host.
- Refactored test method names in OllamaAPIIntegrationTest for clarity and consistency, changing 'testAskModel' to 'testGenerate'.
- Introduced new tests for image processing from URLs and files, while removing outdated tests for improved test suite relevance.
2025-08-30 18:00:04 +05:30
amithkoujalgi
c705432510
Increase model pull retry delay and attempts
Raised the base delay for model pull retries from 1s to 3s and updated log output to show seconds instead of milliseconds. Also increased the number of retries for model pull in integration tests from 3 to 5 to improve robustness.
2025-08-30 17:04:02 +05:30
amithkoujalgi
de379d73b2
Refactor OllamaAPI for readability and add EqualsAndHashCode to BearerAuth
Reformatted method signatures, chained calls, and comments in OllamaAPI for improved readability and maintainability. Added @EqualsAndHashCode(callSuper = false) to BearerAuth to ensure proper equality checks, and reformatted its code for consistency.
2025-08-30 16:59:05 +05:30
amithkoujalgi
ad1bf658a9
Enhance OllamaAPI with improved timeout and retry mechanisms
- Updated request timeout default to 10 seconds for API calls.
- Added verbose logging option with default set to true.
- Introduced maxChatToolCallRetries to control retry attempts during chat interactions.
- Implemented numberOfRetriesForModelPull with exponential backoff for model retrieval failures.
- Refactored pullModel method to include retry logic and improved error handling.
2025-08-30 16:49:43 +05:30
amithkoujalgi
ab9b95dbed
Update THINKING_TOOL_MODEL constant in OllamaAPIIntegrationTest to gpt-oss:20b 2025-08-30 15:50:08 +05:30
amithkoujalgi
7f37233c72
Update THINKING_TOOL_MODEL constant in OllamaAPIIntegrationTest to version 1.7b 2025-08-30 15:45:08 +05:30
amithkoujalgi
77aa3b85d1
Refactor WithAuth integration test for improved structure and functionality
- Restored the WithAuth class and updated it to include a new general-purpose model.
- Enhanced the setup method to initialize the OllamaAPI with bearer authentication.
- Added tests to validate the API's behavior with correct and incorrect authentication tokens.
- Updated the structured output test to reflect changes in the model and prompt.
- Improved logging for better traceability during test execution.
2025-08-30 15:07:32 +05:30
amithkoujalgi
863c978d12
Refactor OllamaAPIIntegrationTest and AnnotatedTool for improved clarity and consistency
- Updated model constants in OllamaAPIIntegrationTest to enhance readability and maintainability.
- Changed method visibility from public to package-private where appropriate.
- Refactored assertions in testListModelsAPI for better validation.
- Cleaned up formatting in AnnotatedTool methods for consistency.
- Added a new image resource (roses.jpg) for testing purposes.
2025-08-30 15:02:51 +05:30
amithkoujalgi
cc950b893e
Refactor OllamaAPI to use Constants for HTTP headers and improve logging format
- Introduced a new Constants class to centralize HTTP header values.
- Updated OllamaAPI methods to utilize Constants for "Content-Type" and "Accept" headers.
- Enhanced logging statements to use parameterized messages for better performance and readability.
- Added a test for the ping method in OllamaAPIIntegrationTest to ensure connectivity.
2025-08-30 13:01:01 +05:30
amithkoujalgi
f085b633af
Update OllamaAPIIntegrationTest.java 2025-08-30 12:14:09 +05:30
amithkoujalgi
3d0b3eeb7f
Add tool deregistration and update integration tests
Introduces a method to deregister all tools in OllamaAPI and ToolRegistry. Updates integration tests to use new models, refactors prompts and assertions, and removes the TimeOfDay class. The WithAuth test is now fully commented out.
2025-08-30 12:01:32 +05:30
Amith Koujalgi
4a69df4476 remove unused model pull in testListModelsAPI 2025-08-29 17:08:48 +05:30
Amith Koujalgi
639249d346 Update Lombok version and adjust project build output timestamp formatting 2025-08-29 17:00:49 +05:30
amithkoujalgi
8d9ee006ee
Refactor OllamaAPI and chat models to support 'thinking' responses
- Introduced a 'thinking' field in OllamaChatMessage to capture intermediate reasoning.
- Updated OllamaChatRequest to include a 'think' parameter for chat requests.
- Modified OllamaChatRequestBuilder to facilitate setting the 'think' parameter.
- Enhanced response handling in OllamaChatStreamObserver and OllamaGenerateStreamObserver to manage 'thinking' content.
- Updated integration tests to validate the new 'thinking' functionality in chat and generation methods.
2025-08-28 12:44:43 +05:30
amithkoujalgi
14642e9856
Enhance OllamaAPI with 'think' parameter and response handling
- Added 'think' parameter to the generate methods in OllamaAPI to enable step-by-step reasoning for model responses.
- Updated OllamaGenerateRequest and OllamaGenerateResponseModel to include 'thinking' field.
- Modified response handling in OllamaGenerateStreamObserver to incorporate 'thinking' responses.
- Updated integration tests to validate the new functionality, including tests for generating responses with thinking enabled.
- Refactored related methods and classes for consistency and clarity.
2025-08-28 10:03:07 +05:30
Amith Koujalgi
3efd7712be
Merge pull request #143 from ollama4j/small-fixes
All checks were successful
Mark stale issues / stale (push) Successful in 33s
Small fixes
2025-08-27 21:18:15 +05:30
Amith Koujalgi
d2417b0082
Merge pull request #144 from trly/fix/update-pullmodel-to-handle-errors
fix: handle ollama error responses
2025-08-27 21:18:03 +05:30
Travis Lyons
bae903f8ca
fix: handle ollama error responses
fixes: #138

- Added error field to ModelPullResponse
  - Enhanced error handling in doPullModel to check for errors in response body and throw OllamaBaseException with the specific error message
2025-08-20 11:51:49 -04:00
Amith Koujalgi
1e17e258b6
Merge pull request #141 from p00temkin/thinking
All checks were successful
Mark stale issues / stale (push) Successful in 29s
Ignore thinking key to allow gpt-oss replies to be processed
2025-08-16 09:34:20 +05:30
amithkoujalgi
cc13a580fa
Update WithAuth.java 2025-08-16 09:27:40 +05:30
amithkoujalgi
54d8cf4cd9
Add WeatherTool and integration test with auth proxy
Introduces WeatherTool for fetching weather data via OpenWeatherMap API and its tool specification. Adds an integration test (WithAuth) using Testcontainers to verify OllamaAPI connectivity through an NGINX proxy with bearer token authentication. Also updates pom.xml to include the testcontainers-nginx dependency and minor improvements to OllamaAPI for request headers and Javadoc formatting. TypewriterTextarea now supports text alignment, with homepage header using center alignment.
2025-08-15 23:16:24 +05:30
p00temkin
03da285d1c
Ignore thinking key to allow gpt-oss replies to be processed 2025-08-12 14:52:31 +02:00
Amith Koujalgi
339f788832
Merge pull request #133 from ollama4j/docs-updates
All checks were successful
Mark stale issues / stale (push) Successful in 42s
Update index.js
2025-04-20 00:33:32 +05:30
amithkoujalgi
ccf738127d
Update index.js 2025-04-20 00:33:00 +05:30
Amith Koujalgi
b90c7a027a
Merge pull request #132 from ollama4j/docs-updates
Updated docs
2025-04-20 00:11:12 +05:30
amithkoujalgi
2b0506a393
Updated docs 2025-04-20 00:10:37 +05:30
Amith Koujalgi
81278be964
Merge pull request #131 from ollama4j/docs-updates
Updated docs
2025-04-19 23:36:47 +05:30
amithkoujalgi
cef4a00d17
Updated docs 2025-04-19 23:36:03 +05:30
Amith Koujalgi
9083c3ace3
Merge pull request #130 from ollama4j/docs-updates
Updated docs
2025-04-19 23:25:06 +05:30
amithkoujalgi
79923451d0
Updated docs 2025-04-19 23:24:44 +05:30
Amith Koujalgi
02168e6fd9
Merge pull request #129 from ollama4j/docs-updates
Updated docs
2025-04-19 23:16:09 +05:30
amithkoujalgi
a3debc0983
Updated docs 2025-04-19 23:15:27 +05:30
Amith Koujalgi
9a0908f504
Merge pull request #128 from ollama4j/docs-updates
Updated docs
2025-04-19 22:14:09 +05:30