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

Add image generation support with Azure OpenAI #359

Merged
merged 37 commits into from Dec 19, 2023

Conversation

jdubois
Copy link
Contributor

@jdubois jdubois commented Dec 15, 2023

This uses the same LangChain classes as #298 by @Heezer

  • langchain4j-core/src/main/java/dev/langchain4j/data/image/Image.java
  • langchain4j-core/src/main/java/dev/langchain4j/model/image/ImageModel.java

I copy/pasted those 2 files here as #298 isn't merged yet, and my goal is that we use the same API in the end.

@Heezer Heezer self-requested a review December 16, 2023 08:48
@Heezer
Copy link
Collaborator

Heezer commented Dec 16, 2023

Thanks! There are some refactorings of #298 on the way, the PR is close to be approved. I'll keep you posted!

@jdubois
Copy link
Contributor Author

jdubois commented Dec 16, 2023

Awesome! I got access to Dall-e 3 this morning, so I'll do integration tests.

@jdubois
Copy link
Contributor Author

jdubois commented Dec 16, 2023

And integration tests are passing!

Here's the first ever image created with the integration test AzureOpenAiImageModelIT and it's beautiful:

generated_00

@jdubois jdubois marked this pull request as ready for review December 16, 2023 14:53
Copy link
Collaborator

@Heezer Heezer left a comment

Choose a reason for hiding this comment

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

Thanks a lot! See my comments.

@jdubois
Copy link
Contributor Author

jdubois commented Dec 18, 2023

Thanks @Heezer !! This is fixing my 2 biggest issues with this API (not limiting to just 1 image, and being able to get the image content and not just the URL)

@jdubois jdubois requested a review from Heezer December 18, 2023 13:02
Copy link
Owner

@langchain4j langchain4j left a comment

Choose a reason for hiding this comment

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

@jdubois great job, thanks you! Just a few minor things, please check comments

@Heezer Heezer mentioned this pull request Dec 18, 2023
@langchain4j
Copy link
Owner

@jdubois looks good! There is now a conflict due to changes by @Heezer merged to main. Once this is fixed, we can merge 🚀

Copy link
Contributor Author

@jdubois jdubois left a comment

Choose a reason for hiding this comment

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

All comments from the review should be OK

@jdubois jdubois requested a review from Heezer December 19, 2023 14:12
langchain4j
langchain4j previously approved these changes Dec 19, 2023
Copy link
Owner

@langchain4j langchain4j left a comment

Choose a reason for hiding this comment

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

@jdubois just need to remove unused AzureAiMessage and we're good

Copy link
Owner

@langchain4j langchain4j left a comment

Choose a reason for hiding this comment

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

@jdubois thank you, great job!

@jdubois
Copy link
Contributor Author

jdubois commented Dec 19, 2023

Awesome!! Thanks @langchain4j @Heezer

@langchain4j langchain4j merged commit 76b6f29 into langchain4j:main Dec 19, 2023
6 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.

None yet

4 participants