Skip to content

Implement embedding generation contracts and client APIs #242

@chubes4

Description

@chubes4

Problem

The AI Client has an embedding generation capability enum, but it does not currently expose usable embedding generation model contracts, result DTOs, or builder methods. WordPress AI applications need provider-agnostic embeddings for semantic search, recommendations, clustering, and knowledge-base retrieval.

Proposed shape

Add first-class embedding generation support to the AI Client.

Suggested additions:

  • EmbeddingGenerationModelInterface
  • embedding result DTO containing vectors, dimensions, model metadata, and token usage
  • PromptBuilder methods for generateEmbedding() and generateEmbeddings()
  • model requirements support for CapabilityEnum::embeddingGeneration()
  • supported options such as dimensions or encoding format where providers support them

Acceptance criteria

  • Consumers can request embeddings through the same provider-agnostic client pattern used for text/image generation.
  • Embedding-capable models can be discovered and selected by capability.
  • Result objects expose vectors and usage metadata.
  • Mock provider tests cover single and batch embedding generation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions