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 () => {
try {
const [conversationData, appParams] = await Promise.all([fetchConversations(), fetchAppParams()])
// handle current conversation id
const { data: conversations, error } = conversationData as { data: ConversationItem[]; error: string }
if (error) {

View File

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