Versions in this module Expand all Collapse all v0 v0.12.3 Aug 10, 2026 Changes in this version + func IsContextError(err error) bool + func XAIImageAspectRatios() []string + func XAIImageResolutions() []string + type Client struct + func NewClient(cfg ClientConfig) (*Client, error) + func NewXAIImagesClient(cfg ClientConfig) (*Client, error) + func (c *Client) Generate(ctx context.Context, input Request) (Result, error) + type ClientConfig struct + APIKey string + AllowInsecureHTTP bool + AssetHosts []string + BaseURL string + Credential CredentialFunc + HTTPClient *http.Client + Headers map[string]string + MaxImageSize int64 + Model string + Protocol Protocol + type CredentialFunc func(context.Context) (token string, headers map[string]string, err error) + type Generator interface + Generate func(context.Context, Request) (Result, error) + func NewGenerator(cfg ClientConfig) (Generator, error) + type Image struct + Data []byte + Height int + MIMEType string + RevisedPrompt string + SourceURL string + Width int + type Protocol string + const ProtocolOpenAIImages + const ProtocolTokenPlanMultimodal + const ProtocolXAIImages + type Request struct + AspectRatio string + Background string + Count int + OutputFormat string + Prompt string + Quality string + Resolution string + ResponseFormat string + Size string + type Result struct + Images []Image + type TokenPlanMultimodalClient struct + func NewTokenPlanMultimodalClient(cfg ClientConfig) (*TokenPlanMultimodalClient, error) + func (c *TokenPlanMultimodalClient) Generate(ctx context.Context, input Request) (Result, error)