Documentation ¶
Index ¶
- type AddFiles
- type Dalle
- type EditImageResponse
- type EditImagesPrompt
- type EditImagesRequest
- func (e *EditImagesRequest) AddImage(image []byte) *EditImagesRequest
- func (e *EditImagesRequest) AddImageFromFileSystem(image *os.File) *EditImagesRequest
- func (e *EditImagesRequest) AddMask(mask []byte) *EditImagesRequest
- func (e *EditImagesRequest) AddMaskFromFileSystem(mask *os.File) *EditImagesRequest
- func (e *EditImagesRequest) Do() (*EditImageResponse, error)
- type GenerateImagesPrompt
- type GenerateImagesResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dalle ¶
Dalle allows access to all Dalle type endpoints
func (*Dalle) Do ¶
func (d *Dalle) Do(data constants.RequestData, i interface{}) *errors.HttpError
Do fires the request as needed
func (*Dalle) GenerateImages ¶
func (d *Dalle) GenerateImages(prompt string, n int, size string, userId string) (*GenerateImagesResponse, error)
GenerateImages generates images from a prompt
prompt: The prompt to generate images from n: The number of images to generate size: The size of the images to generate userId: The user id to generate the images for that specific user, openAI keeps a track of the images generated for each user
func (*Dalle) InitEditImages ¶
InitEditImages initialises the EditImagesRequest struct
type EditImageResponse ¶
type EditImageResponse struct { Created int `json:"created"` Data []struct { Url string `json:"url"` } `json:"data"` }
EditImageResponse is the response sent by the editImages endpoint
type EditImagesPrompt ¶
type EditImagesPrompt struct { Prompt string `json:"prompt"` N int `json:"n"` Size string `json:"size"` UserName string `json:"user"` }
EditImagesPrompt is the prompt for the editImages endpoint
type EditImagesRequest ¶
type EditImagesRequest struct { Image []byte `json:"image"` Mask []byte `json:"mask"` // contains filtered or unexported fields }
EditImagesRequest is the request for the editImages endpoint
func (*EditImagesRequest) AddImage ¶
func (e *EditImagesRequest) AddImage(image []byte) *EditImagesRequest
AddImage adds bytes to EditImagesRequest, this is used to add the image to the request
func (*EditImagesRequest) AddImageFromFileSystem ¶
func (e *EditImagesRequest) AddImageFromFileSystem(image *os.File) *EditImagesRequest
AddImageFromFileSystem adds an image to the EditImagesRequest
func (*EditImagesRequest) AddMask ¶
func (e *EditImagesRequest) AddMask(mask []byte) *EditImagesRequest
AddMask adds bytes to EditImagesRequest, this is used to add the mask to the request
func (*EditImagesRequest) AddMaskFromFileSystem ¶
func (e *EditImagesRequest) AddMaskFromFileSystem(mask *os.File) *EditImagesRequest
AddMaskFromFileSystem adds a mask to the EditImagesRequest
func (*EditImagesRequest) Do ¶
func (e *EditImagesRequest) Do() (*EditImageResponse, error)
Do fires the request, returns an EditImageResponse
type GenerateImagesPrompt ¶
type GenerateImagesPrompt struct { Prompt string `json:"prompt"` N int `json:"n"` Size string `json:"size"` UserName string `json:"user"` }
GenerateImagesPrompt is the prompt for the generateImages endpoint
type GenerateImagesResponse ¶
type GenerateImagesResponse struct { Created int `json:"created"` Data []struct { Url string `json:"url"` } `json:"data"` }
GenerateImagesRequest is the request for the generateImages endpoint