View Source OpenaiEx.Image.Generate (openai_ex v0.5.4)

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.

API Fields

The following fields can be used as parameters when creating a new image:

  • :prompt
  • :model
  • :n
  • :quality
  • :response_format
  • :size
  • :style
  • :user

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.Image.Generate.new(prompt: "This is a test")
%{prompt: "This is a test"}

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