-
Notifications
You must be signed in to change notification settings - Fork 34
Adds support for HTTP Transporter Options #109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
c67f925
feat: adds support for transporter options
JasonTheAdams d1c8657
test: adds transporter option tests
JasonTheAdams 6b744d7
feat: adds support for Guzzle
JasonTheAdams 300f0b9
refactor: simplifies logic
JasonTheAdams 9305352
test: adds missing Request tests
JasonTheAdams 164c0ec
chore: updates architecture doc
JasonTheAdams 88b0075
refactor: removes pass-through methods
JasonTheAdams ba6cf36
refactor: change RequestOptions back to mutable DTO
JasonTheAdams 6551352
refactor: absorbs allow redirect into max redirect
JasonTheAdams 90e0155
refactor: removes request options from ModelConfig
JasonTheAdams 39a5d82
refactor: merges request and parameter options
JasonTheAdams 4143b11
refactor: simplify options merging
JasonTheAdams 0da66e6
refactor: send request normal way without options
JasonTheAdams b976abd
refactor: removes nullable for options parameter
JasonTheAdams File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/Providers/Http/Contracts/ClientWithOptionsInterface.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace WordPress\AiClient\Providers\Http\Contracts; | ||
|
|
||
| use Psr\Http\Message\RequestInterface; | ||
| use Psr\Http\Message\ResponseInterface; | ||
| use WordPress\AiClient\Providers\Http\DTO\RequestOptions; | ||
|
|
||
| /** | ||
| * Interface for HTTP clients that support per-request transport options. | ||
| * | ||
| * Extends the capabilities of PSR-18 clients by allowing custom transport | ||
| * configuration such as timeouts and redirect handling on each request. | ||
| * | ||
| * @since n.e.x.t | ||
| */ | ||
| interface ClientWithOptionsInterface | ||
| { | ||
| /** | ||
| * Sends an HTTP request with the given transport options. | ||
| * | ||
| * @since n.e.x.t | ||
| * | ||
| * @param RequestInterface $request The PSR-7 request to send. | ||
| * @param RequestOptions|null $options The request transport options. | ||
| * @return ResponseInterface The PSR-7 response received. | ||
| */ | ||
| public function sendRequestWithOptions( | ||
| RequestInterface $request, | ||
| ?RequestOptions $options | ||
| ): ResponseInterface; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.