diff --git a/app/components/index.tsx b/app/components/index.tsx index e2622c3..4d7b28e 100644 --- a/app/components/index.tsx +++ b/app/components/index.tsx @@ -225,7 +225,6 @@ const Main: FC = () => { (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) { diff --git a/utils/prompt.ts b/utils/prompt.ts index fc11182..a911d22 100644 --- a/utils/prompt.ts +++ b/utils/prompt.ts @@ -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,