001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.juneau.bean.mcp.v20260728;
018
019import static org.apache.juneau.commons.utils.CollectionUtils.*;
020import static org.apache.juneau.commons.utils.Shorts.*;
021
022import java.util.*;
023
024import org.apache.juneau.marshall.*;
025
026/**
027 * Model-selection preferences for {@link CreateMessageRequest} (MCP sampling).
028 */
029@Marshalled
030public class ModelPreferences {
031
032   private List<ModelHint> hints;
033   private Double costPriority;
034   private Double speedPriority;
035   private Double intelligencePriority;
036
037   /**
038    * Ordered model-family/name hints, most-preferred first.
039    *
040    * @return The hints list, or {@code null} if not set.
041    */
042   public List<ModelHint> getHints() {
043      return u(hints);
044   }
045
046   /**
047    * Sets the hints.
048    *
049    * @param value The new value.  Can be <jk>null</jk> to unset the property.
050    * @return This object (for method chaining).
051    */
052   public ModelPreferences setHints(List<ModelHint> value) {
053      hints = value;
054      return this;
055   }
056
057   /**
058    * Sets the hints.
059    *
060    * @param value The new value.  Can be <jk>null</jk> to unset the property.
061    * @return This object (for method chaining).
062    */
063   public ModelPreferences setHints(ModelHint...value) {
064      hints = list(value);
065      return this;
066   }
067
068   /**
069    * Appends to the hints.
070    *
071    * @param value The values to append.
072    * @return This object (for method chaining).
073    */
074   public ModelPreferences addHints(ModelHint...value) {
075      if (hints == null)
076         hints = list();
077      Collections.addAll(hints, value);
078      return this;
079   }
080
081   /**
082    * Appends to the hints.
083    *
084    * @param value The values to append.
085    * @return This object (for method chaining).
086    */
087   public ModelPreferences addHints(Collection<ModelHint> value) {
088      if (hints == null)
089         hints = list();
090      hints.addAll(value);
091      return this;
092   }
093
094   /**
095    * Relative priority (0.0-1.0) placed on minimizing cost.
096    *
097    * @return The priority, or {@code null} if not set.
098    */
099   public Double getCostPriority() {
100      return costPriority;
101   }
102
103   /**
104    * Sets the cost priority.
105    *
106    * @param value The new value, {@code 0.0}-{@code 1.0}.  Can be <jk>null</jk> to unset the property.
107    * @return This object (for method chaining).
108    */
109   public ModelPreferences setCostPriority(Double value) {
110      costPriority = value;
111      return this;
112   }
113
114   /**
115    * Relative priority (0.0-1.0) placed on minimizing latency.
116    *
117    * @return The priority, or {@code null} if not set.
118    */
119   public Double getSpeedPriority() {
120      return speedPriority;
121   }
122
123   /**
124    * Sets the speed priority.
125    *
126    * @param value The new value, {@code 0.0}-{@code 1.0}.  Can be <jk>null</jk> to unset the property.
127    * @return This object (for method chaining).
128    */
129   public ModelPreferences setSpeedPriority(Double value) {
130      speedPriority = value;
131      return this;
132   }
133
134   /**
135    * Relative priority (0.0-1.0) placed on maximizing capability.
136    *
137    * @return The priority, or {@code null} if not set.
138    */
139   public Double getIntelligencePriority() {
140      return intelligencePriority;
141   }
142
143   /**
144    * Sets the intelligence priority.
145    *
146    * @param value The new value, {@code 0.0}-{@code 1.0}.  Can be <jk>null</jk> to unset the property.
147    * @return This object (for method chaining).
148    */
149   public ModelPreferences setIntelligencePriority(Double value) {
150      intelligencePriority = value;
151      return this;
152   }
153}