@@ -23,6 +23,8 @@ public record Multi2VecGoogleVectorizer(
2323 @ SerializedName ("imageFields" ) List <String > imageFields ,
2424 /** BLOB video properties included in the embedding. */
2525 @ SerializedName ("videoFields" ) List <String > videoFields ,
26+ /** BLOB audio properties included in the embedding. */
27+ @ SerializedName ("audioFields" ) List <String > audioFields ,
2628 /** TEXT properties included in the embedding. */
2729 @ SerializedName ("textFields" ) List <String > textFields ,
2830 /** Weights of the included properties. */
@@ -43,6 +45,11 @@ private static record Weights(
4345 * corresponding property names in {@code videoFields}.
4446 */
4547 @ SerializedName ("videoWeights" ) List <Float > videoWeights ,
48+ /**
49+ * Weights of the BLOB audio properties. Values appear in the same order as the
50+ * corresponding property names in {@code audioFields}.
51+ */
52+ @ SerializedName ("audioWeights" ) List <Float > audioWeights ,
4653 /**
4754 * Weights of the TEXT properties. Values appear in the same order as the
4855 * corresponding property names in {@code textFields}.
@@ -101,6 +108,7 @@ public Multi2VecGoogleVectorizer(
101108 Integer videoIntervalSeconds ,
102109 List <String > imageFields ,
103110 List <String > videoFields ,
111+ List <String > audioFields ,
104112 List <String > textFields ,
105113 Weights weights ,
106114 VectorIndex vectorIndex ,
@@ -114,6 +122,7 @@ public Multi2VecGoogleVectorizer(
114122 this .videoIntervalSeconds = videoIntervalSeconds ;
115123 this .imageFields = imageFields ;
116124 this .videoFields = videoFields ;
125+ this .audioFields = audioFields ;
117126 this .textFields = textFields ;
118127 this .weights = weights ;
119128 this .vectorIndex = vectorIndex ;
@@ -130,6 +139,7 @@ public Multi2VecGoogleVectorizer(Builder builder) {
130139 builder .videoIntervalSeconds ,
131140 builder .imageFields ,
132141 builder .videoFields ,
142+ builder .audioFields ,
133143 builder .textFields ,
134144 builder .getWeights (),
135145 builder .vectorIndex ,
@@ -143,7 +153,9 @@ public static class Builder implements ObjectBuilder<Multi2VecGoogleVectorizer>
143153 private List <String > imageFields ;
144154 private List <Float > imageWeights ;
145155 private List <String > videoFields ;
156+ private List <String > audioFields ;
146157 private List <Float > videoWeights ;
158+ private List <Float > audioWeights ;
147159 private List <String > textFields ;
148160 private List <Float > textWeights ;
149161
@@ -242,6 +254,35 @@ public Builder videoField(String field, float weight) {
242254 return this ;
243255 }
244256
257+ /** Add BLOB audio properties to include in the embedding. */
258+ public Builder audioFields (List <String > fields ) {
259+ this .audioFields = fields ;
260+ return this ;
261+ }
262+
263+ /** Add BLOB audio properties to include in the embedding. */
264+ public Builder audioFields (String ... fields ) {
265+ return audioFields (Arrays .asList (fields ));
266+ }
267+
268+ /**
269+ * Add BLOB audio property to include in the embedding.
270+ *
271+ * @param field Property name.
272+ * @param weight Custom weight between 0.0 and 1.0.
273+ */
274+ public Builder audioField (String field , float weight ) {
275+ if (this .audioFields == null ) {
276+ this .audioFields = new ArrayList <>();
277+ }
278+ if (this .audioWeights == null ) {
279+ this .audioWeights = new ArrayList <>();
280+ }
281+ this .audioFields .add (field );
282+ this .audioWeights .add (weight );
283+ return this ;
284+ }
285+
245286 /** Add TEXT properties to include in the embedding. */
246287 public Builder textFields (List <String > fields ) {
247288 this .textFields = fields ;
@@ -272,8 +313,9 @@ public Builder textField(String field, float weight) {
272313 }
273314
274315 protected Weights getWeights () {
275- if (this .textWeights != null || this .imageWeights != null || this .videoWeights != null ) {
276- return new Weights (this .imageWeights , this .videoWeights , this .textWeights );
316+ if (this .textWeights != null || this .imageWeights != null || this .videoWeights != null
317+ || this .audioWeights != null ) {
318+ return new Weights (this .imageWeights , this .videoWeights , this .audioWeights , this .textWeights );
277319 }
278320 return null ;
279321 }
0 commit comments