代码修改
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -203,3 +203,4 @@ cython_debug/
|
|||||||
THAI-Platform/*
|
THAI-Platform/*
|
||||||
urbanLifelineWeb/packages/wechat_demo/*
|
urbanLifelineWeb/packages/wechat_demo/*
|
||||||
urbanLifelineWeb/packages/workcase_wechat/unpackage/*
|
urbanLifelineWeb/packages/workcase_wechat/unpackage/*
|
||||||
|
docs/AI训练资料
|
||||||
17
difyPlugin/.vscode/launch.json
vendored
Normal file
17
difyPlugin/.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "DifyPlugin: FastAPI",
|
||||||
|
"type": "debugpy",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "run.py",
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"python": "F:\\Environment\\conda\\envs\\difyPlugin\\python.exe",
|
||||||
|
"env": {
|
||||||
|
"PYTHONPATH": "${workspaceFolder}/difyPlugin"
|
||||||
|
},
|
||||||
|
"jinja": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
0
difyPlugin/.vscode/settings.json
vendored
Normal file
0
difyPlugin/.vscode/settings.json
vendored
Normal file
14
urbanLifelineServ/.vscode/launch.json
vendored
14
urbanLifelineServ/.vscode/launch.json
vendored
@@ -1,20 +1,6 @@
|
|||||||
{
|
{
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
|
||||||
"type": "java",
|
|
||||||
"name": "URLQRCodeParseTest",
|
|
||||||
"request": "launch",
|
|
||||||
"mainClass": "org.xyzh.workcase.test.URLQRCodeParseTest",
|
|
||||||
"projectName": "workcase"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "java",
|
|
||||||
"name": "QRCodeTest",
|
|
||||||
"request": "launch",
|
|
||||||
"mainClass": "org.xyzh.workcase.test.QRCodeTest",
|
|
||||||
"projectName": "workcase"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "java",
|
"type": "java",
|
||||||
"name": "AesEncryptUtil",
|
"name": "AesEncryptUtil",
|
||||||
|
|||||||
@@ -284,9 +284,8 @@ public class DifyApiClient {
|
|||||||
dataMap.put("process_rule", defaultProcessRule);
|
dataMap.put("process_rule", defaultProcessRule);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 默认设置文档形式和语言
|
// 只保留官方支持的参数
|
||||||
dataMap.put("doc_form", "text_model");
|
// doc_form 和 doc_language 不是请求参数,移除
|
||||||
dataMap.put("doc_language", "Chinese");
|
|
||||||
|
|
||||||
String dataJson = JSON.toJSONString(dataMap);
|
String dataJson = JSON.toJSONString(dataMap);
|
||||||
logger.info("上传文档到知识库: datasetId={}, file={}, data={}", datasetId, originalFilename, dataJson);
|
logger.info("上传文档到知识库: datasetId={}, file={}, data={}", datasetId, originalFilename, dataJson);
|
||||||
|
|||||||
@@ -300,6 +300,7 @@ public class AgentChatServiceImpl implements AgentChatService {
|
|||||||
sessionData.put("apiKey", agent.getApiKey());
|
sessionData.put("apiKey", agent.getApiKey());
|
||||||
sessionData.put("outer", agent.getIsOuter());
|
sessionData.put("outer", agent.getIsOuter());
|
||||||
sessionData.put("service", prepareData.getService());
|
sessionData.put("service", prepareData.getService());
|
||||||
|
sessionData.put("isGuest", "guest".equals(loginDomain.getUser().getStatus()));
|
||||||
|
|
||||||
String cacheKey = CHAT_SESSION_PREFIX + sessionId;
|
String cacheKey = CHAT_SESSION_PREFIX + sessionId;
|
||||||
redisService.set(cacheKey, sessionData, SESSION_TTL, TimeUnit.SECONDS);
|
redisService.set(cacheKey, sessionData, SESSION_TTL, TimeUnit.SECONDS);
|
||||||
@@ -335,6 +336,7 @@ public class AgentChatServiceImpl implements AgentChatService {
|
|||||||
String apiKey = (String) sessionData.get("apiKey");
|
String apiKey = (String) sessionData.get("apiKey");
|
||||||
String service = (String) sessionData.get("service");
|
String service = (String) sessionData.get("service");
|
||||||
Boolean outer = (Boolean) sessionData.get("outer");
|
Boolean outer = (Boolean) sessionData.get("outer");
|
||||||
|
Boolean isGuest = (Boolean) sessionData.get("isGuest");
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
List<DifyFileInfo> filesData = (List<DifyFileInfo>) sessionData.get("filesData");
|
List<DifyFileInfo> filesData = (List<DifyFileInfo>) sessionData.get("filesData");
|
||||||
@@ -375,7 +377,7 @@ public class AgentChatServiceImpl implements AgentChatService {
|
|||||||
if(outer && NonUtils.isNotEmpty(service)){
|
if(outer && NonUtils.isNotEmpty(service)){
|
||||||
TbKnowledge filter = new TbKnowledge();
|
TbKnowledge filter = new TbKnowledge();
|
||||||
filter.setService(service);
|
filter.setService(service);
|
||||||
filter.setCategory("external");
|
filter.setCategory(isGuest?"external":"internal");
|
||||||
ResultDomain<TbKnowledge> knowledgeRD = knowledgeService.listKnowledges(filter);
|
ResultDomain<TbKnowledge> knowledgeRD = knowledgeService.listKnowledges(filter);
|
||||||
List<String> datasets = new ArrayList<>();
|
List<String> datasets = new ArrayList<>();
|
||||||
if(knowledgeRD.getSuccess()){
|
if(knowledgeRD.getSuccess()){
|
||||||
|
|||||||
@@ -29,7 +29,12 @@ security:
|
|||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: ai-service
|
name: ai-service
|
||||||
|
# 文件上传配置
|
||||||
|
servlet:
|
||||||
|
multipart:
|
||||||
|
enabled: true
|
||||||
|
max-file-size: 500MB
|
||||||
|
max-request-size: 500MB
|
||||||
# ================== Spring Cloud Nacos ==================
|
# ================== Spring Cloud Nacos ==================
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
@@ -72,6 +77,7 @@ dubbo:
|
|||||||
name: urban-lifeline-agent
|
name: urban-lifeline-agent
|
||||||
qos-enable: false
|
qos-enable: false
|
||||||
protocol:
|
protocol:
|
||||||
|
payload: 110100480
|
||||||
name: dubbo
|
name: dubbo
|
||||||
port: -1
|
port: -1
|
||||||
registry:
|
registry:
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ dubbo:
|
|||||||
name: urban-lifeline-agent
|
name: urban-lifeline-agent
|
||||||
qos-enable: false
|
qos-enable: false
|
||||||
protocol:
|
protocol:
|
||||||
|
payload: 110100480
|
||||||
name: dubbo
|
name: dubbo
|
||||||
port: -1
|
port: -1
|
||||||
registry:
|
registry:
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ security:
|
|||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: file-service
|
name: file-service
|
||||||
|
|
||||||
# ================== Spring Cloud Nacos ==================
|
# ================== Spring Cloud Nacos ==================
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
@@ -57,8 +56,8 @@ spring:
|
|||||||
servlet:
|
servlet:
|
||||||
multipart:
|
multipart:
|
||||||
enabled: true
|
enabled: true
|
||||||
max-file-size: 100MB
|
max-file-size: 500MB
|
||||||
max-request-size: 100MB
|
max-request-size: 500MB
|
||||||
|
|
||||||
# ================== SpringDoc ==================
|
# ================== SpringDoc ==================
|
||||||
springdoc:
|
springdoc:
|
||||||
@@ -79,6 +78,7 @@ dubbo:
|
|||||||
name: urban-lifeline-file
|
name: urban-lifeline-file
|
||||||
qos-enable: false
|
qos-enable: false
|
||||||
protocol:
|
protocol:
|
||||||
|
payload: 110100480
|
||||||
name: dubbo
|
name: dubbo
|
||||||
port: -1
|
port: -1
|
||||||
registry:
|
registry:
|
||||||
|
|||||||
@@ -32,7 +32,12 @@ security:
|
|||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: workcase-service
|
name: workcase-service
|
||||||
|
# 文件上传配置
|
||||||
|
servlet:
|
||||||
|
multipart:
|
||||||
|
enabled: true
|
||||||
|
max-file-size: 500MB
|
||||||
|
max-request-size: 500MB
|
||||||
# ================== Spring Cloud Nacos ==================
|
# ================== Spring Cloud Nacos ==================
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
@@ -75,6 +80,7 @@ dubbo:
|
|||||||
name: urban-lifeline-workcase
|
name: urban-lifeline-workcase
|
||||||
qos-enable: false
|
qos-enable: false
|
||||||
protocol:
|
protocol:
|
||||||
|
payload: 110100480
|
||||||
name: dubbo
|
name: dubbo
|
||||||
port: -1
|
port: -1
|
||||||
registry:
|
registry:
|
||||||
|
|||||||
Reference in New Issue
Block a user