@@ -144,6 +144,9 @@ public class GoogleGenAiChatOptions implements ToolCallingChatOptions {
144144
145145 @ JsonIgnore
146146 private List <GoogleGenAiSafetySetting > safetySettings = new ArrayList <>();
147+
148+ @ JsonIgnore
149+ private Map <String , String > labels = new HashMap <>();
147150 // @formatter:on
148151
149152 public static Builder builder () {
@@ -170,6 +173,7 @@ public static GoogleGenAiChatOptions fromOptions(GoogleGenAiChatOptions fromOpti
170173 options .setInternalToolExecutionEnabled (fromOptions .getInternalToolExecutionEnabled ());
171174 options .setToolContext (fromOptions .getToolContext ());
172175 options .setThinkingBudget (fromOptions .getThinkingBudget ());
176+ options .setLabels (fromOptions .getLabels ());
173177 return options ;
174178 }
175179
@@ -332,6 +336,15 @@ public void setSafetySettings(List<GoogleGenAiSafetySetting> safetySettings) {
332336 this .safetySettings = safetySettings ;
333337 }
334338
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+
335348 @ Override
336349 public Map <String , Object > getToolContext () {
337350 return this .toolContext ;
@@ -363,15 +376,15 @@ public boolean equals(Object o) {
363376 && Objects .equals (this .toolNames , that .toolNames )
364377 && Objects .equals (this .safetySettings , that .safetySettings )
365378 && 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 ) ;
367380 }
368381
369382 @ Override
370383 public int hashCode () {
371384 return Objects .hash (this .stopSequences , this .temperature , this .topP , this .topK , this .candidateCount ,
372385 this .frequencyPenalty , this .presencePenalty , this .thinkingBudget , this .maxOutputTokens , this .model ,
373386 this .responseMimeType , this .toolCallbacks , this .toolNames , this .googleSearchRetrieval ,
374- this .safetySettings , this .internalToolExecutionEnabled , this .toolContext );
387+ this .safetySettings , this .internalToolExecutionEnabled , this .toolContext , this . labels );
375388 }
376389
377390 @ Override
@@ -382,7 +395,8 @@ public String toString() {
382395 + ", candidateCount=" + this .candidateCount + ", maxOutputTokens=" + this .maxOutputTokens + ", model='"
383396 + this .model + '\'' + ", responseMimeType='" + this .responseMimeType + '\'' + ", toolCallbacks="
384397 + this .toolCallbacks + ", toolNames=" + this .toolNames + ", googleSearchRetrieval="
385- + this .googleSearchRetrieval + ", safetySettings=" + this .safetySettings + '}' ;
398+ + this .googleSearchRetrieval + ", safetySettings=" + this .safetySettings + ", labels=" + this .labels
399+ + '}' ;
386400 }
387401
388402 @ Override
@@ -510,6 +524,12 @@ public Builder thinkingBudget(Integer thinkingBudget) {
510524 return this ;
511525 }
512526
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+
513533 public GoogleGenAiChatOptions build () {
514534 return this .options ;
515535 }
0 commit comments