Skip to content

Leverage php-http/discovery to let users choose their HttpClient implementation #318

@welcoMattic

Description

@welcoMattic

As it's done in OpenAI PHP Client, it could improve the interoperability to leverage https://github.com/php-http/discovery (and psr/http-client-implementation + psr/http-factory-implementation) to reuse HttpClient installed in users' projects or suggest them one that implements PSR-18 interface.

OpenAI PHP Client choose to not be hard dependent on any other Http Client implementation to let use an already installed Http Client or suggest one, comptible with PSR-18.
I'm opening this issue to replicate this behavior to php-llm/llm-chain, instead of "forcing" users to use symfony/http-client.

I'm writing this issue just after attending to Nicolas Grekas talk about how SDK maintainers could help to improve Http Clients interoperability.

I'm looking to open a PR as soon as possible.
First step first is to identify where live hardcoded dependencies to Symfony HttpClient.

Let me know if this suggestion is something you will be ok to accept 🙏

Thanks!

PS: I've opened the same issue on

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions