fix: file type not support

This commit is contained in:
Joel
2025-04-14 16:17:52 +08:00
parent 9d2d092e9e
commit 9a7e1be35d
2 changed files with 3 additions and 13 deletions

View File

@ -225,7 +225,6 @@ const Main: FC<IMainProps> = () => {
(async () => { (async () => {
try { try {
const [conversationData, appParams] = await Promise.all([fetchConversations(), fetchAppParams()]) const [conversationData, appParams] = await Promise.all([fetchConversations(), fetchAppParams()])
// handle current conversation id // handle current conversation id
const { data: conversations, error } = conversationData as { data: ConversationItem[]; error: string } const { data: conversations, error } = conversationData as { data: ConversationItem[]; error: string }
if (error) { if (error) {

View File

@ -16,21 +16,12 @@ export const userInputsFormToPromptVariables = (useInputs: UserInputFormItem[] |
return [] return []
const promptVariables: PromptVariable[] = [] const promptVariables: PromptVariable[] = []
useInputs.forEach((item: any) => { useInputs.forEach((item: any) => {
const isParagraph = !!item.paragraph
const [type, content] = (() => { const [type, content] = (() => {
if (isParagraph) const type = Object.keys(item)[0]
return ['paragraph', item.paragraph] return [type, item[type]]
if (item['text-input'])
return ['string', item['text-input']]
if (item.number)
return ['number', item.number]
return ['select', item.select]
})() })()
if (type === 'string' || type === 'paragraph') { if (type === 'string' || type === 'paragraph' || type === 'file' || type === 'file-list') {
promptVariables.push({ promptVariables.push({
key: content.variable, key: content.variable,
name: content.label, name: content.label,