mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix comment
This commit is contained in:
@@ -40,6 +40,9 @@ import java.util.function.Consumer;
|
||||
*/
|
||||
public class BaseAIService {
|
||||
|
||||
/**
|
||||
* AI配置
|
||||
*/
|
||||
protected final AIConfig config;
|
||||
|
||||
/**
|
||||
@@ -122,11 +125,11 @@ public class BaseAIService {
|
||||
* @param paramMap 请求参数
|
||||
* @param callback 流式数据回调函数
|
||||
*/
|
||||
protected void sendPostStream(final String endpoint, final Map<String, Object> paramMap, Consumer<String> callback) {
|
||||
protected void sendPostStream(final String endpoint, final Map<String, Object> paramMap, final Consumer<String> callback) {
|
||||
HttpURLConnection connection = null;
|
||||
try {
|
||||
// 创建连接
|
||||
URL apiUrl = new URL(config.getApiUrl() + endpoint);
|
||||
final URL apiUrl = new URL(config.getApiUrl() + endpoint);
|
||||
connection = (HttpURLConnection) apiUrl.openConnection();
|
||||
connection.setRequestMethod(Method.POST.name());
|
||||
connection.setRequestProperty(HeaderName.CONTENT_TYPE.getValue(), "application/json");
|
||||
@@ -137,21 +140,21 @@ public class BaseAIService {
|
||||
//设置连接超时
|
||||
connection.setConnectTimeout(config.getTimeout());
|
||||
// 发送请求体
|
||||
try (OutputStream os = connection.getOutputStream()) {
|
||||
String jsonInputString = JSONUtil.toJsonStr(paramMap);
|
||||
try (final OutputStream os = connection.getOutputStream()) {
|
||||
final String jsonInputString = JSONUtil.toJsonStr(paramMap);
|
||||
os.write(jsonInputString.getBytes());
|
||||
os.flush();
|
||||
}
|
||||
|
||||
// 读取流式响应
|
||||
try (BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
|
||||
try (final BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
// 调用回调函数处理每一行数据
|
||||
callback.accept(line);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (final Exception e) {
|
||||
callback.accept("{\"error\": \"" + e.getMessage() + "\"}");
|
||||
} finally {
|
||||
// 关闭连接
|
||||
|
@@ -27,17 +27,29 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
*/
|
||||
public class BaseConfig implements AIConfig {
|
||||
|
||||
//apiKey
|
||||
/**
|
||||
* API Key
|
||||
*/
|
||||
protected volatile String apiKey;
|
||||
//API请求地址
|
||||
/**
|
||||
* API请求地址
|
||||
*/
|
||||
protected volatile String apiUrl;
|
||||
//具体模型
|
||||
/**
|
||||
* 模型名称
|
||||
*/
|
||||
protected volatile String model;
|
||||
//动态扩展字段
|
||||
/**
|
||||
* 额外的配置
|
||||
*/
|
||||
protected final Map<String, Object> additionalConfig = new ConcurrentHashMap<>();
|
||||
//连接超时时间
|
||||
/**
|
||||
* 请求超时
|
||||
*/
|
||||
protected volatile int timeout = 180000;
|
||||
//读取超时时间
|
||||
/**
|
||||
* 读取超时
|
||||
*/
|
||||
protected volatile int readTimeout = 300000;
|
||||
|
||||
@Override
|
||||
|
@@ -27,20 +27,37 @@ import cn.hutool.v7.ai.core.BaseConfig;
|
||||
*/
|
||||
public class DeepSeekConfig extends BaseConfig {
|
||||
|
||||
private final String API_URL = "https://api.deepseek.com";
|
||||
/**
|
||||
* 定义API的基础URL,用于后续的所有API请求
|
||||
*/
|
||||
public final String API_URL = "https://api.deepseek.com";
|
||||
|
||||
private final String DEFAULT_MODEL = Models.DeepSeek.DEEPSEEK_CHAT.getModel();
|
||||
/**
|
||||
* 定义默认的模型名称,用于在没有指定模型时使用
|
||||
*/
|
||||
public final String DEFAULT_MODEL = Models.DeepSeek.DEEPSEEK_CHAT.getModel();
|
||||
|
||||
/**
|
||||
* 默认构造函数,用于初始化DeepSeek配置对象
|
||||
* 设置API的基础URL和默认的模型名称
|
||||
*/
|
||||
public DeepSeekConfig() {
|
||||
setApiUrl(API_URL);
|
||||
setModel(DEFAULT_MODEL);
|
||||
}
|
||||
|
||||
public DeepSeekConfig(String apiKey) {
|
||||
this();
|
||||
/**
|
||||
* 带API密钥参数的构造函数
|
||||
* 用于初始化DeepSeek配置对象,并设置API密钥
|
||||
*
|
||||
* @param apiKey 用户的API密钥,用于认证和授权
|
||||
*/
|
||||
public DeepSeekConfig(final String apiKey) {
|
||||
this(); // 调用默认构造函数初始化API_URL和DEFAULT_MODEL
|
||||
setApiKey(apiKey);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getModelName() {
|
||||
return "deepSeek";
|
||||
|
@@ -24,70 +24,139 @@ package cn.hutool.v7.ai.model.doubao;
|
||||
*/
|
||||
public class DoubaoCommon {
|
||||
|
||||
//doubao上下文缓存参数
|
||||
/**
|
||||
* doubao上下文缓存参数
|
||||
*/
|
||||
public enum DoubaoContext {
|
||||
|
||||
/**
|
||||
* session
|
||||
*/
|
||||
SESSION("session"),
|
||||
/**
|
||||
* common_prefix
|
||||
*/
|
||||
COMMON_PREFIX("common_prefix");
|
||||
|
||||
private final String mode;
|
||||
|
||||
DoubaoContext(String mode) {
|
||||
DoubaoContext(final String mode) {
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取参数
|
||||
*
|
||||
* @return 参数
|
||||
*/
|
||||
public String getMode() {
|
||||
return mode;
|
||||
}
|
||||
}
|
||||
|
||||
//doubao视觉参数
|
||||
/**
|
||||
* doubao视觉参数
|
||||
*/
|
||||
public enum DoubaoVision {
|
||||
|
||||
/**
|
||||
* 自动
|
||||
*/
|
||||
AUTO("auto"),
|
||||
/**
|
||||
* 低
|
||||
*/
|
||||
LOW("low"),
|
||||
/**
|
||||
* 高
|
||||
*/
|
||||
HIGH("high");
|
||||
|
||||
private final String detail;
|
||||
|
||||
DoubaoVision(String detail) {
|
||||
DoubaoVision(final String detail) {
|
||||
this.detail = detail;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取参数
|
||||
*
|
||||
* @return 参数
|
||||
*/
|
||||
public String getDetail() {
|
||||
return detail;
|
||||
}
|
||||
}
|
||||
|
||||
//doubao视频生成参数
|
||||
/**
|
||||
* doubao视频生成参数
|
||||
*/
|
||||
public enum DoubaoVideo {
|
||||
|
||||
//宽高比例
|
||||
/**
|
||||
* 视频比例16:9,适用于横向宽屏显示,常用作标准视频比例
|
||||
*/
|
||||
RATIO_16_9("--rt", "16:9"),//[1280, 720]
|
||||
|
||||
/**
|
||||
* 视频比例4:3,传统电视屏幕比例,适用于标准清晰度的视频内容
|
||||
*/
|
||||
RATIO_4_3("--rt", "4:3"),//[960, 720]
|
||||
|
||||
/**
|
||||
* 视频比例1:1,正方形画面,适用于社交媒体平台上的短视频内容
|
||||
*/
|
||||
RATIO_1_1("--rt", "1:1"),//[720, 720]
|
||||
|
||||
/**
|
||||
* 视频比例3:4,竖向视频比例,适用于手机端的视频播放场景
|
||||
*/
|
||||
RATIO_3_4("--rt", "3:4"),//[720, 960]
|
||||
|
||||
/**
|
||||
* 视频比例9:16,常见的竖屏视频比例,广泛用于短视频应用
|
||||
*/
|
||||
RATIO_9_16("--rt", "9:16"),//[720, 1280]
|
||||
|
||||
/**
|
||||
* 视频比例21:9,超宽屏幕比例,提供更广阔的视野,适合电影和游戏体验
|
||||
*/
|
||||
RATIO_21_9("--rt", "21:9"),//[1280, 544]
|
||||
|
||||
//生成视频时长
|
||||
DURATION_5("--dur", 5),//文生视频,图生视频
|
||||
DURATION_10("--dur", 10),//文生视频
|
||||
/**
|
||||
* 文生视频,图生视频
|
||||
*/
|
||||
DURATION_5("--dur", 5),
|
||||
/**
|
||||
* 文生视频
|
||||
*/
|
||||
DURATION_10("--dur", 10),
|
||||
|
||||
//帧率,即一秒时间内视频画面数量
|
||||
/**
|
||||
* 帧率,即一秒时间内视频画面数量
|
||||
*/
|
||||
FPS_5("--fps", 24),
|
||||
|
||||
//视频分辨率
|
||||
/**
|
||||
* 视频分辨率
|
||||
*/
|
||||
RESOLUTION_5("--rs", "720p"),
|
||||
|
||||
//生成视频是否包含水印
|
||||
/**
|
||||
* 生成视频包含水印
|
||||
*/
|
||||
WATERMARK_TRUE("--wm", true),
|
||||
/**
|
||||
* 生成视频不包含水印
|
||||
*/
|
||||
WATERMARK_FALSE("--wm", false);
|
||||
|
||||
private final String type;
|
||||
private final Object value;
|
||||
|
||||
DoubaoVideo(String type, Object value) {
|
||||
DoubaoVideo(final String type, final Object value) {
|
||||
this.type = type;
|
||||
this.value = value;
|
||||
}
|
||||
|
@@ -27,20 +27,33 @@ import cn.hutool.v7.ai.core.BaseConfig;
|
||||
*/
|
||||
public class DoubaoConfig extends BaseConfig {
|
||||
|
||||
private final String API_URL = "https://ark.cn-beijing.volces.com/api/v3";
|
||||
// 定义API的基础URL,用于和服务器通信
|
||||
private static final String API_URL = "https://ark.cn-beijing.volces.com/api/v3";
|
||||
|
||||
private final String DEFAULT_MODEL = Models.Doubao.DOUBAO_1_5_LITE_32K.getModel();
|
||||
// 定义默认的模型配置,用于初始化配置对象时设定
|
||||
private static final String DEFAULT_MODEL = Models.Doubao.DOUBAO_1_5_LITE_32K.getModel();
|
||||
|
||||
/**
|
||||
* 无参构造函数,用于创建DoubaoConfig对象
|
||||
* 初始化时会设置API_URL和DEFAULT_MODEL
|
||||
*/
|
||||
public DoubaoConfig() {
|
||||
setApiUrl(API_URL);
|
||||
setModel(DEFAULT_MODEL);
|
||||
}
|
||||
|
||||
public DoubaoConfig(String apiKey) {
|
||||
this();
|
||||
setApiKey(apiKey);
|
||||
/**
|
||||
* 带有apiKey参数的构造函数,用于创建DoubaoConfig对象并设置API密钥
|
||||
* 初始化时会设置API_URL、DEFAULT_MODEL以及传入的apiKey
|
||||
*
|
||||
* @param apiKey 用户的API密钥,用于验证用户身份
|
||||
*/
|
||||
public DoubaoConfig(final String apiKey) {
|
||||
this(); // 先调用无参构造函数初始化API_URL和DEFAULT_MODEL
|
||||
setApiKey(apiKey); // 设置用户的API密钥
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getModelName() {
|
||||
return "doubao";
|
||||
|
@@ -39,25 +39,25 @@ import java.util.function.Consumer;
|
||||
public class DoubaoServiceImpl extends BaseAIService implements DoubaoService {
|
||||
|
||||
//对话
|
||||
private final String CHAT_ENDPOINT = "/chat/completions";
|
||||
private static final String CHAT_ENDPOINT = "/chat/completions";
|
||||
//文本向量化
|
||||
private final String EMBEDDING_TEXT = "/embeddings";
|
||||
private static final String EMBEDDING_TEXT = "/embeddings";
|
||||
//图文向量化
|
||||
private final String EMBEDDING_VISION = "/embeddings/multimodal";
|
||||
private static final String EMBEDDING_VISION = "/embeddings/multimodal";
|
||||
//应用bots
|
||||
private final String BOTS_CHAT = "/bots/chat/completions";
|
||||
private static final String BOTS_CHAT = "/bots/chat/completions";
|
||||
//分词
|
||||
private final String TOKENIZATION = "/tokenization";
|
||||
private static final String TOKENIZATION = "/tokenization";
|
||||
//批量推理chat
|
||||
private final String BATCH_CHAT = "/batch/chat/completions";
|
||||
private static final String BATCH_CHAT = "/batch/chat/completions";
|
||||
//创建上下文缓存
|
||||
private final String CREATE_CONTEXT = "/context/create";
|
||||
private static final String CREATE_CONTEXT = "/context/create";
|
||||
//上下文缓存对话
|
||||
private final String CHAT_CONTEXT = "/context/chat/completions";
|
||||
private static final String CHAT_CONTEXT = "/context/chat/completions";
|
||||
//创建视频生成任务
|
||||
private final String CREATE_VIDEO = "/contents/generations/tasks";
|
||||
private static final String CREATE_VIDEO = "/contents/generations/tasks";
|
||||
//文生图
|
||||
private final String IMAGES_GENERATIONS = "/images/generations";
|
||||
private static final String IMAGES_GENERATIONS = "/images/generations";
|
||||
|
||||
public DoubaoServiceImpl(final AIConfig config) {
|
||||
//初始化doubao客户端
|
||||
@@ -66,109 +66,109 @@ public class DoubaoServiceImpl extends BaseAIService implements DoubaoService {
|
||||
|
||||
@Override
|
||||
public String chat(final List<Message> messages) {
|
||||
String paramJson = buildChatRequestBody(messages);
|
||||
Response response = sendPost(CHAT_ENDPOINT, paramJson);
|
||||
final String paramJson = buildChatRequestBody(messages);
|
||||
final Response response = sendPost(CHAT_ENDPOINT, paramJson);
|
||||
return response.bodyStr();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void chat(List<Message> messages, Consumer<String> callback) {
|
||||
Map<String, Object> paramMap = buildChatStreamRequestBody(messages);
|
||||
public void chat(final List<Message> messages, final Consumer<String> callback) {
|
||||
final Map<String, Object> paramMap = buildChatStreamRequestBody(messages);
|
||||
ThreadUtil.newThread(() -> sendPostStream(CHAT_ENDPOINT, paramMap, callback::accept), "doubao-chat-sse").start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String chatVision(String prompt, final List<String> images, String detail) {
|
||||
String paramJson = buildChatVisionRequestBody(prompt, images, detail);
|
||||
Response response = sendPost(CHAT_ENDPOINT, paramJson);
|
||||
public String chatVision(final String prompt, final List<String> images, final String detail) {
|
||||
final String paramJson = buildChatVisionRequestBody(prompt, images, detail);
|
||||
final Response response = sendPost(CHAT_ENDPOINT, paramJson);
|
||||
return response.bodyStr();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void chatVision(String prompt, List<String> images, String detail, Consumer<String> callback) {
|
||||
Map<String, Object> paramMap = buildChatVisionStreamRequestBody(prompt, images, detail);
|
||||
public void chatVision(final String prompt, final List<String> images, final String detail, final Consumer<String> callback) {
|
||||
final Map<String, Object> paramMap = buildChatVisionStreamRequestBody(prompt, images, detail);
|
||||
ThreadUtil.newThread(() -> sendPostStream(CHAT_ENDPOINT, paramMap, callback::accept), "doubao-chatVision-sse").start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String videoTasks(String text, String image, final List<DoubaoCommon.DoubaoVideo> videoParams) {
|
||||
String paramJson = buildGenerationsTasksRequestBody(text, image, videoParams);
|
||||
Response response = sendPost(CREATE_VIDEO, paramJson);
|
||||
public String videoTasks(final String text, final String image, final List<DoubaoCommon.DoubaoVideo> videoParams) {
|
||||
final String paramJson = buildGenerationsTasksRequestBody(text, image, videoParams);
|
||||
final Response response = sendPost(CREATE_VIDEO, paramJson);
|
||||
return response.bodyStr();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVideoTasksInfo(String taskId) {
|
||||
Response response = sendGet(CREATE_VIDEO + "/" + taskId);
|
||||
public String getVideoTasksInfo(final String taskId) {
|
||||
final Response response = sendGet(CREATE_VIDEO + "/" + taskId);
|
||||
return response.bodyStr();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String embeddingText(String[] input) {
|
||||
String paramJson = buildEmbeddingTextRequestBody(input);
|
||||
Response response = sendPost(EMBEDDING_TEXT, paramJson);
|
||||
public String embeddingText(final String[] input) {
|
||||
final String paramJson = buildEmbeddingTextRequestBody(input);
|
||||
final Response response = sendPost(EMBEDDING_TEXT, paramJson);
|
||||
return response.bodyStr();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String embeddingVision(String text, String image) {
|
||||
String paramJson = buildEmbeddingVisionRequestBody(text, image);
|
||||
Response response = sendPost(EMBEDDING_VISION, paramJson);
|
||||
public String embeddingVision(final String text, final String image) {
|
||||
final String paramJson = buildEmbeddingVisionRequestBody(text, image);
|
||||
final Response response = sendPost(EMBEDDING_VISION, paramJson);
|
||||
return response.bodyStr();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String botsChat(final List<Message> messages) {
|
||||
String paramJson = buildBotsChatRequestBody(messages);
|
||||
Response response = sendPost(BOTS_CHAT, paramJson);
|
||||
final String paramJson = buildBotsChatRequestBody(messages);
|
||||
final Response response = sendPost(BOTS_CHAT, paramJson);
|
||||
return response.bodyStr();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void botsChat(List<Message> messages, Consumer<String> callback) {
|
||||
Map<String, Object> paramMap = buildBotsChatStreamRequestBody(messages);
|
||||
public void botsChat(final List<Message> messages, final Consumer<String> callback) {
|
||||
final Map<String, Object> paramMap = buildBotsChatStreamRequestBody(messages);
|
||||
ThreadUtil.newThread(() -> sendPostStream(BOTS_CHAT, paramMap, callback::accept), "doubao-botsChat-sse").start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String tokenization(String[] text) {
|
||||
String paramJson = buildTokenizationRequestBody(text);
|
||||
Response response = sendPost(TOKENIZATION, paramJson);
|
||||
public String tokenization(final String[] text) {
|
||||
final String paramJson = buildTokenizationRequestBody(text);
|
||||
final Response response = sendPost(TOKENIZATION, paramJson);
|
||||
return response.bodyStr();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String batchChat(final List<Message> messages) {
|
||||
String paramJson = buildBatchChatRequestBody(messages);
|
||||
Response response = sendPost(BATCH_CHAT, paramJson);
|
||||
final String paramJson = buildBatchChatRequestBody(messages);
|
||||
final Response response = sendPost(BATCH_CHAT, paramJson);
|
||||
return response.bodyStr();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createContext(final List<Message> messages, String mode) {
|
||||
String paramJson = buildCreateContextRequest(messages, mode);
|
||||
Response response = sendPost(CREATE_CONTEXT, paramJson);
|
||||
public String createContext(final List<Message> messages, final String mode) {
|
||||
final String paramJson = buildCreateContextRequest(messages, mode);
|
||||
final Response response = sendPost(CREATE_CONTEXT, paramJson);
|
||||
return response.bodyStr();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String chatContext(final List<Message> messages, String contextId) {
|
||||
String paramJson = buildChatContentRequestBody(messages, contextId);
|
||||
Response response = sendPost(CHAT_CONTEXT, paramJson);
|
||||
public String chatContext(final List<Message> messages, final String contextId) {
|
||||
final String paramJson = buildChatContentRequestBody(messages, contextId);
|
||||
final Response response = sendPost(CHAT_CONTEXT, paramJson);
|
||||
return response.bodyStr();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void chatContext(List<Message> messages, String contextId, Consumer<String> callback) {
|
||||
Map<String, Object> paramMap = buildChatContentStreamRequestBody(messages, contextId);
|
||||
public void chatContext(final List<Message> messages, final String contextId, final Consumer<String> callback) {
|
||||
final Map<String, Object> paramMap = buildChatContentStreamRequestBody(messages, contextId);
|
||||
ThreadUtil.newThread(() -> sendPostStream(CHAT_CONTEXT, paramMap, callback::accept), "doubao-chatContext-sse").start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String imagesGenerations(String prompt) {
|
||||
String paramJson = buildImagesGenerationsRequestBody(prompt);
|
||||
Response response = sendPost(IMAGES_GENERATIONS, paramJson);
|
||||
public String imagesGenerations(final String prompt) {
|
||||
final String paramJson = buildImagesGenerationsRequestBody(prompt);
|
||||
final Response response = sendPost(IMAGES_GENERATIONS, paramJson);
|
||||
return response.bodyStr();
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ public class DoubaoServiceImpl extends BaseAIService implements DoubaoService {
|
||||
}
|
||||
|
||||
//构建chatVision请求体
|
||||
private String buildChatVisionRequestBody(String prompt, final List<String> images, String detail) {
|
||||
private String buildChatVisionRequestBody(final String prompt, final List<String> images, final String detail) {
|
||||
// 定义消息结构
|
||||
final List<Message> messages = new ArrayList<>();
|
||||
final List<Object> content = new ArrayList<>();
|
||||
@@ -207,10 +207,10 @@ public class DoubaoServiceImpl extends BaseAIService implements DoubaoService {
|
||||
contentMap.put("type", "text");
|
||||
contentMap.put("text", prompt);
|
||||
content.add(contentMap);
|
||||
for (String img : images) {
|
||||
HashMap<String, Object> imgUrlMap = new HashMap<>();
|
||||
for (final String img : images) {
|
||||
final HashMap<String, Object> imgUrlMap = new HashMap<>();
|
||||
imgUrlMap.put("type", "image_url");
|
||||
HashMap<String, String> urlMap = new HashMap<>();
|
||||
final HashMap<String, String> urlMap = new HashMap<>();
|
||||
urlMap.put("url", img);
|
||||
urlMap.put("detail", detail);
|
||||
imgUrlMap.put("image_url", urlMap);
|
||||
@@ -228,7 +228,7 @@ public class DoubaoServiceImpl extends BaseAIService implements DoubaoService {
|
||||
return JSONUtil.toJsonStr(paramMap);
|
||||
}
|
||||
|
||||
private Map<String, Object> buildChatVisionStreamRequestBody(String prompt, final List<String> images, String detail) {
|
||||
private Map<String, Object> buildChatVisionStreamRequestBody(final String prompt, final List<String> images, final String detail) {
|
||||
// 定义消息结构
|
||||
final List<Message> messages = new ArrayList<>();
|
||||
final List<Object> content = new ArrayList<>();
|
||||
@@ -237,10 +237,10 @@ public class DoubaoServiceImpl extends BaseAIService implements DoubaoService {
|
||||
contentMap.put("type", "text");
|
||||
contentMap.put("text", prompt);
|
||||
content.add(contentMap);
|
||||
for (String img : images) {
|
||||
HashMap<String, Object> imgUrlMap = new HashMap<>();
|
||||
for (final String img : images) {
|
||||
final HashMap<String, Object> imgUrlMap = new HashMap<>();
|
||||
imgUrlMap.put("type", "image_url");
|
||||
HashMap<String, String> urlMap = new HashMap<>();
|
||||
final HashMap<String, String> urlMap = new HashMap<>();
|
||||
urlMap.put("url", img);
|
||||
urlMap.put("detail", detail);
|
||||
imgUrlMap.put("image_url", urlMap);
|
||||
@@ -260,7 +260,7 @@ public class DoubaoServiceImpl extends BaseAIService implements DoubaoService {
|
||||
}
|
||||
|
||||
//构建文本向量化请求体
|
||||
private String buildEmbeddingTextRequestBody(String[] input) {
|
||||
private String buildEmbeddingTextRequestBody(final String[] input) {
|
||||
//使用JSON工具
|
||||
final Map<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("model", config.getModel());
|
||||
@@ -271,7 +271,7 @@ public class DoubaoServiceImpl extends BaseAIService implements DoubaoService {
|
||||
}
|
||||
|
||||
//构建图文向量化请求体
|
||||
private String buildEmbeddingVisionRequestBody(String text, String image) {
|
||||
private String buildEmbeddingVisionRequestBody(final String text, final String image) {
|
||||
//使用JSON工具
|
||||
final Map<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("model", config.getModel());
|
||||
@@ -311,7 +311,7 @@ public class DoubaoServiceImpl extends BaseAIService implements DoubaoService {
|
||||
}
|
||||
|
||||
//构建分词请求体
|
||||
private String buildTokenizationRequestBody(String[] text) {
|
||||
private String buildTokenizationRequestBody(final String[] text) {
|
||||
final Map<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("model", config.getModel());
|
||||
paramMap.put("text", text);
|
||||
@@ -328,7 +328,7 @@ public class DoubaoServiceImpl extends BaseAIService implements DoubaoService {
|
||||
}
|
||||
|
||||
//构建创建上下文缓存请求体
|
||||
private String buildCreateContextRequest(final List<Message> messages, String mode) {
|
||||
private String buildCreateContextRequest(final List<Message> messages, final String mode) {
|
||||
final Map<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("messages", messages);
|
||||
paramMap.put("model", config.getModel());
|
||||
@@ -340,7 +340,7 @@ public class DoubaoServiceImpl extends BaseAIService implements DoubaoService {
|
||||
}
|
||||
|
||||
//构建上下文缓存对话请求体
|
||||
private String buildChatContentRequestBody(final List<Message> messages, String contextId) {
|
||||
private String buildChatContentRequestBody(final List<Message> messages, final String contextId) {
|
||||
//使用JSON工具
|
||||
final Map<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("model", config.getModel());
|
||||
@@ -352,7 +352,7 @@ public class DoubaoServiceImpl extends BaseAIService implements DoubaoService {
|
||||
return JSONUtil.toJsonStr(paramMap);
|
||||
}
|
||||
|
||||
private Map<String, Object> buildChatContentStreamRequestBody(final List<Message> messages, String contextId) {
|
||||
private Map<String, Object> buildChatContentStreamRequestBody(final List<Message> messages, final String contextId) {
|
||||
//使用JSON工具
|
||||
final Map<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("stream", true);
|
||||
@@ -366,7 +366,7 @@ public class DoubaoServiceImpl extends BaseAIService implements DoubaoService {
|
||||
}
|
||||
|
||||
//构建创建视频任务请求体
|
||||
private String buildGenerationsTasksRequestBody(String text, String image, final List<DoubaoCommon.DoubaoVideo> videoParams) {
|
||||
private String buildGenerationsTasksRequestBody(final String text, final String image, final List<DoubaoCommon.DoubaoVideo> videoParams) {
|
||||
//使用JSON工具
|
||||
final Map<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("model", config.getModel());
|
||||
@@ -392,10 +392,10 @@ public class DoubaoServiceImpl extends BaseAIService implements DoubaoService {
|
||||
//添加视频参数
|
||||
if (videoParams != null && !videoParams.isEmpty()) {
|
||||
//如果有文本参数就加在后面
|
||||
if (textMap != null && !textMap.isEmpty()) {
|
||||
int textIndex = content.indexOf(textMap);
|
||||
StringBuilder textBuilder = new StringBuilder(text);
|
||||
for (DoubaoCommon.DoubaoVideo videoParam : videoParams) {
|
||||
if (!textMap.isEmpty()) {
|
||||
final int textIndex = content.indexOf(textMap);
|
||||
final StringBuilder textBuilder = new StringBuilder(text);
|
||||
for (final DoubaoCommon.DoubaoVideo videoParam : videoParams) {
|
||||
textBuilder.append(" ").append(videoParam.getType()).append(" ").append(videoParam.getValue());
|
||||
}
|
||||
textMap.put("type", "text");
|
||||
@@ -408,8 +408,8 @@ public class DoubaoServiceImpl extends BaseAIService implements DoubaoService {
|
||||
}
|
||||
} else {
|
||||
//如果没有文本参数就重新增加
|
||||
StringBuilder textBuilder = new StringBuilder();
|
||||
for (DoubaoCommon.DoubaoVideo videoParam : videoParams) {
|
||||
final StringBuilder textBuilder = new StringBuilder();
|
||||
for (final DoubaoCommon.DoubaoVideo videoParam : videoParams) {
|
||||
textBuilder.append(videoParam.getType()).append(videoParam.getValue()).append(" ");
|
||||
}
|
||||
textMap.put("type", "text");
|
||||
@@ -426,7 +426,7 @@ public class DoubaoServiceImpl extends BaseAIService implements DoubaoService {
|
||||
}
|
||||
|
||||
//构建文生图请求体
|
||||
private String buildImagesGenerationsRequestBody(String prompt) {
|
||||
private String buildImagesGenerationsRequestBody(final String prompt) {
|
||||
final Map<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("model", config.getModel());
|
||||
paramMap.put("prompt", prompt);
|
||||
|
@@ -34,6 +34,9 @@ public class BoolArrayMatcher implements PartMatcher {
|
||||
* 用户定义此字段的最小值
|
||||
*/
|
||||
protected final int minValue;
|
||||
/**
|
||||
* 匹配值列表
|
||||
*/
|
||||
protected final boolean[] bValues;
|
||||
|
||||
/**
|
||||
|
@@ -25,6 +25,7 @@ import cn.hutool.v7.db.sql.*;
|
||||
import cn.hutool.v7.db.sql.Condition.LikeType;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
@@ -43,13 +44,20 @@ import java.util.Map;
|
||||
* @author Looly
|
||||
*/
|
||||
public abstract class AbstractDb<R extends AbstractDb<R>> extends DefaultConnectionHolder implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 3858951941916349062L;
|
||||
|
||||
/**
|
||||
* 是否支持事务
|
||||
*/
|
||||
protected Boolean isSupportTransaction = null;
|
||||
/**
|
||||
* 数据库执行器
|
||||
*/
|
||||
protected DialectRunner runner;
|
||||
/**
|
||||
* 数据库配置
|
||||
*/
|
||||
protected DbConfig dbConfig;
|
||||
/**
|
||||
* 是否大小写不敏感(默认大小写不敏感)
|
||||
|
@@ -27,6 +27,9 @@ import java.sql.SQLException;
|
||||
*/
|
||||
public class DefaultConnectionHolder implements ConnectionHolder {
|
||||
|
||||
/**
|
||||
* 数据源
|
||||
*/
|
||||
protected final DataSource ds;
|
||||
|
||||
/**
|
||||
|
@@ -25,12 +25,66 @@ import cn.hutool.v7.core.text.StrUtil;
|
||||
* @author Looly
|
||||
*/
|
||||
public enum DialectName {
|
||||
ANSI, MYSQL, ORACLE, POSTGRESQL, SQLITE3, H2, SQLSERVER, SQLSERVER2012, PHOENIX, DM, HANA;
|
||||
/**
|
||||
* ANSI标准SQL数据库类型,代表使用ANSI SQL标准的数据库系统
|
||||
*/
|
||||
ANSI,
|
||||
|
||||
/**
|
||||
* MySQL数据库类型,代表MySQL数据库系统
|
||||
*/
|
||||
MYSQL,
|
||||
|
||||
/**
|
||||
* Oracle数据库类型,代表Oracle数据库系统
|
||||
*/
|
||||
ORACLE,
|
||||
|
||||
/**
|
||||
* PostgreSQL数据库类型,代表PostgreSQL数据库系统
|
||||
*/
|
||||
POSTGRESQL,
|
||||
|
||||
/**
|
||||
* SQLite3数据库类型,代表SQLite 3.x版本的轻量级嵌入式数据库
|
||||
*/
|
||||
SQLITE3,
|
||||
|
||||
/**
|
||||
* H2数据库类型,代表H2内存或磁盘数据库系统
|
||||
*/
|
||||
H2,
|
||||
|
||||
/**
|
||||
* SQL Server数据库类型,代表Microsoft SQL Server数据库系统
|
||||
*/
|
||||
SQLSERVER,
|
||||
|
||||
/**
|
||||
* SQL Server 2012数据库类型,代表Microsoft SQL Server 2012版本的数据库系统
|
||||
*/
|
||||
SQLSERVER2012,
|
||||
|
||||
/**
|
||||
* Phoenix数据库类型,代表Apache Phoenix数据库系统(基于HBase)
|
||||
*/
|
||||
PHOENIX,
|
||||
|
||||
/**
|
||||
* 达梦数据库类型,代表国产达梦(DM)数据库系统
|
||||
*/
|
||||
DM,
|
||||
|
||||
/**
|
||||
* SAP HANA数据库类型,代表SAP HANA实时内存数据库系统
|
||||
*/
|
||||
HANA;
|
||||
|
||||
|
||||
/**
|
||||
* 是否为指定数据库方言,检查时不分区大小写
|
||||
*
|
||||
* @param dialectName 方言名
|
||||
* @param dialectName 方言名
|
||||
* @return 是否时Oracle数据库
|
||||
* @since 5.7.2
|
||||
*/
|
||||
|
@@ -30,6 +30,7 @@ import cn.hutool.v7.db.sql.Query;
|
||||
import cn.hutool.v7.db.sql.QuoteWrapper;
|
||||
import cn.hutool.v7.db.sql.SqlBuilder;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
|
||||
@@ -39,9 +40,16 @@ import java.sql.PreparedStatement;
|
||||
* @author loolly
|
||||
*/
|
||||
public class AnsiSqlDialect implements Dialect {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 2088101129774974580L;
|
||||
|
||||
/**
|
||||
* ANSI SQL 方言
|
||||
*/
|
||||
protected DbConfig dbConfig;
|
||||
/**
|
||||
* 默认的QuoteWrapper
|
||||
*/
|
||||
protected QuoteWrapper quoteWrapper = new QuoteWrapper();
|
||||
|
||||
/**
|
||||
|
@@ -18,32 +18,21 @@ package cn.hutool.v7.db.ds.pooled;
|
||||
|
||||
import cn.hutool.v7.core.lang.wrapper.Wrapper;
|
||||
|
||||
import java.sql.Array;
|
||||
import java.sql.Blob;
|
||||
import java.sql.CallableStatement;
|
||||
import java.sql.Clob;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DatabaseMetaData;
|
||||
import java.sql.NClob;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLClientInfoException;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.SQLWarning;
|
||||
import java.sql.SQLXML;
|
||||
import java.sql.Savepoint;
|
||||
import java.sql.Statement;
|
||||
import java.sql.Struct;
|
||||
import java.sql.*;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
/**
|
||||
* 连接包装,用于丰富功能
|
||||
* @author Looly
|
||||
*
|
||||
* @author Looly
|
||||
*/
|
||||
public abstract class ConnectionWrapper implements Connection, Wrapper<Connection> {
|
||||
|
||||
/**
|
||||
* 原始的连接
|
||||
*/
|
||||
protected Connection raw;//真正的连接
|
||||
|
||||
@Override
|
||||
@@ -307,7 +296,7 @@ public abstract class ConnectionWrapper implements Connection, Wrapper<Connectio
|
||||
}
|
||||
|
||||
@Override
|
||||
public Connection getRaw(){
|
||||
public Connection getRaw() {
|
||||
return this.raw;
|
||||
}
|
||||
}
|
||||
|
@@ -28,7 +28,13 @@ import java.sql.SQLException;
|
||||
*/
|
||||
public abstract class AbsRowHandler<R> implements RowHandler<R> {
|
||||
|
||||
/**
|
||||
* {@link ResultSetMetaData}
|
||||
*/
|
||||
protected final ResultSetMetaData meta;
|
||||
/**
|
||||
* 列数
|
||||
*/
|
||||
protected final int columnCount;
|
||||
|
||||
/**
|
||||
|
@@ -33,6 +33,9 @@ import java.util.List;
|
||||
*/
|
||||
public abstract class AbstractFtp implements Ftp {
|
||||
|
||||
/**
|
||||
* FTP配置
|
||||
*/
|
||||
protected FtpConfig ftpConfig;
|
||||
|
||||
@Override
|
||||
|
@@ -27,15 +27,47 @@ import oshi.util.Util;
|
||||
*/
|
||||
public class CpuTicks {
|
||||
|
||||
/**
|
||||
* 空闲时间,表示CPU没有执行任何任务的时间
|
||||
*/
|
||||
long idle;
|
||||
|
||||
/**
|
||||
* 优先级较低的进程时间,表示CPU在执行优先级较低的进程时所花费的时间
|
||||
*/
|
||||
long nice;
|
||||
|
||||
/**
|
||||
* 中断请求时间,表示CPU处理中断请求所花费的时间
|
||||
*/
|
||||
long irq;
|
||||
|
||||
/**
|
||||
* 软中断请求时间,表示CPU处理软中断请求所花费的时间
|
||||
*/
|
||||
long softIrq;
|
||||
|
||||
/**
|
||||
* 被虚拟机偷走的时间,表示在虚拟化环境中,CPU被其他虚拟机使用的时间
|
||||
*/
|
||||
long steal;
|
||||
|
||||
/**
|
||||
* 系统时间,表示CPU在执行操作系统内核指令时所花费的时间
|
||||
*/
|
||||
long cSys;
|
||||
|
||||
/**
|
||||
* 用户时间,表示CPU在执行用户进程时所花费的时间
|
||||
*/
|
||||
long user;
|
||||
|
||||
/**
|
||||
* I/O等待时间,表示CPU等待I/O操作完成所花费的时间
|
||||
*/
|
||||
long ioWait;
|
||||
|
||||
|
||||
/**
|
||||
* 构造,等待时间为用于计算在一定时长内的CPU负载情况,如传入1000表示最近1秒的负载情况
|
||||
*
|
||||
@@ -59,70 +91,167 @@ public class CpuTicks {
|
||||
this.ioWait = tick(prevTicks, ticks, CentralProcessor.TickType.IOWAIT);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取CPU空闲时间
|
||||
*
|
||||
* @return CPU空闲时间
|
||||
*/
|
||||
public long getIdle() {
|
||||
return idle;
|
||||
}
|
||||
|
||||
public void setIdle(final long idle) {
|
||||
/**
|
||||
* 设置CPU空闲时间
|
||||
*
|
||||
* @param idle CPU空闲时间
|
||||
* @return 当前对象实例,用于链式调用
|
||||
*/
|
||||
public CpuTicks setIdle(final long idle) {
|
||||
this.idle = idle;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取CPU在nice模式下花费的时间
|
||||
*
|
||||
* @return CPU在nice模式下花费的时间
|
||||
*/
|
||||
public long getNice() {
|
||||
return nice;
|
||||
}
|
||||
|
||||
public void setNice(final long nice) {
|
||||
/**
|
||||
* 设置CPU在nice模式下花费的时间
|
||||
*
|
||||
* @param nice CPU在nice模式下花费的时间
|
||||
* @return 当前对象实例,用于链式调用
|
||||
*/
|
||||
public CpuTicks setNice(final long nice) {
|
||||
this.nice = nice;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取CPU在处理中断请求上花费的时间
|
||||
*
|
||||
* @return CPU在处理中断请求上花费的时间
|
||||
*/
|
||||
public long getIrq() {
|
||||
return irq;
|
||||
}
|
||||
|
||||
public void setIrq(final long irq) {
|
||||
/**
|
||||
* 设置CPU在处理中断请求上花费的时间
|
||||
*
|
||||
* @param irq CPU在处理中断请求上花费的时间
|
||||
* @return 当前对象实例,用于链式调用
|
||||
*/
|
||||
public CpuTicks setIrq(final long irq) {
|
||||
this.irq = irq;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取CPU在处理软中断上花费的时间
|
||||
*
|
||||
* @return CPU在处理软中断上花费的时间
|
||||
*/
|
||||
public long getSoftIrq() {
|
||||
return softIrq;
|
||||
}
|
||||
|
||||
public void setSoftIrq(final long softIrq) {
|
||||
/**
|
||||
* 设置CPU在处理软中断上花费的时间
|
||||
*
|
||||
* @param softIrq CPU在处理软中断上花费的时间
|
||||
* @return 当前对象实例,用于链式调用
|
||||
*/
|
||||
public CpuTicks setSoftIrq(final long softIrq) {
|
||||
this.softIrq = softIrq;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取CPU被其他虚拟处理器占用的时间
|
||||
*
|
||||
* @return CPU被其他虚拟处理器占用的时间
|
||||
*/
|
||||
public long getSteal() {
|
||||
return steal;
|
||||
}
|
||||
|
||||
public void setSteal(final long steal) {
|
||||
/**
|
||||
* 设置CPU被其他虚拟处理器占用的时间
|
||||
*
|
||||
* @param steal CPU被其他虚拟处理器占用的时间
|
||||
* @return 当前对象实例,用于链式调用
|
||||
*/
|
||||
public CpuTicks setSteal(final long steal) {
|
||||
this.steal = steal;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取CPU在系统模式下花费的时间
|
||||
*
|
||||
* @return CPU在系统模式下花费的时间
|
||||
*/
|
||||
public long getcSys() {
|
||||
return cSys;
|
||||
}
|
||||
|
||||
public void setcSys(final long cSys) {
|
||||
/**
|
||||
* 设置CPU在系统模式下花费的时间
|
||||
*
|
||||
* @param cSys CPU在系统模式下花费的时间
|
||||
* @return 当前对象实例,用于链式调用
|
||||
*/
|
||||
public CpuTicks setcSys(final long cSys) {
|
||||
this.cSys = cSys;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取CPU在用户模式下花费的时间
|
||||
*
|
||||
* @return CPU在用户模式下花费的时间
|
||||
*/
|
||||
public long getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(final long user) {
|
||||
/**
|
||||
* 设置CPU在用户模式下花费的时间
|
||||
*
|
||||
* @param user CPU在用户模式下花费的时间
|
||||
* @return 当前对象实例,用于链式调用
|
||||
*/
|
||||
public CpuTicks setUser(final long user) {
|
||||
this.user = user;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取CPU在等待I/O完成上花费的时间
|
||||
*
|
||||
* @return CPU在等待I/O完成上花费的时间
|
||||
*/
|
||||
public long getIoWait() {
|
||||
return ioWait;
|
||||
}
|
||||
|
||||
public void setIoWait(final long ioWait) {
|
||||
/**
|
||||
* 设置CPU在等待I/O完成上花费的时间
|
||||
*
|
||||
* @param ioWait CPU在等待I/O完成上花费的时间
|
||||
* @return 当前对象实例,用于链式调用
|
||||
*/
|
||||
public CpuTicks setIoWait(final long ioWait) {
|
||||
this.ioWait = ioWait;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取CPU总的使用率
|
||||
*
|
||||
@@ -135,15 +264,15 @@ public class CpuTicks {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CpuTicks{" +
|
||||
"idle=" + idle +
|
||||
", nice=" + nice +
|
||||
", irq=" + irq +
|
||||
", softIrq=" + softIrq +
|
||||
", steal=" + steal +
|
||||
", cSys=" + cSys +
|
||||
", user=" + user +
|
||||
", ioWait=" + ioWait +
|
||||
'}';
|
||||
"idle=" + idle +
|
||||
", nice=" + nice +
|
||||
", irq=" + irq +
|
||||
", softIrq=" + softIrq +
|
||||
", steal=" + steal +
|
||||
", cSys=" + cSys +
|
||||
", user=" + user +
|
||||
", ioWait=" + ioWait +
|
||||
'}';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -29,9 +29,15 @@ import cn.hutool.v7.http.client.cookie.CookieStoreSpi;
|
||||
* @author Looly
|
||||
* @since 6.0.0
|
||||
*/
|
||||
public abstract class AbstractClientEngine implements ClientEngine{
|
||||
public abstract class AbstractClientEngine implements ClientEngine {
|
||||
|
||||
/**
|
||||
* 配置
|
||||
*/
|
||||
protected ClientConfig config;
|
||||
/**
|
||||
* Cookie存储器
|
||||
*/
|
||||
protected CookieStoreSpi cookieStore;
|
||||
|
||||
/**
|
||||
|
@@ -26,7 +26,13 @@ import cn.hutool.v7.http.server.handler.HttpHandler;
|
||||
*/
|
||||
public abstract class AbstractServerEngine implements ServerEngine {
|
||||
|
||||
/**
|
||||
* 配置
|
||||
*/
|
||||
protected ServerConfig config;
|
||||
/**
|
||||
* 处理器
|
||||
*/
|
||||
protected HttpHandler handler;
|
||||
|
||||
@Override
|
||||
|
@@ -29,6 +29,9 @@ import cn.hutool.v7.poi.excel.reader.ExcelReadConfig;
|
||||
*/
|
||||
public abstract class AbstractSheetReader<T> implements SheetReader<T> {
|
||||
|
||||
/**
|
||||
* 读取范围
|
||||
*/
|
||||
protected final CellRangeAddress cellRangeAddress;
|
||||
/**
|
||||
* Excel配置
|
||||
|
@@ -42,7 +42,13 @@ public class AioServer implements Closeable {
|
||||
|
||||
private AsynchronousChannelGroup group;
|
||||
private AsynchronousServerSocketChannel channel;
|
||||
/**
|
||||
* IO处理
|
||||
*/
|
||||
protected IoAction<ByteBuffer> ioAction;
|
||||
/**
|
||||
* 配置
|
||||
*/
|
||||
protected final SocketConfig config;
|
||||
|
||||
|
||||
|
@@ -27,6 +27,10 @@ import java.util.Map;
|
||||
* @author Tom Xin
|
||||
*/
|
||||
public abstract class AnsiLabMapping {
|
||||
|
||||
/**
|
||||
* ANSI颜色和Lab颜色对应表
|
||||
*/
|
||||
protected Map<AnsiElement, LabColor> ansiLabMap;
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user