Skip to content

Implement embedding generation contracts and client APIs #242

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions