Skip to content

Pr@main/bug md #2696

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions ui/public/fx/bochaai/detail.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
## 概述

博查工具是一个支持自然语言搜索的 Web Search API,从近百亿网页和生态内容源中搜索高质量世界知识,包括新闻、图片、视频、百科、机酒、学术等.
博查工具是一个支持自然语言搜索的 Web Search API,从近百亿网页和生态内容源中搜索高质量世界知识,包括新闻、图片、视频、百科、机酒、学术等。


## 配置

1. 获取API Key 
在[博查开放平台](https://open.bochaai.com/overview) 上申请 API 密钥。
![API Key](/ui/fx/img/bocha_APIKey.jpg)
在[博查开放平台](https://open.bochaai.com/overview) 上申请 API 密钥。
![API Key](/ui/fx/img/bocha_APIKey.jpg)
2. 在函数库中配置
在函数库的博查函数面板中,点击 … > 启用参数,填写 API 密钥,并启用博查函数。
![启动参数](/ui/fx/img/bocha_setting.jpg)
在函数库的博查函数面板中,点击 … > 启用参数,填写 API 密钥,并启用该函数。
![启动参数](/ui/fx/img/bocha_setting.jpg)
3. 在应用中使用
在高级编排应用中,点击添加组件->函数库->博查,设置使用参数。
![应用中使用](/ui/fx/img/bocha_app_used.jpg)
在高级编排应用中,点击添加组件->函数库->博查,设置使用参数。
![应用中使用](/ui/fx/img/bocha_app_used.jpg)
27 changes: 13 additions & 14 deletions ui/public/fx/google_search/detail.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@ Google 搜索工具是一个实时 API,可提取搜索引擎结果,提供来
## 配置

1. 创建 Google Custom Search Engine
在[Programmable Search Engine]https://programmablesearchengine.google.com/中 添加 Search Engine
![google 创建引擎](/ui/fx/img/google_AddSearchEngine.jpg)
在[Programmable Search Engine](https://programmablesearchengine.google.com/)中 添加 Search Engine
![google 创建引擎](/ui/fx/img/google_AddSearchEngine.jpg)
2. 获取cx参数
进入添加引擎,在【基本】菜单中获取搜索引擎的ID,即cx。
![google cx ](/ui/fx/img/google_cx.jpg) 3.获取 API Key
打开 https://developers.google.com/custom-search/v1/overview?hl=zh-cn,获取API Key。
![google API Key](/ui/fx/img/google_APIKey.jpg)

3. 配置启动参数
在Google搜索函数的启动参数中填写配置以上参数。
![启动参数](/ui/fx/img/google_setting.jpg)

4. 在应用中使用
在高级编排应用中,点击添加组件->函数库->博查,设置使用参数。
![应用中使用](/ui/fx/img/google_app_used.jpg)
进入添加的引擎详情中,在【基本】菜单中获取搜索引擎的ID,即cx。
![google cx ](/ui/fx/img/google_cx.jpg)
3.获取 API Key
打开 https://developers.google.com/custom-search/v1/overview?hl=zh-cn 获取API Key。
![google API Key](/ui/fx/img/google_APIKey.jpg)
4. 配置启动参数
在Google 搜索函数的启动参数中填写配置以上参数,并启用该函数。
![启动参数](/ui/fx/img/google_setting.jpg)
5. 在应用中使用
在高级编排应用中,点击添加组件->函数库->Google搜索,设置使用参数。
![应用中使用](/ui/fx/img/google_app_used.jpg)
Binary file added ui/public/fx/img/MySQL_app_used.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ui/public/fx/img/MySQL_setting.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ui/public/fx/img/PostgreSQL_app_used.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ui/public/fx/img/PostgreSQL_setting.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui/public/fx/img/bocha_app_used.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui/public/fx/img/bocha_setting.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui/public/fx/img/google_app_used.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui/public/fx/img/google_setting.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui/public/fx/img/langsearch_app_used.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui/public/fx/img/langsearch_setting.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 9 additions & 7 deletions ui/public/fx/langsearch/detail.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
## 概述

博查工具是一个支持自然语言搜索的 Web Search API,从近百亿网页和生态内容源中搜索高质量世界知识,包括新闻、图片、视频、百科、机酒、学术等.
LangSearch 是一个提供免费Web Search API和Rerank API的服务,支持新闻、图像、视频等内容。它结合了关键词和向量进行混合搜索,以提高准确性。


## 配置

1. 获取API Key 
在[博查开放平台](https://open.bochaai.com/overview) 上申请 API 密钥。
![API Key](/ui/fx/img/langsearch_APIKey.jpg)
在[Langsearch](https://langsearch.com/overview) 上申请 API 密钥。
![API Key](/ui/fx/img/langsearchAPI_Key.jpg)
2. 在函数库中配置
在函数库的博查函数面板中,点击 … > 启用参数,填写 API 密钥,并启用博查函数。
![启动参数](/ui/fx/img/langsearch_setting.jpg)
在函数库的LangSearch函数面板中,点击 … > 启用参数,填写 API 密钥,并启用该函数。
![启动参数](/ui/fx/img/langsearch_setting.jpg)
3. 在应用中使用
在高级编排应用中,点击添加组件->函数库->博查,设置使用参数。
![应用中使用](/ui/fx/img/langsearch_app_used.jpg)
在高级编排应用中,点击添加组件->函数库->LangSearch,设置使用参数。
![应用中使用](/ui/fx/img/langsearch_app_used.jpg)

14 changes: 14 additions & 0 deletions ui/public/fx/mysql/detail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## 概述

MySQL查询是一个连接MySQL数据库执行SQL查询的工具。


## 配置

1. 在函数库中配置启动参数
在函数库的MySQL函数面板中,点击 … > 启用参数,填写数据库连接参数,并启用该函数。
![启动参数](/ui/fx/img/MySQL_setting.jpg)
2. 在应用中使用
在高级编排应用中,点击添加组件->函数库->MySQL查询,设置查询内容。
![应用中使用](/ui/fx/img/MySQL_app_used.jpg)

14 changes: 14 additions & 0 deletions ui/public/fx/postgresql/detail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## 概述

PostgreSQL查询是一个连接PostgreSQL数据库执行SQL查询的工具。


## 配置

1. 在函数库中配置启动参数
在函数库的PostgreSQL函数面板中,点击 … > 启用参数,填写数据库连接参数,并启用该函数。
![启动参数](/ui/fx/img/PostgreSQL_setting.jpg)
2. 在应用中使用
在高级编排应用中,点击添加组件->函数库->PostgreSQL查询,设置查询内容。
![应用中使用](/ui/fx/img/PostgreSQL_app_used.jpg)

1 change: 1 addition & 0 deletions ui/src/assets/fileType/file-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<div class="item-content mb-16 lighter">

<template v-for="(answer_text, index) in answer_text_list" :key="index">
<div class="avatar mr-8" v-if="application.show_avatar">
<img v-if="application.avatar" :src="application.avatar" height="28px" width="28px" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
@touchstart="onTouchStart"
@touchmove="onTouchMove"
@touchend="onTouchEnd"
:disabled="props.disabled"
>
按住说话
</el-button>
Expand Down Expand Up @@ -47,6 +48,10 @@ const props = defineProps({
start: {
type: Boolean,
default: false
},
disabled: {
type: Boolean,
default: false
}
})
const emit = defineEmits(['TouchStart', 'TouchEnd'])
Expand All @@ -57,11 +62,19 @@ const dialogVisible = ref(false)
const message = ref('按住说话')

watch(
() => props.time,
(val) => {
if (val && val === 60) {
() => [props.time, props.start],
([time, start]) => {
if (start) {
isTouching.value = true
dialogVisible.value = true
message.value = '松开发送,上滑取消'
if (time === 60) {
dialogVisible.value = false
emit('TouchEnd', isTouching.value)
isTouching.value = false
}
} else {
dialogVisible.value = false
emit('TouchEnd', isTouching.value)
isTouching.value = false
}
}
Expand Down
15 changes: 13 additions & 2 deletions ui/src/components/ai-chat/component/chat-input-operate/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
@TouchEnd="TouchEnd"
:time="recorderTime"
:start="!mediaRecorderStatus"
:disabled="loading"
/>
<el-input
v-else
Expand Down Expand Up @@ -149,7 +150,12 @@
</el-button>
</span>
<span class="flex align-center" v-else>
<el-button text @click="startRecording" v-if="mediaRecorderStatus">
<el-button
:disabled="loading"
text
@click="startRecording"
v-if="mediaRecorderStatus"
>
<el-icon>
<Microphone />
</el-icon>
Expand All @@ -166,7 +172,7 @@
</span>
</template>

<template v-if="!startRecorderTime && !recorderLoading">
<template v-if="(!startRecorderTime && !recorderLoading) || mode === 'mobile'">
<span v-if="props.applicationDetails.file_upload_enable" class="flex align-center ml-4">
<el-upload
action="#"
Expand Down Expand Up @@ -515,7 +521,12 @@ const stopRecording = () => {
// 上传录音文件
const uploadRecording = async (audioBlob: Blob) => {
try {
// 非自动发送切换输入框
if (!props.applicationDetails.stt_autosend) {
isMicrophone.value = false
}
recorderLoading.value = true

const formData = new FormData()
formData.append('file', audioBlob, 'recording.mp3')
applicationApi
Expand Down
24 changes: 1 addition & 23 deletions ui/src/components/dynamics-form/items/label/TooltipLabel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,4 @@ defineProps<{
tooltip: string
}>()
</script>
<style lang="scss" scoped>
.aiMode-param-dialog {
padding: 8px 8px 24px 8px;

.el-dialog__header {
padding: 16px 16px 0 16px;
}

.el-dialog__body {
padding: 16px !important;
}

.dialog-max-height {
height: 550px;
}

.custom-slider {
.el-input-number.is-without-controls .el-input__wrapper {
padding: 0 !important;
}
}
}
</style>
<style lang="scss" scoped></style>
2 changes: 1 addition & 1 deletion ui/src/locales/lang/zh-CN/views/dataset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default {
datasetName: {
label: '知识库名称',
placeholder: '请输入知识库名称',
requiredMessage: '请输入应用名称'
requiredMessage: '请输入知识库名称'
},
datasetDescription: {
label: '知识库描述',
Expand Down
2 changes: 1 addition & 1 deletion ui/src/locales/lang/zh-Hant/views/dataset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default {
datasetName: {
label: '知識庫名稱',
placeholder: '請輸入知識庫名稱',
requiredMessage: '請輸入應用名稱'
requiredMessage: '請輸入知識庫名稱'
},
datasetDescription: {
label: '知識庫描述',
Expand Down
19 changes: 19 additions & 0 deletions ui/src/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -772,3 +772,22 @@ h5 {
background: #d6e2ff;
line-height: 25px;
}

// 参数设置dialog
.param-dialog {
padding: 8px 8px 24px 8px;
.el-dialog__header {
padding: 16px 16px 0 16px;
}
.el-dialog__body {
padding: 0 !important;
}
.dialog-max-height {
height: 550px;
}
.custom-slider {
.el-input-number.is-without-controls .el-input__wrapper {
padding: 0 !important;
}
}
}
2 changes: 1 addition & 1 deletion ui/src/styles/element-plus.scss
Original file line number Diff line number Diff line change
Expand Up @@ -425,5 +425,5 @@
}

.el-tree {
--el-tree-node-content-height: 32px;
--el-tree-node-content-height: 38px;
}
26 changes: 2 additions & 24 deletions ui/src/views/application/component/AIModeParamSettingDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<el-dialog
align-center
:title="$t('common.paramSetting')"
class="aiMode-param-dialog"
class="param-dialog"
v-model="dialogVisible"
style="width: 550px"
append-to-body
Expand Down Expand Up @@ -89,26 +89,4 @@ const submit = async () => {
defineExpose({ open, reset_default })
</script>

<style lang="scss" scoped>
.aiMode-param-dialog {
padding: 8px 8px 24px 8px;

.el-dialog__header {
padding: 16px 16px 0 16px;
}

.el-dialog__body {
padding: 16px !important;
}

.dialog-max-height {
height: 550px;
}

.custom-slider {
.el-input-number.is-without-controls .el-input__wrapper {
padding: 0 !important;
}
}
}
</style>
<style lang="scss" scoped></style>
2 changes: 1 addition & 1 deletion ui/src/views/application/component/AddDatasetDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const refresh = () => {

defineExpose({ open })
</script>
<style lang="scss" scoped>
<style lang="scss">
.addDataset-dialog {
padding: 0;
.el-dialog__header {
Expand Down
41 changes: 13 additions & 28 deletions ui/src/views/application/component/McpServersDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,21 @@
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<el-form label-position="top" ref="paramFormRef" :model="form"
require-asterisk-position="right">
<el-form
label-position="top"
ref="paramFormRef"
:model="form"
require-asterisk-position="right"
>
<el-form-item label="MCP" prop="mcp_enable">
<el-switch v-model="form.mcp_enable" />
</el-form-item>
<el-form-item v-if="form.mcp_enable" label="MCP Server Config" prop="mcp_servers"
:rules="[{ required: true, message: $t('common.required') }]">
<el-form-item
v-if="form.mcp_enable"
label="MCP Server Config"
prop="mcp_servers"
:rules="[{ required: true, message: $t('common.required') }]"
>
<el-input
v-model="form.mcp_servers"
:rows="6"
Expand Down Expand Up @@ -49,7 +57,6 @@ const mcpServerJson = `{
}
}`


const form = ref<any>({
mcp_servers: '',
mcp_enable: false
Expand Down Expand Up @@ -82,26 +89,4 @@ const submit = () => {

defineExpose({ open })
</script>
<style lang="scss" scoped>
.param-dialog {
padding: 8px 8px 24px 8px;

.el-dialog__header {
padding: 16px 16px 0 16px;
}

.el-dialog__body {
padding: 0 !important;
}

.dialog-max-height {
height: 560px;
}

.custom-slider {
.el-input-number.is-without-controls .el-input__wrapper {
padding: 0 !important;
}
}
}
</style>
<style lang="scss" scoped></style>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code looks generally correct and has no significant issues or optimization opportunities based on the provided information. The structure of the component is organized well, with labels aligned correctly for readability. The conditional rendering based on the mcp_enable boolean ensures dynamic content display.

Suggestions:

  1. Avoid Redundant Comments: There seems to be some redundant comments within the <el-form> tag (e.g., before each property). Consider removing them if they do not add clarity.

  2. Simplify CSS Scope: If you intend to use specific styles only within this component, consider using local scoped CSS instead of global scoped styles (scoped). Ensure that all class names used match the scope prefix specified at the beginning of the SCSS file.

Overall, the code is clean and functional. No further improvements are necessary without additional context about potential future needs or changes.

Loading