Skip to content

Conversation

amithkoujalgi
Copy link
Collaborator

  • To address Structured output #86, introduced generate() method that takes a structured output definition as a Map and returns OllamaStructuredResult from the Ollama API.
  • Updated integration tests to include a new test for structured output from the API.

- Improved formatting and readability of comments in OllamaAPI.java.
- Introduced OllamaStructuredResult class to handle structured responses from the Ollama API.
- Updated integration tests to include a new test for structured output from the API.
- Cleaned up imports and ensured consistent code style across the OllamaAPIIntegrationTest class.
@amithkoujalgi amithkoujalgi mentioned this pull request Mar 23, 2025
amithkoujalgi and others added 10 commits March 24, 2025 15:30
- Updated OllamaAPI to return an instance of OllamaResult instead of OllamaStructuredResult for structured responses.
- Removed the obsolete OllamaStructuredResult class.
- Added new methods in OllamaResult for retrieving structured responses as a Map or mapped to a specific class type.
- Updated integration tests to validate the new structured response functionality.
- Improved Makefile with a new full-build target for building the project.
- Added a note in the README.md to guide Windows users on installing Chocolatey Package Manager and using it to install `make`.
- Suggested running the installation command with administrator privileges for better success.
- Updated the Makefile to include a new target for local integration tests with external Ollama host configuration.
- Modified the OllamaAPIIntegrationTest to dynamically set the Ollama host based on environment variables, allowing for both external and Testcontainers usage.
- Refactored model pulling logic in tests to use constants for model names, improving readability and maintainability.
Signed-off-by: Amith Koujalgi <koujalgi.amith@gmail.com>
…uctured responses

- Added a retry mechanism in OllamaAPI for model pulling, allowing configurable retries.
- Introduced new methods in OllamaResult for structured response handling, including parsing JSON responses into a Map or specific class types.
- Updated integration tests to validate the new functionality and ensure robust testing of model interactions.
- Improved code formatting and consistency across the OllamaAPI and integration test classes.
Added support for structured output
@amithkoujalgi amithkoujalgi merged commit a895e3a into main Mar 25, 2025
1 check passed
@amithkoujalgi amithkoujalgi deleted the structured-output branch March 25, 2025 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant