代码修改

This commit is contained in:
2025-12-30 18:38:24 +08:00
parent 8011dec826
commit ca330fc695
10 changed files with 42 additions and 24 deletions

3
.gitignore vendored
View File

@@ -202,4 +202,5 @@ cython_debug/
江西城市生命线-可交互原型/frontend/node_modules/*
THAI-Platform/*
urbanLifelineWeb/packages/wechat_demo/*
urbanLifelineWeb/packages/workcase_wechat/unpackage/*
urbanLifelineWeb/packages/workcase_wechat/unpackage/*
docs/AI训练资料

17
difyPlugin/.vscode/launch.json vendored Normal file
View 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
View File

View File

@@ -1,20 +1,6 @@
{
"version": "0.2.0",
"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",
"name": "AesEncryptUtil",

View File

@@ -284,9 +284,8 @@ public class DifyApiClient {
dataMap.put("process_rule", defaultProcessRule);
}
// 默认设置文档形式和语言
dataMap.put("doc_form", "text_model");
dataMap.put("doc_language", "Chinese");
// 只保留官方支持的参数
// doc_form 和 doc_language 不是请求参数,移除
String dataJson = JSON.toJSONString(dataMap);
logger.info("上传文档到知识库: datasetId={}, file={}, data={}", datasetId, originalFilename, dataJson);

View File

@@ -300,6 +300,7 @@ public class AgentChatServiceImpl implements AgentChatService {
sessionData.put("apiKey", agent.getApiKey());
sessionData.put("outer", agent.getIsOuter());
sessionData.put("service", prepareData.getService());
sessionData.put("isGuest", "guest".equals(loginDomain.getUser().getStatus()));
String cacheKey = CHAT_SESSION_PREFIX + sessionId;
redisService.set(cacheKey, sessionData, SESSION_TTL, TimeUnit.SECONDS);
@@ -335,6 +336,7 @@ public class AgentChatServiceImpl implements AgentChatService {
String apiKey = (String) sessionData.get("apiKey");
String service = (String) sessionData.get("service");
Boolean outer = (Boolean) sessionData.get("outer");
Boolean isGuest = (Boolean) sessionData.get("isGuest");
@SuppressWarnings("unchecked")
List<DifyFileInfo> filesData = (List<DifyFileInfo>) sessionData.get("filesData");
@@ -375,7 +377,7 @@ public class AgentChatServiceImpl implements AgentChatService {
if(outer && NonUtils.isNotEmpty(service)){
TbKnowledge filter = new TbKnowledge();
filter.setService(service);
filter.setCategory("external");
filter.setCategory(isGuest?"external":"internal");
ResultDomain<TbKnowledge> knowledgeRD = knowledgeService.listKnowledges(filter);
List<String> datasets = new ArrayList<>();
if(knowledgeRD.getSuccess()){

View File

@@ -29,7 +29,12 @@ security:
spring:
application:
name: ai-service
# 文件上传配置
servlet:
multipart:
enabled: true
max-file-size: 500MB
max-request-size: 500MB
# ================== Spring Cloud Nacos ==================
cloud:
nacos:
@@ -72,6 +77,7 @@ dubbo:
name: urban-lifeline-agent
qos-enable: false
protocol:
payload: 110100480
name: dubbo
port: -1
registry:

View File

@@ -72,6 +72,7 @@ dubbo:
name: urban-lifeline-agent
qos-enable: false
protocol:
payload: 110100480
name: dubbo
port: -1
registry:

View File

@@ -29,7 +29,6 @@ security:
spring:
application:
name: file-service
# ================== Spring Cloud Nacos ==================
cloud:
nacos:
@@ -57,8 +56,8 @@ spring:
servlet:
multipart:
enabled: true
max-file-size: 100MB
max-request-size: 100MB
max-file-size: 500MB
max-request-size: 500MB
# ================== SpringDoc ==================
springdoc:
@@ -79,6 +78,7 @@ dubbo:
name: urban-lifeline-file
qos-enable: false
protocol:
payload: 110100480
name: dubbo
port: -1
registry:

View File

@@ -32,7 +32,12 @@ security:
spring:
application:
name: workcase-service
# 文件上传配置
servlet:
multipart:
enabled: true
max-file-size: 500MB
max-request-size: 500MB
# ================== Spring Cloud Nacos ==================
cloud:
nacos:
@@ -75,6 +80,7 @@ dubbo:
name: urban-lifeline-workcase
qos-enable: false
protocol:
payload: 110100480
name: dubbo
port: -1
registry: