WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Integrate WP AI Client SDK with a simple Service Provider setup #26

@jeffpaul

Description

@jeffpaul

Description

Connect the AI Experiments plugin with the WP AI Client SDK (and its underlying PHP AI Client SDK) to establish a unified service layer that experimental features can use to communicate with AI providers. This integration will form the foundation for running AI-powered tasks, managing provider configuration, and handling fallbacks when no provider is available.

Goals

  • Add the WP AI Client SDK as a Composer dependency.
  • Initialize a dedicated service class (for example, AI_Connection_Manager) to manage provider configuration and requests through the WP AI Client SDK.
  • Expose a consistent interface for experimental features to register, request, and run AI tasks using the SDK.
  • Include simple detection and handling for available providers, supporting both user-configured and pre-configured setups.
  • Provide hooks and filters for developers or hosts to override configuration behavior.
  • Add inline documentation and example usage demonstrating how features interact with the connection layer.

Design Considerations

  • Integration should remain centralized so that each feature module can use the SDK through a shared connection layer rather than duplicating logic.
  • Maintain alignment with the plugin’s encapsulation principles: each feature should be able to depend on the connection service without introducing tight coupling.
  • Use dependency injection and clean class structure to ensure the system is testable, extendable, and maintainable.

Acceptance Criteria

  • WP AI Client SDK initializes successfully and can complete a basic test request when a provider is configured.
  • Plugin detects and handles the absence of a configured provider gracefully.
  • Feature modules can call the service to perform AI tasks using a standard method (for example, AI_Service::run_text_task()).
  • Integration is documented and passes WordPress coding standards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    In progress

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions