Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Allow passing Image or collections of Image into AI Service method #1028

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mmacphail
Copy link

Issue

#938

Change

Add the ability to pass Image and ImageContent to AIServices.
Please note that I only added unit tests so far, as I'm looking for comments on style before continuing further.

General checklist

  • There are no breaking changes
  • I have added unit and integration tests for my change
  • I have manually run all the unit and integration tests in the module I have added/changed, and they are all green
  • I have manually run all the unit and integration tests in the core and main modules, and they are all green

Checklist for adding new model integration

  • I have added my new module in the BOM

Checklist for adding new embedding store integration

  • I have added a {NameOfIntegration}EmbeddingStoreIT that extends from either EmbeddingStoreIT or EmbeddingStoreWithFilteringIT
  • I have added my new module in the BOM

Checklist for changing existing embedding store integration

  • I have manually verified that the {NameOfIntegration}EmbeddingStore works correctly with the data persisted using the latest released version of LangChain4j

@langchain4j langchain4j added the P3 Medium priority label Apr 29, 2024
@mmacphail mmacphail changed the title Feat: Allow passing Images into AI Service method [FEATURE] Allow passing Image or collections of Image into AI Service method May 3, 2024
@@ -47,6 +53,18 @@ interface AiService {
@UserMessage("What is the {{it}} of {{country}}?")
String chat7(@V("it") String it, @V("country") String country);

@UserMessage("Count the number of cars in this image")
String chat8(@UserMessage ImageContent imageContent);

Choose a reason for hiding this comment

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

Perhaps consider returning int here since the expected output should always be an int.

@geoand
Copy link
Contributor

geoand commented Jun 4, 2024

I believe this is very interesting.

@langchain4j what is your take on this? Do you have something else in mind or is does this match what you were planning to do in the future?

@langchain4j
Copy link
Owner

@geoand seems good, but need to test all the possible combinations before merging: single image, multiple images, image+text, multiple images+text, etc

@mmacphail
Copy link
Author

I can expand the test, I will first work on a list of all needed combination to support.

@geoand
Copy link
Contributor

geoand commented Jun 4, 2024

Makes sense, thanks for the explanation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 Medium priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants