This commit is contained in:
2025-08-27 19:58:27 +08:00
parent feb3641eae
commit 4fc73801ee

View File

@@ -0,0 +1,57 @@
package com.agentsflex.core.llm.embedding;
import com.agentsflex.core.util.StringUtil;
public class EmbeddingOptions {
public static final EmbeddingOptions DEFAULT = new EmbeddingOptions() {
@Override
public void setModel(String model) {
throw new IllegalStateException("Can not set modal to the default instance.");
}
@Override
public void setEncodingFormat(String encodingFormat) {
throw new IllegalStateException("Can not set modal to the default instance.");
}
};
/**
* 嵌入模型
*/
private String model;
/**
* 嵌入编码格式可用通常为float, base64
*/
private String encodingFormat;
public String getModel() {
return model;
}
public String getModelOrDefault(String defaultModel) {
return StringUtil.noText(model) ? defaultModel : model;
}
public void setModel(String model) {
this.model = model;
}
public String getEncodingFormat() {
return encodingFormat;
}
public void setEncodingFormat(String encodingFormat) {
this.encodingFormat = encodingFormat;
}
@Override
public String toString() {
return "EmbeddingOptions{" +
"model='" + model + '\'' +
", encodingFormat='" + encodingFormat + '\'' +
'}';
}
}