001/*
002 *  Copyright (c) 2023-2026, Agents-Flex (fuhai999@gmail.com).
003 *  <p>
004 *  Licensed under the Apache License, Version 2.0 (the "License");
005 *  you may not use this file except in compliance with the License.
006 *  You may obtain a copy of the License at
007 *  <p>
008 *  http://www.apache.org/licenses/LICENSE-2.0
009 *  <p>
010 *  Unless required by applicable law or agreed to in writing, software
011 *  distributed under the License is distributed on an "AS IS" BASIS,
012 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *  See the License for the specific language governing permissions and
014 *  limitations under the License.
015 */
016package com.agentsflex.core.model.rerank;
017
018import com.agentsflex.core.util.StringUtil;
019
020public class RerankOptions {
021    public static final RerankOptions DEFAULT = new RerankOptions() {
022        @Override
023        public void setModel(String model) {
024            throw new IllegalStateException("Can not set modal to the default instance.");
025        }
026    };
027
028    /**
029     * 重排模型模型
030     */
031    private String model;
032
033
034
035    public String getModel() {
036        return model;
037    }
038
039    public String getModelOrDefault(String defaultModel) {
040        return StringUtil.noText(model) ? defaultModel : model;
041    }
042
043    public void setModel(String model) {
044        this.model = model;
045    }
046
047
048    @Override
049    public String toString() {
050        return "RerankOptions{" +
051            "model='" + model + '\'' +
052            '}';
053    }
054}