PHP AI Client SDK ๐Ÿ”— **Source:** [PHP AI Client SDK](https://www.youtube.com/watch?v=lNAh5B0xh6I) > [!note]+ Document Notes > tags: [wordpress-ai, php-development, sdk-integration] > author: WordPress AI Team > source: YouTube > reference: https://www.youtube.com/watch?v=lNAh5B0xh6I > date created: 2025-01-17 14:30 > > # ๐Ÿท๏ธ Title: PHP AI Client SDK - Connecting WordPress to External AI Models > <!-- deep-read:sections start --> ## ๐Ÿงฐ Action Inbox - [H1] Set up proper API credentials configuration โ€” troubleshooting authentication #wordpress-ai - [H2] Create working plugin demo with PHP AI Client SDK โ€” development continuation #php-development - [H3] Test model integration with OpenAI and Anthropic โ€” API validation #ai-integration ## ๐Ÿงญ Table of Contents - [๐Ÿ“ Summary](#-summary) - [๐Ÿ“– Main Content](#-main-content) - [๐Ÿ—’๏ธ Notes](#๏ธ-notes) - [๐Ÿ“š References](#-references) - [๐Ÿ—ฃ๏ธ Paraphrase](#๏ธ-paraphrase) - [๐Ÿ“ฐ Newsletter](#-newsletter) - [โœ… Action Items](#-action-items) - [๐Ÿงช Hypotheses](#-hypotheses) - [๐Ÿ“Š Methodology](#-methodology) - [โ“ Questions](#-questions) - [๐Ÿ”ฎ Future Research](#-future-research) - [๐Ÿ’ก Implications](#-implications) - [๐Ÿง  Learning Styles Assessment](#-learning-styles-assessment) - [๐Ÿ“Š Accessibility Assessment](#-accessibility-assessment) - [๐ŸŒ DEIB Assessment](#-deib-assessment) - [โœ… Logical Validity](#-logical-validity) - [๐Ÿ›ก๏ธ DARVO Analysis](#-darvo-analysis) - [๐ŸŽฏ Conclusion](#-conclusion) ### ๐Ÿ”— References - [PHP AI Client SDK Repository](https://github.com/WordPress/php-ai-client) - [WordPress AI Experiments Plugin](https://github.com/WordPress/ai-experiments) ## ๐Ÿ“ Summary - Live coding session exploring the PHP AI Client SDK for WordPress AI integration - Demonstrates provider-agnostic approach to connecting WordPress with external AI models - Shows the relationship between Abilities API, MCP adapter, and PHP AI SDK components - Encounters authentication challenges during plugin development and testing - Sets foundation for future AI-powered WordPress plugin development ## ๐Ÿ“– Main Content The PHP AI Client SDK provides shared infrastructure that allows WordPress plugins and PHP projects to integrate AI capabilities rapidly and flexibly. Similar to projects like the Vercel AI SDK, it offers a unified interface that works across AI providers from simple text generation to complex multimodal operations, streaming responses, and long-running tasks. The SDK addresses both user and developer needs through a provider-agnostic approach. Site administrators choose which provider and model they want to configure, providing API credentials in a single place that work automatically across all compatible plugins. Developers can focus on building AI features rather than AI infrastructure, using centralized plumbing instead of reinventing integration code. The architecture consists of modular components: the core PHP package provides the unified AI interface and is WordPress-agnostic, making it collaborative with the wider PHP community. A complementary WordPress-specific package adds features tied to WordPress, such as shared settings pages for AI API credentials and connection to the Abilities API. ## ๐Ÿ—’๏ธ Notes #### โฑ๏ธ [00:00](https://youtu.be/lNAh5B0xh6I?t=0) โ€” [H1] Introduction to PHP AI Client SDK - Key idea: Exploring project that allows WordPress to connect to external AI models - Evidence: "PHP AI client SDK which basically allows any WordPress project to connect to external models" #### โฑ๏ธ [02:15](https://youtu.be/lNAh5B0xh6I?t=135) โ€” [H2] Architecture diagram explanation - Key idea: Three building blocks - Abilities API, MCP adapter, and PHP AI SDK - Evidence: "The abilities API is the layer that allows WordPress to publish the features it has so external agents can know what our WordPress can do" #### โฑ๏ธ [04:30](https://youtu.be/lNAh5B0xh6I?t=270) โ€” [H1] PHP AI SDK as proxy layer - Key idea: SDK serves as intermediate layer for communicating with external models - Evidence: "This is like a proxy is an intermediate layer that we can use to communicate with the outer space" #### โฑ๏ธ [06:45](https://youtu.be/lNAh5B0xh6I?t=405) โ€” [H2] Provider-agnostic unified interface - Key idea: Works across all AI providers with consistent API - Evidence: "It offers a unified interface that works across all AI providers from simple text generation to complex multimodel operations" #### โฑ๏ธ [08:20](https://youtu.be/lNAh5B0xh6I?t=500) โ€” [H2] Credential management system - Key idea: Users manage provider credentials in one centralized location - Evidence: "Users manage their provider credentials in one place. Those credentials then work automatically across all compatible plugins" #### โฑ๏ธ [12:30](https://youtu.be/lNAh5B0xh6I?t=750) โ€” [H2] Environment variables for API keys - Key idea: Credentials can be defined through environment variables for automatic detection - Evidence: "If I define a specific environment variables then the plugin automatically detects them" #### โฑ๏ธ [15:45](https://youtu.be/lNAh5B0xh6I?t=945) โ€” [H1] User-first provider-agnostic approach - Key idea: Site administrators choose providers while plugins just work - Evidence: "WordPress site administrators choose which provider and/or model they want to configure. Any plugins with AI features just work" #### โฑ๏ธ [18:30](https://youtu.be/lNAh5B0xh6I?t=1110) โ€” [H2] Developer benefits and focus - Key idea: Developers focus on AI features rather than infrastructure plumbing - Evidence: "Developers can focus on building AI features, not AI infrastructure. The SDK gives developers the central infrastructure to get started quickly" #### โฑ๏ธ [22:15](https://youtu.be/lNAh5B0xh6I?t=1335) โ€” [H2] Future browser-based AI anticipation - Key idea: Architecture designed to anticipate client-side AI capabilities - Evidence: "The architecture is designed with latest trends like multimodel first in mind and even anticipates future shifts like client side or browser based AI" #### โฑ๏ธ [25:00](https://youtu.be/lNAh5B0xh6I?t=1500) โ€” [H1] Modular architecture with two packages - Key idea: PHP-agnostic core package plus WordPress-specific additions - Evidence: "The underlying PHP package provides the unified AI interface and it is WordPress agnostic. It is a collaborative for with the wider PHP community" #### โฑ๏ธ [30:45](https://youtu.be/lNAh5B0xh6I?t=1845) โ€” [H2] Plugin development setup - Key idea: Installing SDK as Composer dependency in WordPress plugin - Evidence: "We install this as a dependency and then we just use the namespace so we can make calls to the specific methods" #### โฑ๏ธ [45:30](https://youtu.be/lNAh5B0xh6I?t=2730) โ€” [H2] Testing environment configuration - Key idea: Setting up development environment with symlinks and WP-CLI - Evidence: "I'm going to create a sim link to the project and use WP shell to test the functionality" #### โฑ๏ธ [52:15](https://youtu.be/lNAh5B0xh6I?t=3135) โ€” [H3] Authentication troubleshooting - Key idea: Encountering "no models found" errors despite proper API key setup - Evidence: "No models found that support text generation for this prompt. So the function is working properly but something is going on" #### โฑ๏ธ [58:00](https://youtu.be/lNAh5B0xh6I?t=3480) โ€” [H3] Stream conclusion and next steps - Key idea: Planning continuation in next session to resolve authentication issues - Evidence: "Next week I will do a second part of this because I want to really move forward with this and being able of calling this function successfully" ## ๐Ÿ“š References - [PHP AI Client SDK](https://github.com/WordPress/php-ai-client) - [WordPress AI Experiments Plugin](https://github.com/WordPress/ai-experiments) - [Vercel AI SDK](https://sdk.vercel.ai/) - [WP-CLI](https://wp-cli.org/) ## ๐Ÿ—ฃ๏ธ Paraphrase - The PHP AI Client SDK creates a unified way for WordPress plugins to connect with various AI providers without vendor lock-in, allowing site administrators to configure credentials once and developers to focus on features rather than integration complexity - The architecture includes three main components: an Abilities API for publishing WordPress capabilities, an MCP adapter for external communication, and the PHP AI SDK for outbound model connections - Despite thorough setup and valid API credentials, the demonstration encountered authentication issues that prevented successful model communication, highlighting the need for continued troubleshooting in future sessions ## ๐Ÿ“ฐ Newsletter The WordPress AI ecosystem continues to mature with the PHP AI Client SDK, offering a provider-agnostic approach to AI integration that puts both users and developers first. This unified interface allows site administrators to configure AI credentials once while enabling plugins to work seamlessly across different providers like OpenAI, Google, and Anthropic. The modular architecture anticipates future trends including browser-based AI capabilities, making it a forward-thinking solution for the broader PHP community beyond just WordPress. Developers can leverage this centralized infrastructure to focus on building meaningful AI features rather than reinventing integration plumbing. While still in active development with some authentication challenges to resolve, this SDK represents a significant step toward democratizing AI capabilities across the WordPress ecosystem. Resources: [PHP AI Client SDK](https://github.com/WordPress/php-ai-client), [AI Experiments Plugin](https://github.com/WordPress/ai-experiments), [Developer Docs](https://developer.wordpress.org/) ## โœ… Action Items #### WordPress - Core AI: Resolve authentication flow for PHP AI Client SDK integration - Core Program Team: Document credential management best practices for AI providers - Documentation: Create comprehensive guides for PHP AI Client SDK implementation - Community: Develop training materials for AI-powered plugin development #### DevRel - Developer advocacy: Create tutorials and demos for PHP AI Client SDK usage - Education: Design workshops on provider-agnostic AI integration patterns - Developer experience: Improve SDK documentation and error messaging - Community management: Facilitate discussions on AI integration challenges ## ๐Ÿงช Hypotheses - Provider-agnostic AI SDKs reduce vendor lock-in and improve plugin ecosystem flexibility - Centralized credential management increases security and user experience consistency - Unified interfaces accelerate AI feature development across WordPress plugins - Modular architecture enables easier adaptation to emerging AI technologies ### ๐Ÿ“Š Methodology - Live coding demonstrations to test SDK integration patterns - Comparative analysis with existing AI SDKs from other ecosystems - User experience testing for credential management workflows ### โ“ Questions - How can authentication flows be simplified for developer adoption? - What provider detection mechanisms work best for automatic model selection? - How should the SDK handle rate limiting and error recovery across providers? ### ๐Ÿ”ฎ Future Research - Browser-based AI integration patterns and implementation strategies - Performance benchmarking across different AI providers and model types - Security implications of centralized credential management systems ### ๐Ÿ’ก Implications - Practice: Standardized AI integration patterns across WordPress plugin ecosystem - Policy: Need for clear guidelines on AI provider credential handling - Security: Centralized credential storage requires robust security measures - Education: Developer training needed for provider-agnostic AI development - Funding: Investment in AI infrastructure benefits entire PHP community ### ๐Ÿง  Learning Styles Assessment Reading level estimate: Grade 12-14 (technical documentation) #### ๐Ÿ‘€ Visual learners - Present: Architecture diagrams showing component relationships - Improve: API flow diagrams, credential management workflows #### ๐Ÿ”Š Aural learners - Present: Live coding commentary and explanation - Improve: Audio tutorials for SDK integration steps #### ๐Ÿ—ฃ๏ธ Verbal learners - Present: Clear explanations of technical concepts and provider relationships - Improve: Glossary of AI and SDK terminology #### ๐Ÿงฉ Kinesthetic learners - Present: Hands-on coding demonstration and plugin development - Improve: Step-by-step implementation guides with checkpoints #### ๐Ÿง  Logical learners - Present: Modular architecture explanation and component relationships - Improve: Decision trees for provider selection and error handling #### ๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘ Social learners - Present: Live streaming format with community interaction - Improve: Collaborative debugging sessions and peer review #### ๐Ÿง˜โ€โ™€๏ธ Solitary learners - Present: Individual coding exploration and experimentation - Improve: Self-paced tutorials and reflection exercises #### ๐ŸŒฟ Naturalistic learners - Present: Ecosystem thinking about WordPress AI components - Improve: Environmental impact discussions of AI provider choices ### ๐Ÿ“Š Accessibility Assessment #### Screen reader semantics - Present: Clear heading structure in documentation - Improve: Better alt text for architectural diagrams #### Keyboard navigation - Present: Standard web interface navigation - Improve: Keyboard shortcuts for development workflows #### Contrast and readability - Present: Standard code editor contrast - Improve: High contrast themes for coding demonstrations #### Text resizing and reflow - Present: Responsive documentation layout - Improve: Better mobile experience for code examples #### Media and captions - Present: Live video stream - Improve: Auto-generated captions and transcripts #### Forms and interactions - Present: Basic plugin configuration interface - Improve: Better error messaging and validation feedback ### ๐ŸŒ DEIB Assessment #### Cultural breadth - Present: English-language presentation - Improve: Multi-language documentation and examples #### Inclusive language - Present: Technical terminology without exclusionary language - Improve: Plain language explanations alongside technical terms #### Neurodiversity support - Present: Structured, step-by-step approach - Improve: Multiple learning modalities and pacing options #### Representation - Present: Technical focus without explicit representation - Improve: Diverse use cases and contributor acknowledgment #### Psychological safety - Present: Acknowledgment of challenges and learning from failures - Improve: Explicit encouragement for experimentation and mistakes ### โœ… Logical Validity #### Strong reasoning - Deductive strength: Provider-agnostic architecture reduces vendor lock-in (architectural principles) - Inductive strength: Similar patterns successful in other ecosystems (Vercel AI SDK evidence) - Causal reasoning: Centralized credentials improve user experience (UX principles) - Analogical strength: WordPress ecosystem benefits mirror broader PHP community needs #### Fallacies - Appeal to authority: Referencing Vercel AI SDK success without detailed comparison analysis - Hasty generalization: Assuming authentication issues represent broader SDK problems #### Tone of voice - Overall tone: Exploratory and educational with honest acknowledgment of technical challenges ### ๐Ÿ›ก๏ธ DARVO Analysis - Deny: No denial patterns present - Attack: No attack patterns observed - Reverse victim/offender: No reversal patterns identified - Emotional cues and rhetoric: Collaborative, learning-focused approach with transparency about challenges ## ๐ŸŽฏ Conclusion The PHP AI Client SDK represents a significant advancement in WordPress AI integration, offering a provider-agnostic approach that benefits both developers and users. While technical challenges around authentication remain to be resolved, the modular architecture and unified interface design position it well for the evolving AI landscape. The next development session will focus on resolving credential management issues to demonstrate successful AI model integration. ## ๐Ÿงฑ Refactor Appendix ### ๐Ÿ“š Literature Split Pad Purpose: Stage CEE units that become Literature notes. Split level: H3 ### [H1] PHP AI Client SDK provides unified AI interface > [!quote] [PHP AI Client SDK](https://youtu.be/lNAh5B0xh6I) by [[WordPress AI Team]] via [[YouTube]]. Published 2025-01-17. Accessed 2025-01-17. > "PHP AI client SDK which basically allows any WordPress project to connect to external models." Demonstrates provider-agnostic approach to AI integration in WordPress ecosystem. [view highlight](https://youtu.be/lNAh5B0xh6I?t=0#H1) #wordpress-ai #articleseed ID:rw_php_ai_sdk ### [H2] Centralized credential management reduces complexity > [!quote] [PHP AI Client SDK](https://youtu.be/lNAh5B0xh6I) > "Users manage their provider credentials in one place. Those credentials then work automatically across all compatible plugins." Shows how --- ## Full Transcript [04:36] Okay. Hello. Hi.<br>[04:41] We're live and<br>[04:44] we are going to<br>[04:47] to explore a little bit this project<br>[04:51] called PHP AI client SDK<br>[04:56] which<br>[04:57] basically<br>[05:00] allows any WordPress project to<br>[05:04] to connect to external models.<br>[05:08] So<br>[05:10] yeah, let's talk a little bit about that<br>[05:11] and how it connects with all the<br>[05:18] AI related projects in WordPress such as<br>[05:23] uh<br>[05:28] the abilities API, the MCP adapter, and<br>[05:31] the AI experiments plug-in.<br>[05:35] So I'm going to share this link here.<br>[05:43] Um<br>[05:45] so yeah let's start<br>[05:48] let's start from a diagram that I have<br>[05:51] uh somewhere. So let me<br>[05:55] let me find it.<br>[05:58] Where do I have it?<br>[06:01] See if I can find it<br>[06:05] in my<br>[06:12] Oh, I have done some other<br>[06:17] streams about AI and in one of them I<br>[06:20] created a diagram.<br>[06:24] I think it was this one.<br>[06:28] Maybe this one.<br>[06:32] This is the<br>[06:41] No, this is not the one.<br>[06:49] Sorry.<br>[06:52] No, this is not the<br>[06:55] the one I'm looking for. I think is this<br>[06:57] one scaled.<br>[07:03] Yeah, this isn't the diagram I was<br>[07:06] looking for. So, we have here the<br>[07:09] different building blocks which are the<br>[07:14] abilities API, MCP adapter and PHP AI<br>[07:18] SDK.<br>[07:20] The abilities API is the<br>[07:25] layer that allows purpose to<br>[07:29] publish the features it has so<br>[07:34] external agents can know what<br>[07:38] our WordPress can do.<br>[07:42] This is an API that can be used from<br>[07:45] external agents but also from internal<br>[07:48] plugins and from internal features such<br>[07:51] as the the common for.<br>[07:54] They can be<br>[07:59] published or they can be<br>[08:02] made public via an MCP adapter which<br>[08:08] will<br>[08:11] make that with an MCP agent.<br>[08:15] We can communicate with our WordPress<br>[08:19] and we can<br>[08:21] al some of the tools our WordPress has<br>[08:25] to offer and those tools will be the<br>[08:29] abilities<br>[08:30] um automatically converted into tools by<br>[08:34] the MCB adapter. So this is<br>[08:42] one angle<br>[08:46] from which our WordPress can<br>[08:50] use AI<br>[08:53] or how LLM<br>[08:56] um models can<br>[09:01] LLM are large language models. how LLMs<br>[09:05] can communicate with other workers um<br>[09:09] via MCP and can run tools<br>[09:14] defined as abilities<br>[09:18] but also our workers can communicate<br>[09:22] with external models.<br>[09:24] This is it can<br>[09:28] call models to perform actions.<br>[09:33] For example, we can<br>[09:36] summarize content. We can create images<br>[09:38] from prompts. We can do all of that. We<br>[09:40] can convert our<br>[09:43] WordPress instance into a<br>[09:49] into an AI agent that can do can do<br>[09:53] stuff.<br>[09:55] And in order to do that, we have this<br>[09:58] layer which is the PHP AI SDK which is<br>[10:02] what we are going to explore today. So<br>[10:06] via this layer or this um plug-in<br>[10:12] we this is like a a proxy is an<br>[10:16] intermediate layer that we can use to<br>[10:18] communicate with the<br>[10:21] with the outer space. We can communicate<br>[10:24] with models such as Gemini,<br>[10:31] Sonnet.<br>[10:33] We can<br>[10:36] communicate with different models and we<br>[10:37] can ask them to do things uh through<br>[10:41] this<br>[10:42] uh proxy and this will normalize the<br>[10:46] typical actions.<br>[10:51] So yeah, let's um<br>[10:54] have a look at this uh repository.<br>[11:09] Okay. So first we have this<br>[11:13] presentation like the official<br>[11:15] presentation of the project which was<br>[11:18] done on like last summer July uh<br>[11:25] 2025.<br>[11:33] Okay. So let's uh let's read a little<br>[11:35] bit about this.<br>[11:40] So it says the PHP AI client SDK<br>[11:47] provides shared infrastructure that lets<br>[11:51] WordPress plugins and all the PHP<br>[11:54] projects integrate AI capabilities<br>[11:57] rapidly and flexibly. So what we will do<br>[12:01] today is create a plugin that uses this<br>[12:04] um<br>[12:06] this thing that I think is<br>[12:11] shared in the form of<br>[12:13] a plugin.<br>[12:16] Let me see.<br>[12:22] Is this a plugin?<br>[12:31] No, it's um it's a composer package. So,<br>[12:36] we need to<br>[12:40] we need to<br>[12:44] create a plugin.<br>[12:46] install this package as a dependency.<br>[12:49] It's a composer dependency of our<br>[12:51] plug-in and then we need to call it<br>[12:53] using the name space WordPress AI<br>[12:56] client.<br>[13:01] Um, okay.<br>[13:04] Let's continue<br>[13:07] reading.<br>[13:11] Similar to projects like the Bersel AI<br>[13:14] SDK, it offers a unite interface that<br>[13:18] works across all AI providers<br>[13:23] from simple text generation to complex<br>[13:26] multimodel operations, streaming<br>[13:29] responses, and long running tasks. Okay.<br>[13:33] Developers specify what AI capabilities<br>[13:36] they need and users manage<br>[13:40] their provider credentials in one place.<br>[13:45] Those credentials then work<br>[13:46] automatically across all compatible<br>[13:49] plugins on the site. So one thing we<br>[13:51] will need to do is to<br>[13:55] introduce all credentials and this is<br>[13:58] something that in theory this<br>[14:01] plug-in h manages.<br>[14:05] Let me open another version<br>[14:11] of this. Um,<br>[14:20] okay.<br>[14:31] Um<br>[14:34] I want to come here<br>[14:38] from here say deep.<br>[14:47] Let's ask questions like for example um<br>[14:57] how do you how do I use this project in<br>[15:01] a plug-in<br>[15:03] and also<br>[15:05] okay that<br>[15:13] I guess it's by um yeah We<br>[15:23] Okay, perfect. So, we install this as a<br>[15:26] dependency and then we just um<br>[15:31] use the name space so we can make calls<br>[15:35] to the specific<br>[15:39] specific uh methods.<br>[15:43] Okay, it has two ways but then also um<br>[15:49] okay the different providers<br>[15:53] require<br>[15:54] a specific API key.<br>[15:58] How are these credentials<br>[16:03] entered<br>[16:05] if I use this package directly from a<br>[16:10] plugin?<br>[16:30] Okay. So if I define a specific<br>[16:34] environment<br>[16:36] variables<br>[16:40] then the plug-in automatically<br>[16:45] detects them.<br>[16:53] Mhm.<br>[16:56] Um<br>[17:01] okay.<br>[17:06] Or we can also depending on the we need<br>[17:11] to use different providers and they can<br>[17:14] be open AAI, Google provider, anthropic<br>[17:17] provider.<br>[17:20] For example, we<br>[17:23] we're going to do some tests just with<br>[17:26] one provider. So we can do um<br>[17:34] registry<br>[17:36] new provider registry<br>[17:40] and then we<br>[17:48] okay so I guess the easiest way is this<br>[17:51] one<br>[17:56] plugin implementation example here's how<br>[17:58] to implement this in a WordPress plug-in<br>[18:00] so we uh in your plug-in bootstrap file<br>[18:04] we do is<br>[18:07] we um set credential<br>[18:12] from plug-in options or<br>[18:16] okay from plug-in options alth config.<br>[18:19] So yeah, so the idea is that in our<br>[18:22] plug-in we create like a panel where the<br>[18:25] the user can introduce the API key<br>[18:30] and if uh that doesn't exist in our case<br>[18:33] we directly um<br>[18:37] define that. So we can simplify this in<br>[18:40] our in our example just by saying this<br>[18:45] you can check if a provider is<br>[18:47] configured using is provider code<br>[18:56] provider registry and model discovery.<br>[19:07] interesting<br>[19:11] but yeah let's continue with the<br>[19:17] okay so the credentials<br>[19:20] uh thing are clear and let's continue<br>[19:23] the SDK addresses both user needs and<br>[19:26] developer needs a provider agnostic<br>[19:29] approach puts the user first<br>[19:33] and the WordPress site administrators<br>[19:35] choose which provider and or model they<br>[19:38] want to configure and use. They can<br>[19:39] provide API credentials in a single<br>[19:41] place. Any plugins with AI features just<br>[19:45] work. No more vendor locking.<br>[19:52] Okay.<br>[19:54] So the way it works is that there is a<br>[19:56] panel where the credentials are<br>[19:58] introduced and then the the the calls<br>[20:02] that are done via this plug-in they just<br>[20:05] work even if we change models and I<br>[20:08] think it has some<br>[20:10] we can check that later. I think it has<br>[20:12] some logic to decide which model is the<br>[20:19] um the best option depending on the<br>[20:22] depending on the task to do. So yeah,<br>[20:25] we'll check this later.<br>[20:28] Developers can focus on building AI<br>[20:30] features, not AI infrastructure. Instead<br>[20:33] of trying to find an an official SDK for<br>[20:36] a single provider or having to even<br>[20:38] build it yourself, the SDK gives<br>[20:41] developers the central infrastructure to<br>[20:44] get started quickly and focus on the<br>[20:46] user benefits rather than their own<br>[20:48] plugins technical plumping. No more<br>[20:50] reinventing the web. Yeah.<br>[20:53] So this is like a central layer that um<br>[20:58] provides all the plumbing.<br>[21:03] So plug-in developers can directly use<br>[21:06] AI features. They don't need to worry<br>[21:07] about the specific calls that uh need to<br>[21:11] be made to the final<br>[21:14] uh model.<br>[21:19] They can just do things like this like I<br>[21:22] client prompt whatever. Okay. How it<br>[21:24] works? The API adapts to different<br>[21:26] developer needs. Some plug-in solutions<br>[21:30] may require specific models<br>[21:35] while others just need any text<br>[21:37] complication capability. The PHP AI<br>[21:40] client is the handles all the complexity<br>[21:42] behind the scenes different<br>[21:44] authentication methods, API formats,<br>[21:46] streaming protocols and provider that<br>[21:48] works all work through the same clean<br>[21:51] interface. So here's a simple tentative<br>[21:54] code example for generating text using a<br>[21:58] specific mode.<br>[22:04] Okay, but in the same example but<br>[22:05] written in a model and provider agnostic<br>[22:08] way<br>[22:11] and this can use uh behind the curtains.<br>[22:14] This can use like any model define<br>[22:19] the problem it solves. Uh today every<br>[22:22] WordPress plug-in with AI features<br>[22:24] rebuilds the same infrastructure<br>[22:26] provider integrations, API key<br>[22:28] management, response normalization,<br>[22:31] error handling. Users enter the same<br>[22:34] credentials multiple times and deal with<br>[22:36] inconsistent experiences.<br>[22:40] When providers change their APIs, every<br>[22:42] plug-in breaks separately. It is worth<br>[22:45] highlighting that these problems not<br>[22:48] only exist in WordPress, but in more or<br>[22:50] less every PHP project that aims to use<br>[22:53] AI in a provider agnostic way. The only<br>[22:57] truly provider agnostic SDKs that exist<br>[23:01] today are for other tech stacks that are<br>[23:05] not interoperable with general PHP<br>[23:08] projects. either different serverside<br>[23:12] languages like the burcell versel AI SDK<br>[23:16] for nodes or a specific platforms like<br>[23:19] Drupal's AI module.<br>[23:22] So the PHPI client SDK centralizes this<br>[23:26] complexity for the PHP ecosystem and in<br>[23:29] WordPress WordPress specifically one<br>[23:33] integration point handle all providers<br>[23:37] one credential system serves all plugins<br>[23:43] providers update or new ones emerge. The<br>[23:46] changes happen once and benefit<br>[23:47] everyone. The architecture is designed<br>[23:49] with latest trends like multimodel first<br>[23:52] in mind and even anticipates future<br>[23:54] shifts like client side or browser based<br>[23:58] AI. Yeah, I'm really interested in this.<br>[24:02] Uh I think right now this is not<br>[24:06] this is not um<br>[24:15] it's not implemented. Um, let's talk a<br>[24:18] little bit about this.<br>[24:22] So,<br>[24:33] okay.<br>[24:36] So, for example, there are browsers like<br>[24:39] Chrome.<br>[24:51] So there are browsers like Chrome that<br>[24:58] they provide a built-in AI capabilities<br>[25:02] AI<br>[25:06] internal models at least they provide<br>[25:09] specific features that<br>[25:12] run um<br>[25:17] with AI internally like they have<br>[25:20] different APIs, summarizer,<br>[25:24] grader, proof reader, translator API,<br>[25:27] prompt API<br>[25:31] and<br>[25:36] this is interesting because<br>[25:39] this architecture is designed uh<br>[25:42] anticipating future ships like client<br>[25:44] side or browser based AI.<br>[25:51] But I think right now this is not<br>[25:54] possible because the current<br>[25:58] implementations that we have are only<br>[26:00] for these uh three providers<br>[26:04] which means we can only<br>[26:06] um communicate right now with uh models<br>[26:10] of these companies.<br>[26:13] But I guess that the idea is that we can<br>[26:16] define our own providers or we can<br>[26:18] submit a pull request with a new<br>[26:20] provider that um<br>[26:26] would enable the communication with a<br>[26:29] browserbased AI. That would be an<br>[26:32] interesting<br>[26:34] an interesting future.<br>[26:37] Okay. Build together. So the PHP AI<br>[26:40] client SDK technically consists of two<br>[26:43] composer packages.<br>[26:46] The underlying PHP package provides the<br>[26:49] unified AI interface and it is WordPress<br>[26:52] agnostic.<br>[26:54] It is a collaborative for with the wider<br>[26:56] PHP community.<br>[27:14] So I think that it refers to Yeah,<br>[27:17] that's why it's called PHP AI client<br>[27:20] because it's not really a specific to<br>[27:23] WordPress is a provider agnostic PHP AI<br>[27:28] client SDK to communicate with any<br>[27:30] generative AI models of various<br>[27:33] capabilities using a uniform API. So<br>[27:36] this is not a specific for WordPress.<br>[27:39] This is something<br>[27:42] that can be used in any PHP project.<br>[27:46] We have here a provider agnostic uh PHP<br>[27:51] AI client SDK to communicate with<br>[27:55] yeah<br>[27:59] but can be can be installed as a<br>[28:01] composer package and in a plug-in<br>[28:06] WordPress in a WordPress plugin<br>[28:12] but it's not a plug-in itself. Okay.<br>[28:17] While this project is stewarded by the<br>[28:20] WordPress AI team members and<br>[28:21] contributors, it is technically<br>[28:23] WordPress agnostic. The gap the project<br>[28:26] addresses is relevant for not only the<br>[28:28] WordPress ecosystem but overall PHP<br>[28:31] ecosystem. So any PHP project could<br>[28:35] benefit from it. There's also no<br>[28:37] technical reason to scop it to WordPress<br>[28:39] as communicating with AI models and<br>[28:42] their providers is independent of<br>[28:44] WordPress built in APIs and par<br>[28:49] paradigms.<br>[28:53] Okay. Nice. Nice. This is uh more clear<br>[28:57] to me now.<br>[29:01] But this package that's why there are<br>[29:04] like a building blocks. we have like<br>[29:06] different uh<br>[29:09] ports. This is complemented by another<br>[29:12] WordPress specific package that adds<br>[29:15] features technically tied to WordPress<br>[29:20] such as the shared settings page for AI<br>[29:23] API credentials,<br>[29:25] connection to the abilities API and the<br>[29:28] rest API endpoints to use AI<br>[29:30] capabilities in JavaScript as well.<br>[29:34] Um, okay. So I understand this part.<br>[29:38] This is<br>[29:42] completely<br>[29:44] this project but<br>[29:51] um<br>[29:53] I'm not sure about this part.<br>[29:59] So the PHP maybe this has evolved<br>[30:03] because this was<br>[30:07] this was the intention in July last year<br>[30:10] and maybe this has evolved in some other<br>[30:13] thing. Um<br>[30:22] but yeah, let's uh read a bit more<br>[30:28] to see. Um<br>[30:38] let's ask uh Deep Wiki about this.<br>[30:42] Um,<br>[30:49] let's ask deep wiki about this.<br>[30:54] Um,<br>[30:56] are there any references in the<br>[31:00] repository about this other<br>[31:04] package that is more specific to<br>[31:08] WordPress?<br>[31:18] Let's see.<br>[31:36] So<br>[31:38] yeah, maybe this refers to the<br>[31:42] I think this may be the AI experiments<br>[31:45] plugin. This one.<br>[32:00] Um, this uh project is the WordPress.<br>[32:07] I think it's this one.<br>[32:16] I think it's this one<br>[32:20] because this provides a<br>[32:25] live demo. Let's try this. I think this<br>[32:28] provides a specific um dashboard to<br>[32:33] enter the<br>[32:37] the<br>[32:39] credentials.<br>[32:41] EI experiments.<br>[32:48] Okay. Most experiments require the valid<br>[32:52] AI credentials to function properly. To<br>[32:54] ensure those work properly, you need to<br>[32:56] have one or more AI credentials set<br>[32:58] here.<br>[33:01] So this is an example of how we can<br>[33:04] introduce these uh credentials, this API<br>[33:08] key.<br>[33:11] control whether AI experiments are<br>[33:13] enabled for your site disabled all<br>[33:16] experiments. Okay. And then<br>[33:20] once we have the credentials, we can<br>[33:23] enable experiments. And the experiments<br>[33:27] can be any of these ones that um<br>[33:35] they<br>[33:37] use this um<br>[33:41] package.<br>[33:43] In fact, if we go here to composer.json,<br>[33:46] application. We should see<br>[33:49] somewhere. Yeah, here it is.<br>[33:54] WordPress wpai<br>[33:57] client. This is the one.<br>[34:02] Go to composer.json.<br>[34:04] Yeah, WordPress PHP AI client.<br>[34:10] And then let's also check<br>[34:17] Let's also check this WordPress AI<br>[34:21] client<br>[34:26] AI clients.<br>[34:32] So includes abilities image.<br>[34:37] Okay. I think this has evolved. This has<br>[34:40] changed. Maybe<br>[34:43] the name space now is this one<br>[34:48] with underscore.<br>[34:54] Um, okay. This is<br>[34:58] um<br>[35:05] yeah, I think there are some<br>[35:06] inconsistencies here because the spaces<br>[35:11] in different but yeah um it confirms<br>[35:15] what we suspected. It uses the this SDK.<br>[35:29] Okay. So I would say that this um is the<br>[35:38] um<br>[35:46] I'm going to<br>[35:51] we can copy this.<br>[36:02] So here<br>[36:08] this um<br>[36:22] this refers to the<br>[36:28] PHP AI client.<br>[36:37] PHP AI client.<br>[36:47] And this<br>[36:54] refers to<br>[36:58] the um<br>[37:05] WordPress AI.<br>[37:15] WordPress AI<br>[37:18] which is the<br>[37:22] WordPress AI<br>[37:24] um experiments.<br>[37:32] This is this is my understanding at<br>[37:34] least. So<br>[37:36] um<br>[37:41] WordPress AI experiments<br>[37:45] and then this is like the PHP AI client<br>[37:50] SDK. I like this name.<br>[37:56] I like this thing.<br>[38:08] Um<br>[38:12] well this is not exactly true. I think<br>[38:15] what I think is the initially the idea<br>[38:17] was to create two composer<br>[38:23] packages<br>[38:25] but this is actually a plug-in<br>[38:29] right yeah AI PHP<br>[38:36] so I think the second part has evolved<br>[38:42] yeah plugin<br>[38:44] The second part<br>[38:48] has evolved as a plugin.<br>[38:52] I'm going to add here um<br>[38:56] this has evolved<br>[39:00] as a plugin.<br>[39:09] Um,<br>[39:13] I'm going to put here<br>[39:17] plugin<br>[39:21] and<br>[39:28] the background want to be here. This<br>[39:34] and<br>[39:39] This I want it to be here. This.<br>[39:47] Okay.<br>[39:49] So, this is a plugin<br>[39:56] and this is a<br>[39:59] composer<br>[40:01] package.<br>[40:15] Mhm.<br>[40:25] composer package and<br>[40:32] well this has evolved as a plug.<br>[40:43] Okay, I'm clarifying this because it<br>[40:46] says here that<br>[40:49] um<br>[40:58] because it said here that it consists on<br>[41:01] two composer packages. I think I<br>[41:05] initially that was the idea but um<br>[41:09] this has evolved in different things.<br>[41:15] Okay,<br>[41:18] let's continue reading here.<br>[41:25] This modular approach means when any<br>[41:27] community adds a provider or improves<br>[41:30] performance, everyone benefits while<br>[41:32] each platform maintains its unique<br>[41:34] experience. For WordPress developers,<br>[41:37] this architecture offers flexibility.<br>[41:40] Use the WordPress package for the full<br>[41:44] experience with admin UI or the<br>[41:47] underlying<br>[41:49] PHP package for lower lower level<br>[41:53] projects such as um WPCLI integration.<br>[42:01] While also available as a plug-in for<br>[42:03] testing, these composter packages are<br>[42:05] the official adoption path. So does this<br>[42:10] uh includes a composer package<br>[42:14] composer.json.<br>[42:23] Ah so this is also a WordPress package<br>[42:25] and AI experiments and capabilities for<br>[42:28] WordPress.<br>[42:35] Okay. So maybe<br>[42:37] I need to<br>[42:41] see an example of<br>[42:45] Okay.<br>[42:48] So So yeah, maybe this is also um a<br>[42:52] composer um<br>[42:56] package.<br>[43:02] So instead of um<br>[43:07] went to<br>[43:10] also available<br>[43:16] as a plugin.<br>[43:20] So what I'm going to do here is<br>[43:31] compose a package.<br>[43:34] I need to check this.<br>[43:39] I need to check<br>[43:45] if this can be used only as a composer<br>[43:47] package. But yeah, we can use definitely<br>[43:50] this as a plug-in the experiments that<br>[43:52] internally it uh uses this um AI client<br>[43:58] as a composer package.<br>[44:04] Okay. So, let's uh let's try this.<br>[44:08] Let's create some code.<br>[44:13] I'm going to<br>[44:19] I'm going to create a new project<br>[44:23] under um<br>[44:33] um projects<br>[44:38] um 2026<br>[44:41] um<br>[44:43] PHP<br>[44:45] PHP AI<br>[44:48] client demo<br>[44:50] string.<br>[44:52] What this uh doesn't exist.<br>[44:56] So what I need to do<br>[45:00] is um<br>[45:06] take this will create this project and<br>[45:10] will take me the PHP AI client SDK<br>[45:16] no uh demo<br>[45:19] stream.<br>[45:21] Okay.<br>[45:23] And now um let's open cursor<br>[45:32] um and let's um<br>[45:37] open the console.<br>[45:43] And what we can do is maybe open clo so<br>[45:47] it can generate<br>[45:55] So it can generate. So we can maybe do<br>[45:57] plot<br>[46:01] and I can say<br>[46:06] I can say<br>[46:10] PHP AI client. Okay.<br>[46:15] I can say scaffold a very basic<br>[46:18] structure of a WordPress plug-in. I want<br>[46:22] to<br>[46:25] test this<br>[46:27] composer package with some<br>[46:31] basic code to connect to external models<br>[46:37] from my WordPress instance.<br>[47:09] Okay. So we have this here<br>[47:17] um<br>[47:19] okay it's with um<br>[47:24] was another key<br>[47:34] and this is what I said<br>[47:38] scaffold<br>[47:43] Okay. So, I just wanted to maybe create<br>[47:46] a composer.json<br>[47:48] and<br>[47:51] um<br>[47:57] Okay. What I want you to do<br>[48:03] um<br>[48:06] No.<br>[48:12] Okay, I just want a basic plug-in<br>[48:16] structure to check the referenced uh<br>[48:21] composer package.<br>[48:24] You have some WordPress develop<br>[48:26] development<br>[48:28] skills. So, please use them to scaffold<br>[48:33] this basic plug-in structure.<br>[48:38] because I have some um have some skills.<br>[48:46] Let's open here in the meantime clo.<br>[48:58] As you can see here, I have some skills<br>[49:01] related to<br>[49:11] But<br>[49:15] it doesn't seem that. Yeah.<br>[49:23] So the thing is that this um extension<br>[49:26] of visual code or cursor doesn't really<br>[49:30] has access doesn't really have access to<br>[49:32] the skills. I let me check. Do you have<br>[49:35] access to the skills?<br>[49:50] It doesn't work as well as the terminal<br>[49:54] thing.<br>[49:58] So I may use this<br>[50:05] or here instead.<br>[50:11] But anyway, it it's creating the<br>[50:16] it's creating the<br>[50:19] PHP file for the plugin is creating<br>[50:22] composer.json is within the admin which<br>[50:25] I don't know exactly why. Let's see.<br>[50:38] Okay. No, I don't like<br>[50:44] um<br>[50:49] Okay. Create a very basic plug-in<br>[50:53] structure to test the<br>[50:59] composer package that is in the<br>[51:02] following repository.<br>[51:06] I want the plug-in to be really really<br>[51:08] basic.<br>[51:12] Any settings or any value I will<br>[51:17] define them via code. So please do not<br>[51:20] implement any settings page or dashboard<br>[51:23] or similar. Also,<br>[51:28] please do not implement any life cycle<br>[51:31] plug-in logic because this is just a<br>[51:34] test and I want the plug-in to be really<br>[51:36] basic.<br>[51:46] And um<br>[51:54] this is the<br>[52:00] and this is the repository. Copy link<br>[52:03] address.<br>[52:19] Let's see what it does.<br>[52:38] Um<br>[52:45] Okay,<br>[52:49] the thing is that I have defined to use<br>[52:53] always the<br>[52:55] context 7 MCP which<br>[53:01] um<br>[53:03] gets documentation directly.<br>[53:08] Also do not forget that you have a<br>[53:11] development<br>[53:12] WordPress development skills. So please<br>[53:15] use them<br>[53:17] for this work.<br>[53:43] Mhm.<br>[54:03] Okay. So, it's um<br>[54:05] it's checking the repository.<br>[54:12] I told it I want to check. So, it's<br>[54:16] creating a<br>[54:32] Um,<br>[54:34] okay. Nice. So,<br>[54:38] besides<br>[54:42] creating the<br>[54:48] Okay, nice. Nice. I think<br>[54:52] it was worth the the wait.<br>[55:07] Okay. So here we are using the the name<br>[55:10] space<br>[55:12] in order to do that is loading the<br>[55:14] autoload.<br>[55:17] Yeah, this is more or less what I<br>[55:19] wanted. Um,<br>[55:27] we need to uh simply test functions<br>[55:30] generate text using AI<br>[55:39] error lock<br>[55:41] return text. Okay. So we have these<br>[55:45] functions.<br>[55:54] So test AI text generation<br>[55:59] is uh doing this<br>[56:02] and it's returning the text<br>[56:07] but uh this function need to be called<br>[56:12] uh from somewhere. So maybe<br>[56:16] I can just do from init. This can be<br>[56:20] instead of calling directly this, this<br>[56:22] can be a function<br>[56:25] h where I call this and I um<br>[56:32] I lock this<br>[56:36] maybe that can be that can be a thing.<br>[56:40] Um,<br>[56:44] also<br>[56:46] what I'm going to do<br>[56:51] is to<br>[56:56] um<br>[56:58] Okay.<br>[57:00] Yes.<br>[57:08] Okay. I also prepare the plug-in. So<br>[57:11] credentials can be<br>[57:14] defined from a separate file inside the<br>[57:18] project.<br>[57:34] Okay, it's solving some issues<br>[57:37] because the version is PHP AI client.<br>[57:43] Let's see.<br>[57:47] It's 040 3 days ago.<br>[58:07] Okay, it's running composer install.<br>[58:12] Uh, which means is creating the vendor<br>[58:15] and inside the vendor<br>[58:18] composer.<br>[58:21] Okay, seems like a<br>[58:25] seems like a minimal uh setup which is<br>[58:28] what we were looking for. And then the<br>[58:32] PHPA AI client will internally have some<br>[58:37] other dependencies such as PHP HTTP I<br>[58:41] guess and some others.<br>[58:46] Um<br>[58:56] okay so now<br>[58:58] it's checking from the repository how<br>[59:00] the credential system works.<br>[59:06] Um<br>[59:09] in our case in vendor<br>[59:15] I know this is the vendor inside.<br>[59:25] So the credentials<br>[59:28] um<br>[59:35] I need credentials in order to run this.<br>[59:38] And in the meantime, what I can do is<br>[59:40] I'm going to open studio.<br>[59:45] I'm going to open studio.<br>[59:52] Maybe I can leverage I can use the same<br>[59:58] repository<br>[60:00] or 2026 experiments.<br>[60:05] Okay, let's use this. And in order to do<br>[60:08] this, I'm going to click it term because<br>[60:12] in WP content uh plugins<br>[60:21] I'm going to remove.<br>[60:29] And what I'm going to do is I'm going to<br>[60:31] link I'm going to create a sim link to<br>[60:35] the uh let me make this<br>[60:39] bigger.<br>[60:40] Okay. I'm going to ln<br>[60:43] uh<br>[60:46] project<br>[60:49] um<br>[60:52] cheese.<br>[61:00] Perfect.<br>[61:02] So if we<br>[61:05] run this,<br>[61:10] we should get this plug-in installed.<br>[61:24] Okay,<br>[61:27] define. Perfect. This is what I wanted<br>[61:30] because I want this to be<br>[61:33] credentials<br>[61:41] because I want to do this in another uh<br>[61:45] window in a different place.<br>[61:49] Oh, bear with me.<br>[62:00] I need to<br>[62:09] I need to<br>[62:12] move this to another folder.<br>[62:15] And from here<br>[62:22] I'm going to use<br>[62:27] open AI<br>[62:33] credentials and<br>[62:52] I need to access my<br>[62:59] open AI.<br>[63:18] Okay, it's this one. Then if I edit this<br>[63:23] open AI key.<br>[63:32] Perfect.<br>[63:48] Okay.<br>[63:50] So now we should have the credentials<br>[63:55] and<br>[64:00] what I'm going to do is um<br>[64:06] I'm going to close this because I want<br>[64:09] to open this in cursor which is the<br>[64:12] whole um<br>[64:16] WordPress installation that includes<br>[64:20] I'm going to be working on this<br>[64:23] on this file.<br>[64:27] Why do I want this? Because I want the<br>[64:30] the backlog<br>[64:35] to display the log. So if I reload<br>[64:49] um<br>[64:53] in WordPress settings online 560 Next<br>[64:57] thing<br>[65:23] include once plugin<br>[65:27] Okay, I think I need to go to plugins.<br>[65:41] Okay,<br>[65:44] so I shouldn't get this error message.<br>[65:59] Well, okay. It seems that um<br>[66:04] it shouldn't happen because if I remove<br>[66:06] the folder, I think that I should get<br>[66:11] I should get um the plugin should be<br>[66:13] removed.<br>[66:15] Um,<br>[66:20] so what I'm going to do is I'm going to<br>[66:24] stop the side.<br>[66:28] Going to remove this.<br>[66:31] Then I'm going to<br>[66:33] start again<br>[66:35] the side.<br>[66:39] And I'm going to<br>[66:42] um<br>[66:47] to log again. I need to get the password<br>[66:50] from here. So, it's<br>[67:02] so I'm logging in.<br>[67:10] Okay.<br>[67:19] I guess that's the first time. But now<br>[67:21] if I reload, I don't get this. Okay. And<br>[67:24] now that the backlog is uh clean again.<br>[67:27] So now we have<br>[67:31] the<br>[67:35] plugin installed.<br>[67:38] We have the credentials in place.<br>[67:42] And<br>[67:47] what we want is um<br>[67:54] okay so we have<br>[67:56] different functions<br>[67:59] simple test function to generate text<br>[68:02] using AI.<br>[68:05] Okay, let me try one thing. I'm going to<br>[68:07] try<br>[68:13] I'm going to try<br>[68:22] I'm going to try accessing the<br>[68:28] let me if I go to GitHub and if I go to<br>[68:34] my guests I have here.<br>[68:38] Um<br>[68:45] I have here uh<br>[68:54] yeah this one. Okay. WP shell is the<br>[68:58] command I was looking for. So if I do<br>[69:02] not from here but from<br>[69:06] DolbyP<br>[69:07] like uh 2026 experiments. If I open a<br>[69:12] terminal<br>[69:15] and I do WP shell,<br>[69:22] I get a terminal.<br>[69:25] um<br>[69:29] where my WordPress instance is loaded,<br>[69:31] which means that<br>[69:34] I should be able to access this.<br>[69:42] For example, in my example, I was doing<br>[69:46] this. So<br>[69:52] test AI text generation<br>[69:56] in my code<br>[69:59] doesn't require any parameters.<br>[70:05] Let's see.<br>[70:25] Because<br>[70:28] I think I forgot one thing.<br>[70:32] I forgot to activate this.<br>[70:37] Okay, let's start again.<br>[70:48] No models found that support text<br>[70:50] generation for this prompt. So the<br>[70:53] function is working properly.<br>[70:56] But uh something is going on here. Let's<br>[71:01] try the other functions just to see.<br>[71:08] Uh this is the one<br>[71:13] no models found for provider. So yeah.<br>[71:17] Um okay<br>[71:25] found<br>[71:30] with parameters.<br>[71:33] Okay. Okay.<br>[71:36] Well, but at least the testing setup is<br>[71:38] is there. Now, we need to fine-tune this<br>[71:43] function. So, um Okay. So, what I'm<br>[71:47] going to do is<br>[71:49] I'm going to remove all of them. And now<br>[71:53] we can check the documentation.<br>[71:56] Now, we can come here<br>[72:00] and we can test um<br>[72:06] called examples text generation using<br>[72:08] any compatible model from a specific<br>[72:11] provider.<br>[72:14] So this is the<br>[72:32] using provider open AI.<br>[72:36] Um<br>[72:46] So yeah, I actually like this structor.<br>[72:50] I like it.<br>[72:52] Yeah. Text.<br>[72:55] This is the<br>[72:59] And if not, I'm<br>[73:03] getting here the um<br>[73:07] the locks.<br>[73:17] So let's start again.<br>[73:20] Um<br>[73:23] Dolby VP<br>[73:25] shell<br>[73:31] test AI text generation.<br>[73:36] Test AI tech generation.<br>[73:42] No models found for provider open AI.<br>[73:53] Okay. Text generation using any<br>[73:54] compatible model from a specific<br>[74:01] provider.<br>[74:04] But in theory,<br>[74:07] generate text<br>[74:10] should um<br>[74:14] this should work with any compatible. So<br>[74:18] in theory,<br>[74:21] I shouldn't need to do this.<br>[74:30] Um<br>[74:38] So<br>[74:47] what I'm going to do is I'm going to<br>[74:51] ask the deep wiki thing which is here.<br>[74:57] Um,<br>[75:02] yeah, this PHP AI client. So, I'm going<br>[75:06] to<br>[75:07] open a new<br>[75:12] Let's see what can it tell me about this<br>[75:16] error.<br>[75:24] Okay, I'm going to also<br>[75:28] provide the function<br>[75:33] and this is my code.<br>[75:44] So it said<br>[76:01] Uh, so I need to do<br>[76:04] more things.<br>[76:16] Um, Requirements<br>[76:19] for success. For automatic discovery to<br>[76:22] work, you need at least one provider<br>[76:24] properly configured.<br>[76:26] Happy keys. Set environment variables.<br>[76:36] So we need to check first<br>[76:42] if this is configured. So<br>[76:49] um error rock is conf. Okay.<br>[76:54] Open AI<br>[76:58] and the backlog<br>[77:03] is empty.<br>[77:21] Okay. Because<br>[77:26] No, it should fail.<br>[77:33] Let's um<br>[77:38] test this again.<br>[77:52] Okay. So maybe<br>[78:05] the credentials. No, the credentials are<br>[78:08] uh properly<br>[78:12] properly introduced<br>[78:15] because his credentials, right?<br>[78:20] Credentials.<br>[78:22] um file exist.<br>[78:24] Um what I can do.<br>[78:41] What I can do is um<br>[78:54] Okay.<br>[78:56] Okay. We're fine.<br>[79:11] Okay.<br>[79:12] So<br>[79:15] if I go to<br>[79:21] shell.<br>[79:26] So the file is being properly<br>[79:31] loaded because this is something I just<br>[79:33] added<br>[79:35] and<br>[79:44] And let me see if the way the<br>[79:47] credentials are defined is correct. So<br>[79:50] if we go to<br>[79:52] PHP AI client and<br>[79:58] let's look for<br>[80:01] open<br>[80:03] open<br>[80:05] AI<br>[80:09] happy<br>[80:11] Okay.<br>[80:26] Mhm.<br>[80:36] Open AI. Okay. So<br>[80:41] maybe this is not the way to define the<br>[80:43] credentials.<br>[80:45] Um<br>[80:50] okay, let's look for<br>[80:55] healing docs.<br>[80:58] Um architecture requirements<br>[81:01] requirements<br>[81:14] Um, let's look for<br>[81:19] credentials.<br>[81:34] Um,<br>[81:39] Okay.<br>[81:41] All our credentials<br>[81:43] provided to<br>[81:47] the different providers.<br>[81:53] So what I have done is I have defined<br>[81:56] this<br>[81:58] constant called open AAI API<br>[82:04] key.<br>[82:07] But um<br>[82:47] Is it enough if I just do this<br>[82:53] before calling the<br>[82:59] PHP AI client SDK classes and methods.<br>[83:14] Okay, let's see.<br>[83:30] So be my AP key, my my real API key.<br>[83:44] Mhm.<br>[83:50] Um,<br>[83:54] so the API key is defined.<br>[84:05] If<br>[84:18] Okay, let's try again. This<br>[84:29] open AI is not configured. So that's the<br>[84:32] issue.<br>[84:34] That's the issue. Um,<br>[84:51] the boss<br>[85:12] Okay,<br>[85:16] I have the open AI API_key<br>[85:22] constant defined before calling the<br>[85:27] methods like this.<br>[85:44] But the following<br>[85:48] cold returns false.<br>[86:02] So<br>[86:04] yeah something is going on. We have<br>[86:07] defined the constant. So in theory it<br>[86:10] should be<br>[86:13] it should be well actually you know what<br>[86:16] we can check how it's done here<br>[86:34] okay so<br>[86:38] so Maybe the API. Yeah, maybe the API<br>[86:41] key is not<br>[86:47] um maybe my API key<br>[86:53] is not um<br>[86:59] maybe my API key is not um<br>[87:05] okay, let's try another one.<br>[87:10] this one. Um,<br>[87:32] okay, let's try another one.<br>[87:38] because I think it<br>[87:41] I think it runs a specific API<br>[87:47] call. So I was I was expecting that um<br>[87:52] I could get an error message saying that<br>[87:56] your credentials are not correct. So<br>[87:59] I know that the<br>[88:03] the flow is working properly like the<br>[88:05] proper calls, the proper functions are<br>[88:08] being called. But no, it seems that my<br>[88:10] API key um because I have uh<br>[88:19] have several versions of the API key. So<br>[88:21] maybe it's not the the latest one.<br>[88:25] So let's try another one. Let's try<br>[88:27] another one.<br>[88:30] What I'm going to do is I'm going to<br>[88:33] define<br>[88:39] I'm going to define<br>[89:09] I'm going to define<br>[89:11] um<br>[89:17] let's check now if the anthropic is<br>[89:20] properly configured.<br>[89:27] Okay, let's start again. Let's go with<br>[89:31] uh<br>[89:33] WP shell<br>[89:39] traffic is not configured.<br>[89:42] No models found that support text<br>[89:45] generation for this prompt.<br>[89:49] Let's check.<br>[89:59] So I have uh don't they have<br>[90:05] the model? Okay.<br>[90:23] I'm going to test the<br>[90:38] So I'm getting this errors all the time.<br>[90:41] I have tried two API keys and<br>[90:47] I think that they are fine. So I don't<br>[90:50] think it's an issue with the wrong API<br>[90:52] key. Can you double check with the<br>[90:56] following repository how credentials<br>[91:00] should be<br>[91:02] defined in order to use these<br>[91:08] methods of the PHP AI client SDK?<br>[92:20] Um,<br>[92:39] Okay, let me access the prompt that I<br>[92:41] want to pass.<br>[92:45] I want to pass to<br>[92:48] code.<br>[92:53] Sorry.<br>[93:05] And in the meantime, we can check the<br>[93:14] we can check the AI.<br>[93:22] this one. And what we can also do is we<br>[93:28] can come here and say uh deep<br>[93:34] wiki for this.<br>[93:40] How are credentials<br>[93:43] managed in this project?<br>[93:46] I want a clear reference of how to<br>[93:50] provide credentials<br>[93:53] to use PHP<br>[93:56] AI<br>[93:58] client SDK<br>[94:01] functions.<br>[94:34] Okay. So, it's managed internally.<br>[94:39] Credentials are are stored internally<br>[94:45] uh as valid AI credentials. Check if any<br>[94:51] prompt<br>[94:53] test is supported for text generation.<br>[95:11] Okay. So, yeah. I don't know. Maybe the<br>[95:14] credentials I'm using are not fine.<br>[95:29] Um,<br>[95:36] Baby.<br>[96:45] Okay. Um<br>[97:38] Okay. So the credentials<br>[97:42] are correct.<br>[97:49] I have just tested them with an API<br>[97:52] call.<br>[98:14] Um,<br>[98:32] so lot credential ial the credentials<br>[98:34] are required are defined. So yeah at<br>[98:38] this point the API key should be defined<br>[98:41] and should be available.<br>[98:45] I'm not sure what's going on here.<br>[99:19] Um,<br>[100:26] Um,<br>[101:20] Okay, so I need to<br>[101:24] Let me try something.<br>[101:51] I'm going to try.<br>[101:59] So, do I need to initialize this?<br>[102:03] Um,<br>[102:11] do I need to initialize<br>[102:16] AI client in it.<br>[102:26] I'm not sure.<br>[102:30] But let's try this again.<br>[103:20] Uh,<br>[103:24] so<br>[103:27] in theory with this<br>[103:31] I get<br>[103:42] Um,<br>[103:45] I can go here to<br>[103:53] And now I have an error.<br>[104:15] Mhm.<br>[104:43] Okay, I'm getting an error because<br>[104:49] I'm getting this.<br>[104:51] And if I go to the book lock,<br>[105:04] okay, I think it was because let me<br>[105:11] remove the logs.<br>[105:14] Then I'm going to check the code.<br>[105:26] Do I have to?<br>[105:33] No, I only have to. What in it?<br>[105:37] Function AI<br>[105:40] client in it. That's fine because I'm<br>[105:43] doing this<br>[105:47] um<br>[105:56] Um,<br>[106:02] okay. For now, I'm going to<br>[106:05] comment this. Let's see what happens.<br>[106:39] Okay, with this if I go to plugins<br>[107:14] If I go to tools uh to<br>[107:20] plugins<br>[107:34] okay so we have the composer require<br>[107:38] WordPress AI client.<br>[107:45] This loads properly. Class exist. So I'm<br>[107:48] going to add here error lock AI client<br>[107:52] initialized.<br>[107:58] Let me see<br>[108:03] if I go to the backlog.<br>[108:07] A class WordPress AI client. AI client<br>[108:11] not found<br>[108:45] Um,<br>[108:46] if I go here,<br>[108:53] this a thing.<br>[109:08] AI client in it.<br>[109:19] Okay, let's ask a little bit more.<br>[109:30] Is there an init method that I can use<br>[109:34] to initialize the WordPress AI client<br>[109:39] that enables um<br>[109:44] a specific dashboard to enter the AI<br>[109:48] client credentials.<br>[109:59] Mhm.<br>[110:17] Okay. So that's true.<br>[110:20] Um,<br>[110:23] this is documented here. AI credentials<br>[110:26] dashboard.<br>[110:30] Not really documented here,<br>[110:34] but it's interesting to know.<br>[110:39] So this is correct. And now<br>[110:48] The only thing I need to<br>[111:20] Okay.<br>[111:24] You need<br>[111:26] else.<br>[111:37] Let's reload.<br>[111:42] AI client not initialized<br>[111:45] because<br>[112:11] Um, I client<br>[112:36] not initialized.<br>[112:44] Um<br>[113:02] Um, what's uh wrong here?<br>[113:09] And with this, I think we can call it a<br>[113:13] day.<br>[113:29] Let's see if we can finish the stream<br>[113:31] with uh this uh<br>[113:35] function working.<br>[113:41] It shouldn't be<br>[113:45] so difficult.<br>[114:15] Okay. I think I'm going to leave it<br>[114:18] here,<br>[114:21] but um<br>[114:23] next week<br>[114:26] I will do a second part of this because<br>[114:29] I want to really I want to really uh<br>[114:33] move forward with this and<br>[114:35] being able of um<br>[114:43] calling this uh function successfully.<br>[114:45] Okay. So, yeah, not a very successful<br>[114:50] stream, but we have explored a few<br>[114:52] things. We have learned a new things,<br>[114:55] which is always good. And yeah, hope you<br>[114:58] have you have enjoyed<br>[115:01] watching me struggling while I try to<br>[115:04] figure out how to talk things. So, yeah,<br>[115:09] have a great weekend and see you next<br>[115:13] week. uh same day, same time on Fridays<br>[115:18] at around um<br>[115:22] 5 uh<br>[115:25] p.m.<br>[115:27] set. Anyway, I I share the the specific<br>[115:30] time with the time zone outline. So,<br>[115:33] yeah, see you next week. Have a great<br>[115:36] weekend. <!-- deep-read:sections end -->