mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-04-12 11:07:19 +00:00
v3.0.0 init
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
package org.ruoyi.constant;
|
||||
|
||||
public class FileTypeConstants {
|
||||
public static final String TXT = "txt";
|
||||
public static final String CSV = "csv";
|
||||
public static final String MD = "md";
|
||||
public static final String DOC = "doc";
|
||||
public static final String DOCX = "docx";
|
||||
public static final String PDF = "pdf";
|
||||
public static final String XLS = "xls";
|
||||
public static final String XLSX = "xlsx";
|
||||
|
||||
public static final String LOG = "log";
|
||||
public static final String XML = "xml";
|
||||
|
||||
public static final String JAVA = "java";
|
||||
public static final String HTML = "html";
|
||||
public static final String HTM = "htm";
|
||||
public static final String CSS = "css";
|
||||
public static final String JS = "js";
|
||||
public static final String PY = "py";
|
||||
public static final String CPP = "cpp";
|
||||
public static final String SQL = "sql";
|
||||
public static final String PHP = "php";
|
||||
public static final String RUBY = "ruby";
|
||||
public static final String C = "c";
|
||||
public static final String H = "h";
|
||||
public static final String HPP = "hpp";
|
||||
public static final String SWIFT = "swift";
|
||||
public static final String TS = "ts";
|
||||
public static final String RUST = "rs";
|
||||
public static final String PERL = "perl";
|
||||
public static final String SHELL = "shell";
|
||||
public static final String BAT = "bat";
|
||||
public static final String CMD = "cmd";
|
||||
|
||||
public static final String PROPERTIES = "properties";
|
||||
public static final String INI = "ini";
|
||||
public static final String YAML = "yaml";
|
||||
public static final String YML = "yml";
|
||||
|
||||
public static boolean isTextFile(String type) {
|
||||
if (type.equalsIgnoreCase(TXT) || type.equalsIgnoreCase(CSV) || type.equalsIgnoreCase(PROPERTIES)
|
||||
|| type.equalsIgnoreCase(INI) || type.equalsIgnoreCase(YAML) || type.equalsIgnoreCase(YML)
|
||||
|| type.equalsIgnoreCase(LOG) || type.equalsIgnoreCase(XML)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isCodeFile(String type) {
|
||||
if (type.equalsIgnoreCase(JAVA) || type.equalsIgnoreCase(HTML) || type.equalsIgnoreCase(HTM) || type.equalsIgnoreCase(JS) || type.equalsIgnoreCase(PY)
|
||||
|| type.equalsIgnoreCase(CPP) || type.equalsIgnoreCase(SQL) || type.equalsIgnoreCase(PHP) || type.equalsIgnoreCase(RUBY)
|
||||
|| type.equalsIgnoreCase(C) || type.equalsIgnoreCase(H) || type.equalsIgnoreCase(HPP) || type.equalsIgnoreCase(SWIFT)
|
||||
|| type.equalsIgnoreCase(TS) || type.equalsIgnoreCase(RUST) || type.equalsIgnoreCase(PERL) || type.equalsIgnoreCase(SHELL)
|
||||
|| type.equalsIgnoreCase(BAT) || type.equalsIgnoreCase(CMD) || type.equalsIgnoreCase(CSS)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isMdFile(String type) {
|
||||
if (type.equalsIgnoreCase(MD)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isWord(String type) {
|
||||
if (type.equalsIgnoreCase(DOC) || type.equalsIgnoreCase(DOCX)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isPdf(String type) {
|
||||
if (type.equalsIgnoreCase(PDF)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isExcel(String type) {
|
||||
if (type.equalsIgnoreCase(XLS) || type.equalsIgnoreCase(XLSX)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package org.ruoyi.constant;
|
||||
|
||||
/**
|
||||
* 知识图谱常量
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-30
|
||||
*/
|
||||
public class GraphConstants {
|
||||
|
||||
/**
|
||||
* 图谱记录分隔符
|
||||
*/
|
||||
public static final String GRAPH_RECORD_DELIMITER = "##";
|
||||
|
||||
/**
|
||||
* 图谱元组分隔符
|
||||
*/
|
||||
public static final String GRAPH_TUPLE_DELIMITER = "<|>";
|
||||
|
||||
/**
|
||||
* 图谱完成标记
|
||||
*/
|
||||
public static final String GRAPH_COMPLETION_DELIMITER = "<|COMPLETE|>";
|
||||
|
||||
/**
|
||||
* 实体类型:人物
|
||||
*/
|
||||
public static final String ENTITY_TYPE_PERSON = "PERSON";
|
||||
|
||||
/**
|
||||
* 实体类型:组织机构
|
||||
*/
|
||||
public static final String ENTITY_TYPE_ORGANIZATION = "ORGANIZATION";
|
||||
|
||||
/**
|
||||
* 实体类型:地点
|
||||
*/
|
||||
public static final String ENTITY_TYPE_LOCATION = "LOCATION";
|
||||
|
||||
/**
|
||||
* 实体类型:概念
|
||||
*/
|
||||
public static final String ENTITY_TYPE_CONCEPT = "CONCEPT";
|
||||
|
||||
/**
|
||||
* 实体类型:事件
|
||||
*/
|
||||
public static final String ENTITY_TYPE_EVENT = "EVENT";
|
||||
|
||||
/**
|
||||
* 实体类型:产品
|
||||
*/
|
||||
public static final String ENTITY_TYPE_PRODUCT = "PRODUCT";
|
||||
|
||||
/**
|
||||
* 实体类型:技术
|
||||
*/
|
||||
public static final String ENTITY_TYPE_TECHNOLOGY = "TECHNOLOGY";
|
||||
|
||||
/**
|
||||
* 默认实体抽取类型列表
|
||||
*/
|
||||
public static final String[] DEFAULT_ENTITY_TYPES = {
|
||||
ENTITY_TYPE_PERSON,
|
||||
ENTITY_TYPE_ORGANIZATION,
|
||||
ENTITY_TYPE_LOCATION,
|
||||
ENTITY_TYPE_CONCEPT,
|
||||
ENTITY_TYPE_EVENT,
|
||||
ENTITY_TYPE_PRODUCT,
|
||||
ENTITY_TYPE_TECHNOLOGY
|
||||
};
|
||||
|
||||
/**
|
||||
* 元数据键:知识库UUID
|
||||
*/
|
||||
public static final String METADATA_KB_UUID = "kb_uuid";
|
||||
|
||||
/**
|
||||
* 元数据键:知识库条目UUID
|
||||
*/
|
||||
public static final String METADATA_KB_ITEM_UUID = "kb_item_uuid";
|
||||
|
||||
/**
|
||||
* 元数据键:文档UUID
|
||||
*/
|
||||
public static final String METADATA_DOC_UUID = "doc_uuid";
|
||||
|
||||
/**
|
||||
* 元数据键:片段UUID
|
||||
*/
|
||||
public static final String METADATA_SEGMENT_UUID = "segment_uuid";
|
||||
|
||||
/**
|
||||
* RAG最大片段大小(token数)
|
||||
*/
|
||||
public static final int RAG_MAX_SEGMENT_SIZE_IN_TOKENS = 512;
|
||||
|
||||
/**
|
||||
* RAG片段重叠大小(token数)
|
||||
*/
|
||||
public static final int RAG_SEGMENT_OVERLAP_IN_TOKENS = 50;
|
||||
}
|
||||
Reference in New Issue
Block a user