dto.go 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. package gemini
  2. // VeoImageInput represents an image input for Veo image-to-video.
  3. // Used by both Gemini and Vertex adaptors.
  4. type VeoImageInput struct {
  5. BytesBase64Encoded string `json:"bytesBase64Encoded"`
  6. MimeType string `json:"mimeType"`
  7. }
  8. // VeoInstance represents a single instance in the Veo predictLongRunning request.
  9. type VeoInstance struct {
  10. Prompt string `json:"prompt"`
  11. Image *VeoImageInput `json:"image,omitempty"`
  12. // TODO: support referenceImages (style/asset references, up to 3 images)
  13. // TODO: support lastFrame (first+last frame interpolation, Veo 3.1)
  14. }
  15. // VeoParameters represents the parameters block for Veo predictLongRunning.
  16. type VeoParameters struct {
  17. SampleCount int `json:"sampleCount"`
  18. DurationSeconds int `json:"durationSeconds,omitempty"`
  19. AspectRatio string `json:"aspectRatio,omitempty"`
  20. Resolution string `json:"resolution,omitempty"`
  21. NegativePrompt string `json:"negativePrompt,omitempty"`
  22. PersonGeneration string `json:"personGeneration,omitempty"`
  23. StorageUri string `json:"storageUri,omitempty"`
  24. CompressionQuality string `json:"compressionQuality,omitempty"`
  25. ResizeMode string `json:"resizeMode,omitempty"`
  26. Seed *int `json:"seed,omitempty"`
  27. GenerateAudio *bool `json:"generateAudio,omitempty"`
  28. }
  29. // VeoRequestPayload is the top-level request body for the Veo
  30. // predictLongRunning endpoint (used by both Gemini and Vertex).
  31. type VeoRequestPayload struct {
  32. Instances []VeoInstance `json:"instances"`
  33. Parameters *VeoParameters `json:"parameters,omitempty"`
  34. }
  35. type submitResponse struct {
  36. Name string `json:"name"`
  37. }
  38. type operationVideo struct {
  39. MimeType string `json:"mimeType"`
  40. BytesBase64Encoded string `json:"bytesBase64Encoded"`
  41. Encoding string `json:"encoding"`
  42. }
  43. type operationResponse struct {
  44. Name string `json:"name"`
  45. Done bool `json:"done"`
  46. Response struct {
  47. Type string `json:"@type"`
  48. RaiMediaFilteredCount int `json:"raiMediaFilteredCount"`
  49. Videos []operationVideo `json:"videos"`
  50. BytesBase64Encoded string `json:"bytesBase64Encoded"`
  51. Encoding string `json:"encoding"`
  52. Video string `json:"video"`
  53. GenerateVideoResponse struct {
  54. GeneratedVideos []struct {
  55. Video struct {
  56. URI string `json:"uri"`
  57. } `json:"video"`
  58. } `json:"generatedVideos"`
  59. } `json:"generateVideoResponse"`
  60. } `json:"response"`
  61. Error struct {
  62. Message string `json:"message"`
  63. } `json:"error"`
  64. }