feat(xai): Add XAI image generation handler and tests#960
Open
timothymarois wants to merge 1 commit intoprism-php:mainfrom
Open
feat(xai): Add XAI image generation handler and tests#960timothymarois wants to merge 1 commit intoprism-php:mainfrom
timothymarois wants to merge 1 commit intoprism-php:mainfrom
Conversation
Introduce image generation support for the XAI provider: add Images handler (sends POST to images/generations, validates response, extracts GeneratedImage objects, and builds a Response via ResponseBuilder) and ImageRequestMap (maps Request to provider payload and forwards supported and additional provider options). Wire the new handler into XAI by adding an images() method. Add comprehensive tests for URL and base64 responses, provider-specific options, multiple images, usage, and meta handling.
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 pull request introduces image generation support for the XAI provider, enabling the handling and mapping of image generation requests and responses. The main additions are a new
Imageshandler, a request mapping utility, and integration of these into the provider interface.Image generation support:
Imageshandler class insrc/Providers/XAI/Handlers/Images.phpto process image generation requests, validate responses, extract generated images, and build structured responses.ImageRequestMaputility insrc/Providers/XAI/Maps/ImageRequestMap.phpto map image request parameters for the XAI API, including support for additional provider options.Provider integration:
Imageshandler insrc/Providers/XAI/XAI.php.images()method to the XAI provider class to handle image generation requests using the new handler.Introduce image generation support for the XAI provider: add Images handler (sends POST to images/generations, validates response, extracts GeneratedImage objects, and builds a Response via ResponseBuilder) and ImageRequestMap (maps Request to provider payload and forwards supported and additional provider options). Wire the new handler into XAI by adding an images() method. Add comprehensive tests for URL and base64 responses, provider-specific options, multiple images, usage, and meta handling.Description
docs say it supports xai image generation, but it actually returns an exception when trying to use xai.
Breaking Changes
None