mirror of
https://github.com/langgenius/webapp-conversation.git
synced 2025-12-08 17:32:27 +08:00
fix: file type not support
This commit is contained in:
@ -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) {
|
||||
|
||||
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user