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 () => {
|
(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) {
|
||||||
|
|||||||
@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user