程序包 com.sh.ai
类 AIUtil
java.lang.Object
com.sh.ai.AIUtil
AI工具类
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static voidaddRunning(String aiType, String sessionId, AIRunning aiRunning) 添加一个正在运行的作业static String将内容进行转义处理static StringconvertJSONArrayToMD(JSONArray jsonArray) static String将JSONArray转换为Markdown格式的表格static StringformatMsTime(long ms) 将毫秒时间格式化static boolean是否提示token超最大值static voidremoveRunning(String aiType, String sessionId) 移出监听正在运行的作业,也有可能是已经正常执行完static StringremoveThinkContent(String content) 将AI返回的消息中忽略思考部分static booleanstopRunning(String aiType, String sessionId) 停止一个正在运行的作业
-
字段详细资料
-
构造器详细资料
-
AIUtil
public AIUtil()
-
-
方法详细资料
-
addRunning
添加一个正在运行的作业- 参数:
sessionId-aiRunning-
-
stopRunning
停止一个正在运行的作业- 参数:
sessionId-- 返回:
-
removeRunning
移出监听正在运行的作业,也有可能是已经正常执行完- 参数:
sessionId-
-
convertJSONArrayToMD
将JSONArray转换为Markdown格式的表格- 参数:
str- JSONArray字符串- 返回:
String
-
convertJSONArrayToMD
-
removeThinkContent
将AI返回的消息中忽略思考部分- 参数:
content-- 返回:
String
-
checkResponseContent
将内容进行转义处理- 参数:
str- String- 返回:
- String
-
isMaxTokenError
是否提示token超最大值- 参数:
e-- 返回:
- boolean
-
formatMsTime
将毫秒时间格式化- 参数:
ms-- 返回:
String
-