Skip to content

Add Text and Image document support for ollama model provider#13

Merged
SasinduDilshara merged 6 commits intoballerina-platform:mainfrom
SasinduDilshara:integrate-chat-changes
Jul 26, 2025
Merged

Add Text and Image document support for ollama model provider#13
SasinduDilshara merged 6 commits intoballerina-platform:mainfrom
SasinduDilshara:integrate-chat-changes

Conversation

@SasinduDilshara
Copy link
Contributor

Add Text and Image document support for ollama model provider

Related to ballerina-platform/ballerina-library#7868

@codecov
Copy link

codecov bot commented Jul 24, 2025

Codecov Report

❌ Patch coverage is 96.42857% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 50.60%. Comparing base (b90421f) to head (0b524ca).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
ballerina/provider_utils.bal 96.42% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #13      +/-   ##
==========================================
+ Coverage   47.65%   50.60%   +2.94%     
==========================================
  Files           4        4              
  Lines         235      249      +14     
  Branches       65       73       +8     
==========================================
+ Hits          112      126      +14     
  Misses        123      123              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SasinduDilshara SasinduDilshara requested a review from Copilot July 26, 2025 04:36
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds text and image document support for the ollama model provider, extending the existing text-only support to handle image documents as well. The changes enable processing of images either as binary data or URLs within prompts.

Key changes:

  • Enhanced prompt generation to support both text and image documents
  • Added URL validation for image document content
  • Implemented comprehensive test coverage for image document functionality

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
ballerina/provider_utils.bal Core implementation for handling image documents with URL validation and base64 encoding
ballerina/tests/tests.bal New test function covering image document scenarios including invalid URLs
ballerina/tests/test_values.bal Added sample binary data and expected schema constants for image tests
ballerina/tests/test_utils.bal Mock utility functions to support image document testing

@SasinduDilshara SasinduDilshara merged commit e9dcc8e into ballerina-platform:main Jul 26, 2025
4 checks passed
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.

3 participants