()
| 119 | var JSONSchema string |
| 120 | |
| 121 | func (s *Spec) SetDefaults() { |
| 122 | if s.TimePartitioning == "" { |
| 123 | s.TimePartitioning = TimePartitioningOptionNone |
| 124 | } |
| 125 | if s.BatchSize == 0 { |
| 126 | s.BatchSize = batchSize |
| 127 | } |
| 128 | if s.BatchSizeBytes == 0 { |
| 129 | s.BatchSizeBytes = batchSizeBytes |
| 130 | } |
| 131 | if s.BatchTimeout.Duration() <= 0 { |
| 132 | s.BatchTimeout = configtype.NewDuration(10 * time.Second) |
| 133 | } |
| 134 | if s.ClientProjectID == "" { |
| 135 | s.ClientProjectID = s.ProjectID |
| 136 | } |
| 137 | if s.TextEmbeddings != nil { |
| 138 | s.TextEmbeddings.SetDefaults() |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | func (s *Spec) Validate() error { |
| 143 | if s.ProjectID == "" { |
no outgoing calls