View Source OpenaiEx.Images.Generate (openai_ex v0.6.5)

This module provides constructors for the OpenAI image generation API. The API reference can be found at https://platform.openai.com/docs/api-reference/images/create.

Summary

Functions

Creates a new image generation request with the given arguments.

Functions

Creates a new image generation request with the given arguments.

Arguments

  • args: A list of key-value pairs, or a map, representing the fields of the image generation request.

Returns

A map containing the fields of the image generation request.

The :prompt field is required.

Example usage:

iex> _request = OpenaiEx.Images.Generate.new(prompt: "This is a test")
%{prompt: "This is a test"}

iex> _request = OpenaiEx.Images.Generate.new(%{prompt: "This is a test"})
%{prompt: "This is a test"}