WordPress / WordPress/php-ai-client

Implement proper multimodal output model classes

Open
#160 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

[Type] Enhancement
Dominant language
PHP
Stars
308
Forks
84
Avg merge
7d 21h
Merged PRs (30d)
2

Description

See #159: For now, Google is the only provider with multimodal output models that we have implemented support for (since other multimodal output models are for audio generation, which we generally don't support yet).

In general, we need to figure out the best approach for implementing classes for those models. Technically, they are pretty much using the exact implementation that our current text generation model class implementations rely on. But because they support both text generation and image generation, we need a class that implements both TextGenerationModelInterface and ImageGenerationModelInterface.

Looking at the Google implementation, we could combine both classes GoogleTextGenerationModel and GoogleImageGenerationModel into one, but that IMO would make things very messy and crowded. So my initial suggestion would be to leave those classes as is and instead introduce another class like GoogleTextAndImageGenerationModel, which simply forwards to a new instance of the respective other one, depending on which method is called. This would be almost similar to how currently GoogleImageGenerationModel will instantiate a GoogleTextGenerationModel for Gemini multimodal image output models.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the GoogleTextGenerationModel and GoogleImageGenerationModel implementations, along with TextGenerationModelInterface and ImageGenerationModelInterface. Compare their existing delegation behavior, including the Gemini multimodal image-output path, and use issue #159 for context. Done means a decided and implemented approach for classes supporting both text and image generation.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
ai, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.