修改打包
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -3,4 +3,5 @@ build_output
|
|||||||
|
|
||||||
# Docker volumes(运行时数据,不纳入版本控制)
|
# Docker volumes(运行时数据,不纳入版本控制)
|
||||||
docker/schoolNews/volumes/
|
docker/schoolNews/volumes/
|
||||||
docker/schoolNews/crawler
|
docker/schoolNews/crawler
|
||||||
|
docker.zip
|
||||||
24
build.sh
24
build.sh
@@ -104,23 +104,7 @@ done
|
|||||||
# 确定保存版本
|
# 确定保存版本
|
||||||
if [ "${DO_SAVE}" = true ]; then
|
if [ "${DO_SAVE}" = true ]; then
|
||||||
if [ -z "${SAVE_VERSION}" ]; then
|
if [ -z "${SAVE_VERSION}" ]; then
|
||||||
if [ "${DO_BUILD}" = true ]; then
|
SAVE_VERSION="latest"
|
||||||
# 如果有build参数,保存刚构建的版本
|
|
||||||
SAVE_VERSION="${IMAGE_VERSION}"
|
|
||||||
else
|
|
||||||
# 如果没有build参数且未指定版本,提示错误
|
|
||||||
echo ""
|
|
||||||
log_error "❌ 错误:只使用save时必须指定版本"
|
|
||||||
echo ""
|
|
||||||
echo "正确用法:"
|
|
||||||
echo " 1. 保存指定版本: ./build.sh ${BUILD_TARGET} save=20251124_143025"
|
|
||||||
echo " 2. 构建并保存: ./build.sh ${BUILD_TARGET} build save"
|
|
||||||
echo ""
|
|
||||||
echo "查看可用版本:"
|
|
||||||
echo " docker images | grep school-news"
|
|
||||||
echo ""
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -132,11 +116,7 @@ log_info "构建版本: ${IMAGE_VERSION}"
|
|||||||
log_info "编译代码: ${DO_BUILD}"
|
log_info "编译代码: ${DO_BUILD}"
|
||||||
log_info "保存镜像: ${DO_SAVE}"
|
log_info "保存镜像: ${DO_SAVE}"
|
||||||
if [ "${DO_SAVE}" = true ]; then
|
if [ "${DO_SAVE}" = true ]; then
|
||||||
if [ "${DO_BUILD}" = true ]; then
|
log_info "保存版本: ${SAVE_VERSION}"
|
||||||
log_info "保存版本: ${SAVE_VERSION} (自动使用构建版本)"
|
|
||||||
else
|
|
||||||
log_info "保存版本: ${SAVE_VERSION} (指定版本)"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
log_info "项目路径: ${PROJECT_ROOT}"
|
log_info "项目路径: ${PROJECT_ROOT}"
|
||||||
echo "=========================================="
|
echo "=========================================="
|
||||||
|
|||||||
357
docker/schoolNews/dify/动态知识库检索.yml
Normal file
357
docker/schoolNews/dify/动态知识库检索.yml
Normal file
@@ -0,0 +1,357 @@
|
|||||||
|
app:
|
||||||
|
description: 根据用户指定的知识库进行检索,返回相似片段结构化数据。
|
||||||
|
icon: 🤖
|
||||||
|
icon_background: '#FFEAD5'
|
||||||
|
mode: workflow
|
||||||
|
name: 动态知识库检索
|
||||||
|
use_icon_as_answer_icon: false
|
||||||
|
dependencies: []
|
||||||
|
kind: app
|
||||||
|
version: 0.4.0
|
||||||
|
workflow:
|
||||||
|
conversation_variables: []
|
||||||
|
environment_variables: []
|
||||||
|
features:
|
||||||
|
file_upload:
|
||||||
|
allowed_file_extensions:
|
||||||
|
- .JPG
|
||||||
|
- .JPEG
|
||||||
|
- .PNG
|
||||||
|
- .GIF
|
||||||
|
- .WEBP
|
||||||
|
- .SVG
|
||||||
|
allowed_file_types:
|
||||||
|
- image
|
||||||
|
allowed_file_upload_methods:
|
||||||
|
- local_file
|
||||||
|
- remote_url
|
||||||
|
enabled: false
|
||||||
|
fileUploadConfig:
|
||||||
|
audio_file_size_limit: 50
|
||||||
|
batch_count_limit: 5
|
||||||
|
file_size_limit: 15
|
||||||
|
image_file_size_limit: 10
|
||||||
|
video_file_size_limit: 100
|
||||||
|
workflow_file_upload_limit: 10
|
||||||
|
image:
|
||||||
|
enabled: false
|
||||||
|
number_limits: 3
|
||||||
|
transfer_methods:
|
||||||
|
- local_file
|
||||||
|
- remote_url
|
||||||
|
number_limits: 3
|
||||||
|
opening_statement: ''
|
||||||
|
retriever_resource:
|
||||||
|
enabled: true
|
||||||
|
sensitive_word_avoidance:
|
||||||
|
enabled: false
|
||||||
|
speech_to_text:
|
||||||
|
enabled: false
|
||||||
|
suggested_questions: []
|
||||||
|
suggested_questions_after_answer:
|
||||||
|
enabled: false
|
||||||
|
text_to_speech:
|
||||||
|
enabled: false
|
||||||
|
language: ''
|
||||||
|
voice: ''
|
||||||
|
graph:
|
||||||
|
edges:
|
||||||
|
- data:
|
||||||
|
isInIteration: false
|
||||||
|
isInLoop: false
|
||||||
|
sourceType: code
|
||||||
|
targetType: iteration
|
||||||
|
id: 1747125551298-source-1747125586388-target
|
||||||
|
selected: false
|
||||||
|
source: '1747125551298'
|
||||||
|
sourceHandle: source
|
||||||
|
target: '1747125586388'
|
||||||
|
targetHandle: target
|
||||||
|
type: custom
|
||||||
|
zIndex: 0
|
||||||
|
- data:
|
||||||
|
isInIteration: true
|
||||||
|
isInLoop: false
|
||||||
|
iteration_id: '1747125586388'
|
||||||
|
sourceType: iteration-start
|
||||||
|
targetType: http-request
|
||||||
|
id: 1747125586388start-source-1747125795256-target
|
||||||
|
source: 1747125586388start
|
||||||
|
sourceHandle: source
|
||||||
|
target: '1747125795256'
|
||||||
|
targetHandle: target
|
||||||
|
type: custom
|
||||||
|
zIndex: 1002
|
||||||
|
- data:
|
||||||
|
isInIteration: false
|
||||||
|
isInLoop: false
|
||||||
|
sourceType: iteration
|
||||||
|
targetType: code
|
||||||
|
id: 1747125586388-source-1747125859504-target
|
||||||
|
source: '1747125586388'
|
||||||
|
sourceHandle: source
|
||||||
|
target: '1747125859504'
|
||||||
|
targetHandle: target
|
||||||
|
type: custom
|
||||||
|
zIndex: 0
|
||||||
|
- data:
|
||||||
|
isInIteration: false
|
||||||
|
isInLoop: false
|
||||||
|
sourceType: code
|
||||||
|
targetType: end
|
||||||
|
id: 1747125859504-source-1747125871123-target
|
||||||
|
source: '1747125859504'
|
||||||
|
sourceHandle: source
|
||||||
|
target: '1747125871123'
|
||||||
|
targetHandle: target
|
||||||
|
type: custom
|
||||||
|
zIndex: 0
|
||||||
|
- data:
|
||||||
|
isInLoop: false
|
||||||
|
sourceType: start
|
||||||
|
targetType: code
|
||||||
|
id: 1747125462435-source-1747125551298-target
|
||||||
|
source: '1747125462435'
|
||||||
|
sourceHandle: source
|
||||||
|
target: '1747125551298'
|
||||||
|
targetHandle: target
|
||||||
|
type: custom
|
||||||
|
zIndex: 0
|
||||||
|
nodes:
|
||||||
|
- data:
|
||||||
|
desc: ''
|
||||||
|
selected: false
|
||||||
|
title: 开始
|
||||||
|
type: start
|
||||||
|
variables:
|
||||||
|
- label: 知识库集(多个Id使用英文逗号隔开)
|
||||||
|
max_length: 256
|
||||||
|
options: []
|
||||||
|
required: true
|
||||||
|
type: text-input
|
||||||
|
variable: dataset_ids
|
||||||
|
- label: 用户问题
|
||||||
|
max_length: 256
|
||||||
|
options: []
|
||||||
|
required: true
|
||||||
|
type: text-input
|
||||||
|
variable: query
|
||||||
|
height: 114
|
||||||
|
id: '1747125462435'
|
||||||
|
position:
|
||||||
|
x: 80
|
||||||
|
y: 282
|
||||||
|
positionAbsolute:
|
||||||
|
x: 80
|
||||||
|
y: 282
|
||||||
|
selected: false
|
||||||
|
sourcePosition: right
|
||||||
|
targetPosition: left
|
||||||
|
type: custom
|
||||||
|
width: 242
|
||||||
|
- data:
|
||||||
|
code: "\nimport json\ndef main(dataset_ids:str):\n return {\n \"\
|
||||||
|
result\": json.loads(dataset_ids)\n }\n"
|
||||||
|
code_language: python3
|
||||||
|
desc: ''
|
||||||
|
outputs:
|
||||||
|
result:
|
||||||
|
children: null
|
||||||
|
type: array[string]
|
||||||
|
selected: false
|
||||||
|
title: 知识库集
|
||||||
|
type: code
|
||||||
|
variables:
|
||||||
|
- value_selector:
|
||||||
|
- '1747125462435'
|
||||||
|
- dataset_ids
|
||||||
|
value_type: string
|
||||||
|
variable: dataset_ids
|
||||||
|
height: 52
|
||||||
|
id: '1747125551298'
|
||||||
|
position:
|
||||||
|
x: 682
|
||||||
|
y: 282
|
||||||
|
positionAbsolute:
|
||||||
|
x: 682
|
||||||
|
y: 282
|
||||||
|
selected: false
|
||||||
|
sourcePosition: right
|
||||||
|
targetPosition: left
|
||||||
|
type: custom
|
||||||
|
width: 242
|
||||||
|
- data:
|
||||||
|
desc: ''
|
||||||
|
error_handle_mode: terminated
|
||||||
|
height: 231
|
||||||
|
is_parallel: true
|
||||||
|
iterator_selector:
|
||||||
|
- '1747125551298'
|
||||||
|
- result
|
||||||
|
output_selector:
|
||||||
|
- '1747125795256'
|
||||||
|
- body
|
||||||
|
output_type: array[string]
|
||||||
|
parallel_nums: 10
|
||||||
|
selected: false
|
||||||
|
start_node_id: 1747125586388start
|
||||||
|
title: 迭代
|
||||||
|
type: iteration
|
||||||
|
width: 388
|
||||||
|
height: 231
|
||||||
|
id: '1747125586388'
|
||||||
|
position:
|
||||||
|
x: 988
|
||||||
|
y: 282
|
||||||
|
positionAbsolute:
|
||||||
|
x: 988
|
||||||
|
y: 282
|
||||||
|
selected: false
|
||||||
|
sourcePosition: right
|
||||||
|
targetPosition: left
|
||||||
|
type: custom
|
||||||
|
width: 388
|
||||||
|
zIndex: 1
|
||||||
|
- data:
|
||||||
|
desc: ''
|
||||||
|
isInIteration: true
|
||||||
|
selected: false
|
||||||
|
title: ''
|
||||||
|
type: iteration-start
|
||||||
|
draggable: false
|
||||||
|
height: 48
|
||||||
|
id: 1747125586388start
|
||||||
|
parentId: '1747125586388'
|
||||||
|
position:
|
||||||
|
x: 24
|
||||||
|
y: 68
|
||||||
|
positionAbsolute:
|
||||||
|
x: 1012
|
||||||
|
y: 350
|
||||||
|
selectable: false
|
||||||
|
sourcePosition: right
|
||||||
|
targetPosition: left
|
||||||
|
type: custom-iteration-start
|
||||||
|
width: 44
|
||||||
|
zIndex: 1002
|
||||||
|
- data:
|
||||||
|
authorization:
|
||||||
|
config: null
|
||||||
|
type: no-auth
|
||||||
|
body:
|
||||||
|
data:
|
||||||
|
- id: key-value-274
|
||||||
|
key: ''
|
||||||
|
type: text
|
||||||
|
value: '{
|
||||||
|
|
||||||
|
"query": {{#1747125462435.query#}}
|
||||||
|
|
||||||
|
}'
|
||||||
|
type: json
|
||||||
|
desc: ''
|
||||||
|
headers: 'Authorization:Bearer dataset-HeDK9gHBqPnI4rBZ2q2Hm7rV
|
||||||
|
|
||||||
|
Content-Type:application/json'
|
||||||
|
isInIteration: true
|
||||||
|
isInLoop: false
|
||||||
|
iteration_id: '1747125586388'
|
||||||
|
method: post
|
||||||
|
params: ''
|
||||||
|
retry_config:
|
||||||
|
max_retries: 3
|
||||||
|
retry_enabled: true
|
||||||
|
retry_interval: 100
|
||||||
|
selected: false
|
||||||
|
ssl_verify: true
|
||||||
|
timeout:
|
||||||
|
max_connect_timeout: 0
|
||||||
|
max_read_timeout: 0
|
||||||
|
max_write_timeout: 0
|
||||||
|
title: HTTP 请求
|
||||||
|
type: http-request
|
||||||
|
url: http://192.168.0.64:7700/v1/datasets/{{#1747125586388.item#}}/retrieve
|
||||||
|
variables: []
|
||||||
|
height: 157
|
||||||
|
id: '1747125795256'
|
||||||
|
parentId: '1747125586388'
|
||||||
|
position:
|
||||||
|
x: 120.421417167448
|
||||||
|
y: 54
|
||||||
|
positionAbsolute:
|
||||||
|
x: 1108.421417167448
|
||||||
|
y: 336
|
||||||
|
selected: true
|
||||||
|
sourcePosition: right
|
||||||
|
targetPosition: left
|
||||||
|
type: custom
|
||||||
|
width: 242
|
||||||
|
zIndex: 1002
|
||||||
|
- data:
|
||||||
|
code: "\nfunction main({arg1}) {\n const result = [];\n \n // 判断arg1是否为空\n\
|
||||||
|
\ if (!arg1 || arg1.length === 0) {\n return {\n result:\
|
||||||
|
\ JSON.stringify([]) // 返回空数组的JSON字符串\n };\n }\n \n //\
|
||||||
|
\ 遍历arg1中的每个元素\n for (const str of arg1) {\n try {\n \
|
||||||
|
\ // 解析JSON\n const parsed = JSON.parse(str);\n \
|
||||||
|
\ // 检查是否有records属性且不为空数组\n if (parsed.records && Array.isArray(parsed.records)\
|
||||||
|
\ && parsed.records.length > 0) {\n result.push(...parsed.records)\n\
|
||||||
|
\ }\n } catch (e) {\n // 如果JSON解析失败,跳过这个元素\n\
|
||||||
|
\ console.error('Failed to parse JSON:', e);\n }\n \
|
||||||
|
\ }\n \n // 将结果数组转换为JSON字符串返回\n return {\n result: JSON.stringify(result)\n\
|
||||||
|
\ }\n}\n"
|
||||||
|
code_language: javascript
|
||||||
|
desc: ''
|
||||||
|
outputs:
|
||||||
|
result:
|
||||||
|
children: null
|
||||||
|
type: string
|
||||||
|
selected: false
|
||||||
|
title: 知识库检索结果整理
|
||||||
|
type: code
|
||||||
|
variables:
|
||||||
|
- value_selector:
|
||||||
|
- '1747125586388'
|
||||||
|
- output
|
||||||
|
variable: arg1
|
||||||
|
height: 52
|
||||||
|
id: '1747125859504'
|
||||||
|
position:
|
||||||
|
x: 1436
|
||||||
|
y: 282
|
||||||
|
positionAbsolute:
|
||||||
|
x: 1436
|
||||||
|
y: 282
|
||||||
|
selected: false
|
||||||
|
sourcePosition: right
|
||||||
|
targetPosition: left
|
||||||
|
type: custom
|
||||||
|
width: 242
|
||||||
|
- data:
|
||||||
|
desc: ''
|
||||||
|
outputs:
|
||||||
|
- value_selector:
|
||||||
|
- '1747125859504'
|
||||||
|
- result
|
||||||
|
value_type: string
|
||||||
|
variable: output
|
||||||
|
selected: false
|
||||||
|
title: 结束
|
||||||
|
type: end
|
||||||
|
height: 88
|
||||||
|
id: '1747125871123'
|
||||||
|
position:
|
||||||
|
x: 1739
|
||||||
|
y: 282
|
||||||
|
positionAbsolute:
|
||||||
|
x: 1739
|
||||||
|
y: 282
|
||||||
|
selected: false
|
||||||
|
sourcePosition: right
|
||||||
|
targetPosition: left
|
||||||
|
type: custom
|
||||||
|
width: 242
|
||||||
|
viewport:
|
||||||
|
x: 116.27083894320822
|
||||||
|
y: 126.27330841264018
|
||||||
|
zoom: 0.8705505632961247
|
||||||
|
rag_pipeline_variables: []
|
||||||
1075
docker/schoolNews/dify/思政小帮手.yml
Normal file
1075
docker/schoolNews/dify/思政小帮手.yml
Normal file
File diff suppressed because it is too large
Load Diff
9
docker/schoolNews/dify/部署注意点.md
Normal file
9
docker/schoolNews/dify/部署注意点.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# 1.工作流修改
|
||||||
|
## 动态知识库检索工作流
|
||||||
|
修改dataset的apikey
|
||||||
|
|
||||||
|
## 思政小帮手对话流
|
||||||
|
修改“动态知识库检索”的入参
|
||||||
|
|
||||||
|
# 2. 后端修改
|
||||||
|
修改yaml的配置内容
|
||||||
Reference in New Issue
Block a user