Documentation ¶
Index ¶
- Constants
- type DALLESettings
- type OpenAIDALLE
- func (instance *OpenAIDALLE) Download(url string) (data []byte, err error)
- func (instance *OpenAIDALLE) Generate(prompt string, payload map[string]interface{}) (images []*model.ProducerItem, err error)
- func (instance *OpenAIDALLE) Get(url string) (response map[string]interface{}, err error)
- func (instance *OpenAIDALLE) Post(url string, body interface{}) (response map[string]interface{}, err error)
- func (instance *OpenAIDALLE) Upload(url string, filename string, params map[string]interface{}) (response map[string]interface{}, err error)
- func (instance *OpenAIDALLE) UploadData(url string, data []byte, params map[string]interface{}) (response map[string]interface{}, err error)
- func (instance *OpenAIDALLE) Variation(sourceBytes []byte, payload map[string]interface{}) (images []*model.ProducerItem, err error)
Constants ¶
View Source
const ( BaseApiUrl = "https://api.openai.com/v1/images" ApiImageGeneration = "/generations" ApiImageEdit = "/edits" ApiImageVariation = "/variations" )
View Source
const ( Size256 = "256x256" Size512 = "512x512" Size1024 = "1024x1024" )
256x256, 512x512, or 1024x1024
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DALLESettings ¶
type DALLESettings struct {
N int `json:"n"`
}
func (*DALLESettings) Load ¶
func (instance *DALLESettings) Load(m map[string]interface{}) (err error)
func (*DALLESettings) Map ¶
func (instance *DALLESettings) Map() (m map[string]interface{})
type OpenAIDALLE ¶
type OpenAIDALLE struct {
// contains filtered or unexported fields
}
func NewOpenAIDALLE ¶
func NewOpenAIDALLE(settings *commons.SettingsExternal) (instance *OpenAIDALLE, err error)
func (*OpenAIDALLE) Download ¶
func (instance *OpenAIDALLE) Download(url string) (data []byte, err error)
func (*OpenAIDALLE) Generate ¶
func (instance *OpenAIDALLE) Generate(prompt string, payload map[string]interface{}) (images []*model.ProducerItem, err error)
Generate send the prompt to chatGPT payload: optional map to override default parameters (
"n": 1, "size": "1024x1024")
func (*OpenAIDALLE) Get ¶
func (instance *OpenAIDALLE) Get(url string) (response map[string]interface{}, err error)
func (*OpenAIDALLE) Post ¶
func (instance *OpenAIDALLE) Post(url string, body interface{}) (response map[string]interface{}, err error)
func (*OpenAIDALLE) UploadData ¶
func (*OpenAIDALLE) Variation ¶
func (instance *OpenAIDALLE) Variation(sourceBytes []byte, payload map[string]interface{}) (images []*model.ProducerItem, err error)
Click to show internal directories.
Click to hide internal directories.