dalle.go 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. package dto
  2. import "encoding/json"
  3. type ImageRequest struct {
  4. Model string `json:"model"`
  5. Prompt string `json:"prompt" binding:"required"`
  6. N int `json:"n,omitempty"`
  7. Size string `json:"size,omitempty"`
  8. Quality string `json:"quality,omitempty"`
  9. ResponseFormat string `json:"response_format,omitempty"`
  10. Style json.RawMessage `json:"style,omitempty"`
  11. User json.RawMessage `json:"user,omitempty"`
  12. ExtraFields json.RawMessage `json:"extra_fields,omitempty"`
  13. Background json.RawMessage `json:"background,omitempty"`
  14. Moderation json.RawMessage `json:"moderation,omitempty"`
  15. OutputFormat json.RawMessage `json:"output_format,omitempty"`
  16. OutputCompression json.RawMessage `json:"output_compression,omitempty"`
  17. PartialImages json.RawMessage `json:"partial_images,omitempty"`
  18. // Stream bool `json:"stream,omitempty"`
  19. Watermark *bool `json:"watermark,omitempty"`
  20. }
  21. type ImageResponse struct {
  22. Data []ImageData `json:"data"`
  23. Created int64 `json:"created"`
  24. }
  25. type ImageData struct {
  26. Url string `json:"url"`
  27. B64Json string `json:"b64_json"`
  28. RevisedPrompt string `json:"revised_prompt"`
  29. }