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

Support Images generation through OPEN AI API #61

Merged
merged 5 commits into from
May 16, 2023
Merged

Support Images generation through OPEN AI API #61

merged 5 commits into from
May 16, 2023

Conversation

raulraja
Copy link
Contributor

Image Generation - A new ImageGenerationAgent class has been added to the com.xebia.functional.agents package. This agent is responsible for generating images based on a given prompt. It interacts with the OpenAIClient to create image generation requests and handles the responses. The ImageGenerationAgent is integrated into the AIScope class, providing methods to generate images with or without variables and serialize the response to a specified format.

Input Checking - The method checkInput has been moved from the LLMAgent class to a standalone function. This change improves code reusability as the input-checking logic can now be used by other agents as well.

Update to OpenAIClient - The OpenAIClient interface and its implementation KtorOpenAIClient have been updated to include a method for creating image generation requests. The ImagesGenerationRequest and ImagesGenerationResponse data classes have been added to handle these requests and responses.

Test Updates - The testLLM object in ChainTestUtils.kt has been updated to include a mock implementation of the new createImages method. Not sure if there is a useful test to add, given we are calling Open AI.

Example Update - The example in Population.kt has been updated to demonstrate the new image generation feature.

Copy link
Contributor

@juanpedromoreno juanpedromoreno left a comment

Choose a reason for hiding this comment

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

Added minor nit comments. Other than that, LGTM!

Copy link
Contributor

@franciscodr franciscodr left a comment

Choose a reason for hiding this comment

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

Thanks, @raulraja

@realdavidvega realdavidvega merged commit f4330c2 into main May 16, 2023
1 check passed
@realdavidvega realdavidvega deleted the image branch May 16, 2023 09:24
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