@@ -144,6 +144,9 @@ public class GoogleGenAiChatOptions implements ToolCallingChatOptions {
144
144
145
145
@ JsonIgnore
146
146
private List <GoogleGenAiSafetySetting > safetySettings = new ArrayList <>();
147
+
148
+ @ JsonIgnore
149
+ private Map <String , String > labels = new HashMap <>();
147
150
// @formatter:on
148
151
149
152
public static Builder builder () {
@@ -170,6 +173,7 @@ public static GoogleGenAiChatOptions fromOptions(GoogleGenAiChatOptions fromOpti
170
173
options .setInternalToolExecutionEnabled (fromOptions .getInternalToolExecutionEnabled ());
171
174
options .setToolContext (fromOptions .getToolContext ());
172
175
options .setThinkingBudget (fromOptions .getThinkingBudget ());
176
+ options .setLabels (fromOptions .getLabels ());
173
177
return options ;
174
178
}
175
179
@@ -332,6 +336,15 @@ public void setSafetySettings(List<GoogleGenAiSafetySetting> safetySettings) {
332
336
this .safetySettings = safetySettings ;
333
337
}
334
338
339
+ public Map <String , String > getLabels () {
340
+ return this .labels ;
341
+ }
342
+
343
+ public void setLabels (Map <String , String > labels ) {
344
+ Assert .notNull (labels , "labels must not be null" );
345
+ this .labels = labels ;
346
+ }
347
+
335
348
@ Override
336
349
public Map <String , Object > getToolContext () {
337
350
return this .toolContext ;
@@ -363,15 +376,15 @@ public boolean equals(Object o) {
363
376
&& Objects .equals (this .toolNames , that .toolNames )
364
377
&& Objects .equals (this .safetySettings , that .safetySettings )
365
378
&& Objects .equals (this .internalToolExecutionEnabled , that .internalToolExecutionEnabled )
366
- && Objects .equals (this .toolContext , that .toolContext );
379
+ && Objects .equals (this .toolContext , that .toolContext ) && Objects . equals ( this . labels , that . labels ) ;
367
380
}
368
381
369
382
@ Override
370
383
public int hashCode () {
371
384
return Objects .hash (this .stopSequences , this .temperature , this .topP , this .topK , this .candidateCount ,
372
385
this .frequencyPenalty , this .presencePenalty , this .thinkingBudget , this .maxOutputTokens , this .model ,
373
386
this .responseMimeType , this .toolCallbacks , this .toolNames , this .googleSearchRetrieval ,
374
- this .safetySettings , this .internalToolExecutionEnabled , this .toolContext );
387
+ this .safetySettings , this .internalToolExecutionEnabled , this .toolContext , this . labels );
375
388
}
376
389
377
390
@ Override
@@ -382,7 +395,8 @@ public String toString() {
382
395
+ ", candidateCount=" + this .candidateCount + ", maxOutputTokens=" + this .maxOutputTokens + ", model='"
383
396
+ this .model + '\'' + ", responseMimeType='" + this .responseMimeType + '\'' + ", toolCallbacks="
384
397
+ this .toolCallbacks + ", toolNames=" + this .toolNames + ", googleSearchRetrieval="
385
- + this .googleSearchRetrieval + ", safetySettings=" + this .safetySettings + '}' ;
398
+ + this .googleSearchRetrieval + ", safetySettings=" + this .safetySettings + ", labels=" + this .labels
399
+ + '}' ;
386
400
}
387
401
388
402
@ Override
@@ -510,6 +524,12 @@ public Builder thinkingBudget(Integer thinkingBudget) {
510
524
return this ;
511
525
}
512
526
527
+ public Builder labels (Map <String , String > labels ) {
528
+ Assert .notNull (labels , "labels must not be null" );
529
+ this .options .labels = labels ;
530
+ return this ;
531
+ }
532
+
513
533
public GoogleGenAiChatOptions build () {
514
534
return this .options ;
515
535
}
0 commit comments