Skip to content

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