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

Improve documentation for HTTPlug HTTP client requirement #82

@Ref34t

Description

@Ref34t

Background

The WordPress PHP AI Client correctly uses HTTPlug for HTTP client abstraction and auto-discovery. However, new users aren't aware they need to install an HTTPlug-compatible HTTP client adapter.

Current Experience

  1. User installs: composer require wordpress/php-ai-client
  2. User runs code and gets: DiscoveryFailedException: Could not find resource...
  3. User must research HTTPlug and PSR-18 to understand the solution

Proposed Documentation Improvements

Add to README.md:

HTTP Client Requirement

This package uses HTTPlug for HTTP client abstraction. You need to install a compatible HTTP client adapter:

# Choose one HTTP client adapter:
composer require php-http/guzzle7-adapter     # Guzzle 7 (recommended)
composer require php-http/curl-client         # cURL
composer require symfony/http-client          # Symfony

Add composer.json suggestions:

"suggest": {
  "php-http/guzzle7-adapter": "HTTPlug adapter for Guzzle 7 (recommended)",
  "php-http/curl-client": "HTTPlug adapter for cURL"
}

This maintains the correct HTTPlug architecture while improving the developer experience.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions