Skip to content

Fixes #332: Adds getImageModel method for image generation #422

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

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

Conversation

Ekam219
Copy link

@Ekam219 Ekam219 commented Mar 14, 2025

Summary:

This PR adds the getImageModel method to the Google Gemini TypeScript SDK, enabling the use of image generation models. This allows users to generate images using specified models, providing a smooth integration for image-based generative tasks.

Changes:

  • Added getImageModel method in GoogleGenerativeAI class (src/gen-ai.ts) to initialize image generation models.
  • Implemented ImageModel class (src/models/image-model.ts) to handle image generation requests.
  • Updated generate-image.ts to include functionality for sending image generation requests.
  • Introduced new types for image model parameters (src/types/requests.ts), such as BaseImageParams, ImageModelParams, and GenerateImageRequest.
  • Updated the request logic to accommodate the image generation workflow.

Fixed Issues:

Testing:

  • Verify the integration of getImageModel for generating images with different configurations and model parameters.
  • Test the image generation functionality through SDK methods to ensure valid API requests and responses.

Additional Notes:

  • Added enums for safety filter levels and image prompt language (types/requests.ts).
  • Enhanced error handling for missing model parameters in the getImageModel method.

@Annhiluc Annhiluc added type:feature request New feature request/enhancement status:triaged Issue/PR triaged to the corresponding sub-team p3 labels Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3 status:triaged Issue/PR triaged to the corresponding sub-team type:feature request New feature request/enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Does this library supports image generation?
2 participants