﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc	focuses
65638	AI: Add embedding generation support to WordPress	extrachill		"PHP AI Client 1.4.0 introduces provider-agnostic embedding generation APIs, including a dedicated `EmbeddingBuilder`, embedding result DTOs, lifecycle events, and shared model resolution.

WordPress Core currently bundles PHP AI Client but does not expose embedding generation through its WordPress-facing AI API. Core should update the bundled library to 1.4.0 and add a native wrapper so plugins can use embedding-capable providers without coupling to a specific vendor SDK.

Embedding generation is a foundational primitive for semantic search, retrieval-augmented generation, recommendations, clustering, and knowledge bases built on WordPress. Vector storage, indexing, and retrieval remain separate concerns and are outside this ticket's scope.

Target: WordPress 7.1.

== Proposed changes ==

* Update the bundled PHP AI Client library to 1.4.0.
* Introduce `WP_AI_Client_Embedding_Builder`, following the established `WP_AI_Client_Prompt_Builder` conventions.
* Expose a variadic `wp_ai_client_embedding()` entry point.
* Convert SDK exceptions into `WP_Error` values while preserving the fluent interface.
* Respect `wp_supports_ai()`, the existing default request-timeout filter, and an embedding-specific prevention filter.

Example:

{{{#!php
$embeddings = wp_ai_client_embedding( 'first input', 'second input' )
	->generate_embeddings();
}}}

== Related ==

* PHP AI Client implementation: https://github.com/WordPress/php-ai-client/pull/244
* PHP AI Client 1.4.0 release: https://github.com/WordPress/php-ai-client/releases/tag/1.4.0
* WordPress Core implementation: https://github.com/WordPress/wordpress-develop/pull/12530"	enhancement	new	normal	7.2	AI		normal		has-patch needs-testing has-unit-tests		
