Add stability package#75
Draft
wachterjohannes wants to merge 4 commits into
Draft
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
efcfcf3 to
043c921
Compare
f9a7a3c to
020f14a
Compare
2d97966 to
1451046
Compare
- Create stability-adapter package with image generation support - Implement StabilityImageAdapter using Stability client - Add StabilityImageAdapterFactory for adapter creation - Support TextToImage action with BASE64 and STREAM output - Add unit tests with 100% coverage (4 tests, 12 assertions) - Add working example file for image generation - Update stability package to use api-client ^0.4 - All tests passing, PHPStan clean (0 errors) Addresses #64 (AI Image Request) Addresses #97 (StabilityAI Adapter)
- Update composer.lock to use api-client ^0.4 (rebased to 0.4 branch) - Fix GenerateUltra::generateAsBase64() to use requestObject() instead of requestRaw() since base64 responses return JSON, not raw streams - Remove 'tests' path from phpstan.neon as tests directory doesn't exist yet - Add type annotation for format parameter in example to satisfy PHPStan - Add PHPDoc type hint for response data to match expected array shape All tests passing (4 tests, 12 assertions) and PHPStan checks clean.
- Add PHPStan ignore comment for toStream() call (method exists in concrete implementations but not in ResponseInterface contract) - Remove unnecessary PHPStan ignore comment from MockResponseMatcher - Implement missing requestRaw() method in MockTransport class - Add matchRawResponse() method to MockResponseMatcher to support raw responses All tests passing (16 tests, 34 assertions) and PHPStan checks clean.
323b6d8 to
35af73e
Compare
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.
This PR adds the StabilityAI package and adapter for image generation.
Changes
packages/stability
packages/stability-adapter
Testing
Issues