feat(ai): add AI Gateway support#271
Open
innomaxx wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #271 +/- ##
============================================
+ Coverage 93.30% 93.35% +0.05%
- Complexity 1840 1850 +10
============================================
Files 169 171 +2
Lines 4969 5005 +36
============================================
+ Hits 4636 4672 +36
Misses 333 333 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds SDK support for the Crowdin AI Gateway endpoints (per #248), enabling consumers of this PHP client to proxy GET/POST/PUT/PATCH/DELETE requests through Crowdin’s AI Gateway for both Crowdin and Enterprise environments.
Changes:
- Introduces
AiGatewayApi(Crowdin) andEnterprise\AiGatewayApiwith gateway GET/POST/PUT/PATCH/DELETE methods. - Adds a generic
AiGatewayResponsemodel to wrap the API’sdatapayload. - Registers the new
aiGatewayservice on theCrowdinclient and adds unit tests for both environments.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/CrowdinApiClient/Api/AiGatewayApi.php |
Adds Crowdin (non-Enterprise) AI Gateway API methods under /users/{userId}/ai/providers/{providerId}/gateway/{path}. |
src/CrowdinApiClient/Api/Enterprise/AiGatewayApi.php |
Adds Enterprise AI Gateway API methods under /ai/providers/{providerId}/gateway/{path}. |
src/CrowdinApiClient/Model/AiGatewayResponse.php |
Adds a lightweight response model for AI Gateway responses. |
src/CrowdinApiClient/Crowdin.php |
Exposes the new $aiGateway API service in both standard and Enterprise service lists. |
tests/CrowdinApiClient/Api/AiGatewayApiTest.php |
Adds unit tests covering Crowdin AI Gateway GET/POST/PUT/PATCH/DELETE behavior. |
tests/CrowdinApiClient/Api/Enterprise/AiGatewayApiTest.php |
Adds unit tests covering Enterprise AI Gateway GET/POST/PUT/PATCH/DELETE behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| use CrowdinApiClient\Http\ResponseDecorator\ResponseModelDecorator; | ||
| use CrowdinApiClient\Model\AiGatewayResponse; | ||
|
|
||
| class AiGatewayApi extends AbstractApi |
| use CrowdinApiClient\Http\ResponseDecorator\ResponseModelDecorator; | ||
| use CrowdinApiClient\Model\AiGatewayResponse; | ||
|
|
||
| class AiGatewayApi extends AbstractApi |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #248