diff --git a/ui/src/components/ai-chat/component/chat-input-operate/index.vue b/ui/src/components/ai-chat/component/chat-input-operate/index.vue
index 5739d68ae24..4240df59962 100644
--- a/ui/src/components/ai-chat/component/chat-input-operate/index.vue
+++ b/ui/src/components/ai-chat/component/chat-input-operate/index.vue
@@ -210,10 +210,9 @@
@paste="handlePaste"
class="chat-operate-textarea"
/>
-
-
+
@@ -922,9 +921,7 @@ function autoSendMessage() {
quickInputRef.value.textarea.style.height = '45px'
}
})
- .catch(() => {
- emit('update:showUserInput', true)
- })
+ .catch(() => {})
}
function sendChatHandle(event?: any) {
diff --git a/ui/src/components/ai-chat/component/inline-params/InlineFormItem.vue b/ui/src/components/ai-chat/component/inline-params/InlineFormItem.vue
new file mode 100644
index 00000000000..befe04f55bf
--- /dev/null
+++ b/ui/src/components/ai-chat/component/inline-params/InlineFormItem.vue
@@ -0,0 +1,157 @@
+
+
+
+
+
diff --git a/ui/src/components/ai-chat/component/inline-params/index.vue b/ui/src/components/ai-chat/component/inline-params/index.vue
new file mode 100644
index 00000000000..464276e05f6
--- /dev/null
+++ b/ui/src/components/ai-chat/component/inline-params/index.vue
@@ -0,0 +1,264 @@
+
+
+
+
+
diff --git a/ui/src/components/ai-chat/component/user-form/index.vue b/ui/src/components/ai-chat/component/user-form/index.vue
index 327ec2cf4a6..07f1bebf4fa 100644
--- a/ui/src/components/ai-chat/component/user-form/index.vue
+++ b/ui/src/components/ai-chat/component/user-form/index.vue
@@ -8,8 +8,8 @@
>
-
- {{ inputFieldConfig.title }}
+
+ {{ props.title || '更多设置' }}
@@ -66,6 +66,8 @@ const props = defineProps<{
api_form_data: any
form_data: any
first?: boolean
+ excludeFields?: string[]
+ title?: string
}>()
// 用于刷新动态表单
const dynamicsFormRefresh = ref(0)
@@ -191,7 +193,11 @@ function handleInputFieldList() {
}
})
: []
-
+ if (props.excludeFields?.length) {
+ inputFieldList.value = inputFieldList.value.filter(
+ (f: any) => !props.excludeFields!.includes(f.field),
+ )
+ }
apiInputFieldList.value = v.properties.api_input_field_list
? v.properties.api_input_field_list.map((v: any) => {
switch (v.type) {
diff --git a/ui/src/components/ai-chat/index.vue b/ui/src/components/ai-chat/index.vue
index c784ff1c997..77d6815a452 100644
--- a/ui/src/components/ai-chat/index.vue
+++ b/ui/src/components/ai-chat/index.vue
@@ -14,14 +14,21 @@
-
+ />
@@ -141,17 +148,15 @@
v-model:show-user-input="showUserInput"
v-else-if="type !== 'log' && type !== 'share'"
>
-
-
+
-
-
- {{ userInputTitle || $t('chat.userInput') }}
-
-
+
@@ -196,6 +201,7 @@ import { throttle } from 'lodash-es'
import { copyClick } from '@/utils/clipboard'
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
import { getWrite } from '@/utils/chat'
+import InlineParams from '@/components/ai-chat/component/inline-params/index.vue'
provide('upload', (file: any, loading?: Ref) => {
return props.type === 'debug-ai-chat'
@@ -273,6 +279,8 @@ const showUserInput = ref(false)
const initialFormData = ref({})
const initialApiFormData = ref({})
+const inlineParamsRef = ref>()
+
const isUserInput = computed(
() =>
props.applicationDetails?.work_flow?.nodes?.filter((v: any) => v.id === 'base-node')[0]
@@ -304,11 +312,6 @@ watch(
firsUserInput.value = false
} else {
chartOpenId.value = ''
- if (isUserInput.value) {
- firsUserInput.value = true
- } else if (props.type == 'debug-ai-chat' && isAPIInput.value) {
- firsUserInput.value = true
- }
}
},
{ deep: true, immediate: true },
@@ -391,6 +394,12 @@ function toggleSelect(id: number) {
}
}
+const handleOpenDialog = () => {
+ showUserInput.value = true
+ initialFormData.value = JSON.parse(JSON.stringify(form_data.value))
+ initialApiFormData.value = JSON.parse(JSON.stringify(api_form_data.value))
+}
+
function cancelCheckHandle() {
checkAll.value = false
multipleSelectionChat.value = []
@@ -420,7 +429,7 @@ function UserFormCancel() {
}
const validate = () => {
- return userFormRef.value?.validate() || Promise.reject(false)
+ return inlineParamsRef.value?.validate() || Promise.resolve(true)
}
function sendMessage(val: string, other_params_data?: any, chat?: chatType): Promise {
@@ -561,7 +570,6 @@ function getChartOpenId(chat?: any, problem?: string, re_chat?: boolean, other_p
})
}
-
const errorWrite = (chat: any, message?: string) => {
ChatManagement.addChatRecord(chat, 50, loading)
ChatManagement.write(chat.id)
diff --git a/ui/src/components/dynamics-form/index.vue b/ui/src/components/dynamics-form/index.vue
index a6ad5f18ab5..64bcaf47199 100644
--- a/ui/src/components/dynamics-form/index.vue
+++ b/ui/src/components/dynamics-form/index.vue
@@ -266,7 +266,9 @@ const getFormDefaultValue = (fieldList: Array, form_data?: any) => {
if (typeof form_data[item.field] === 'string') {
return i[value_field] === form_data[item.field]
} else {
- return form_data[item.field].indexOf([value_field]) === -1
+ return form_data[item.field]
+ ? form_data[item.field].indexOf([value_field]) === -1
+ : false
}
})
if (find) {
diff --git a/ui/src/components/dynamics-form/items/common/SelectHeader.vue b/ui/src/components/dynamics-form/items/common/SelectHeader.vue
new file mode 100644
index 00000000000..019593c3827
--- /dev/null
+++ b/ui/src/components/dynamics-form/items/common/SelectHeader.vue
@@ -0,0 +1,30 @@
+
+
+
{{ header.label }}
+
*
+
+
+ {{ header.tooltip }}
+
+
+
+
+
+
+
diff --git a/ui/src/components/dynamics-form/items/knowledge/Knowledge.vue b/ui/src/components/dynamics-form/items/knowledge/Knowledge.vue
index 901c2b149dc..5434c271ebc 100644
--- a/ui/src/components/dynamics-form/items/knowledge/Knowledge.vue
+++ b/ui/src/components/dynamics-form/items/knowledge/Knowledge.vue
@@ -6,6 +6,9 @@
class="w-full"
:placeholder="$t('views.chatLog.selectKnowledgePlaceholder')"
>
+
+
+
@@ -30,6 +33,7 @@
import { computed } from 'vue'
import type { FormField } from '../../type'
import { relatedObject } from '@/utils/array'
+import SelectHeader from '@/components/dynamics-form/items/common/SelectHeader.vue'
const props = withDefaults(
defineProps<{
modelValue?: string[]
diff --git a/ui/src/components/dynamics-form/items/model/Model.vue b/ui/src/components/dynamics-form/items/model/Model.vue
index 8c42b876f59..954330fcbbf 100644
--- a/ui/src/components/dynamics-form/items/model/Model.vue
+++ b/ui/src/components/dynamics-form/items/model/Model.vue
@@ -6,6 +6,9 @@
v-bind="$attrs"
popper-class="select-model"
>
+
+
+
import { ref, computed } from 'vue'
import { groupBy, flatMap } from 'lodash'
+import SelectHeader from '@/components/dynamics-form/items/common/SelectHeader.vue'
import { relatedObject } from '@/utils/array'
import type { FormField } from '../../type'
import { providerList } from './provider-data'
diff --git a/ui/src/components/dynamics-form/items/select/MultiSelect.vue b/ui/src/components/dynamics-form/items/select/MultiSelect.vue
index b5332780ac7..dae4681a77b 100644
--- a/ui/src/components/dynamics-form/items/select/MultiSelect.vue
+++ b/ui/src/components/dynamics-form/items/select/MultiSelect.vue
@@ -10,6 +10,9 @@
v-bind="$attrs"
v-model="_modelValue"
>
+
+
+
+
diff --git a/ui/src/workflow/nodes/base-node/component/UserInputFieldTable.vue b/ui/src/workflow/nodes/base-node/component/UserInputFieldTable.vue
index 92914fb2d37..84973935694 100644
--- a/ui/src/workflow/nodes/base-node/component/UserInputFieldTable.vue
+++ b/ui/src/workflow/nodes/base-node/component/UserInputFieldTable.vue
@@ -111,7 +111,11 @@ function openAddDialog(data?: any, index?: any) {
}
function openChangeTitleDialog() {
- UserInputTitleDialogRef.value.open(inputFieldConfig.value)
+ UserInputTitleDialogRef.value.open(
+ inputFieldConfig.value,
+ inputFieldList.value,
+ props.nodeModel.properties.user_input_field_list_setting,
+ )
}
function deleteField(index: any) {
@@ -145,8 +149,10 @@ function refreshFieldList(data: any, index: any) {
onDragHandle()
}
-function refreshFieldTitle(data: any) {
- inputFieldConfig.value = data
+function refreshFieldTitle(setting: any) {
+ if (setting) {
+ set(props.nodeModel.properties, 'user_input_field_list_setting', setting)
+ }
UserInputTitleDialogRef.value.close()
}
diff --git a/ui/src/workflow/nodes/base-node/component/UserInputTitleDialog.vue b/ui/src/workflow/nodes/base-node/component/UserInputTitleDialog.vue
index 08c2f48c32f..e318becf056 100644
--- a/ui/src/workflow/nodes/base-node/component/UserInputTitleDialog.vue
+++ b/ui/src/workflow/nodes/base-node/component/UserInputTitleDialog.vue
@@ -16,12 +16,26 @@
require-asterisk-position="right"
@submit.prevent
>
-
+
+
+
+
+
+
@@ -36,32 +50,49 @@