Skip to content

Commit

Permalink
Bugfix/Overrideconfig for form data body (FlowiseAI#3932)
Browse files Browse the repository at this point in the history
fix overrideconfig for form data body
  • Loading branch information
HenryHengZJ authored Jan 27, 2025
1 parent a2a475b commit 6e95989
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/server/src/utils/buildChatflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export const executeFlow = async ({
signal
}: IExecuteFlowParams) => {
const question = incomingInput.question
const overrideConfig = incomingInput.overrideConfig ?? {}
let overrideConfig = incomingInput.overrideConfig ?? {}
const uploads = incomingInput.uploads
const prependMessages = incomingInput.history ?? []
const streaming = incomingInput.streaming
Expand Down Expand Up @@ -316,7 +316,7 @@ export const executeFlow = async ({

// Process form data body with files
if (files?.length) {
const overrideConfig: ICommonObject = { ...incomingInput }
overrideConfig = { ...incomingInput }
for (const file of files) {
const fileNames: string[] = []
const fileBuffer = await getFileFromUpload(file.path ?? file.key)
Expand Down
5 changes: 2 additions & 3 deletions packages/server/src/utils/upsertVector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Request } from 'express'
import * as path from 'path'
import { cloneDeep, omit } from 'lodash'
import {
ICommonObject,
IMessage,
addArrayFilesToStorage,
mapMimeTypeToInputField,
Expand Down Expand Up @@ -47,15 +46,15 @@ export const executeUpsert = async ({
files
}: IExecuteFlowParams) => {
const question = incomingInput.question
const overrideConfig = incomingInput.overrideConfig ?? {}
let overrideConfig = incomingInput.overrideConfig ?? {}
let stopNodeId = incomingInput?.stopNodeId ?? ''
const chatHistory: IMessage[] = []
const isUpsert = true
const chatflowid = chatflow.id
const apiMessageId = uuidv4()

if (files?.length) {
const overrideConfig: ICommonObject = { ...incomingInput }
overrideConfig = { ...incomingInput }
for (const file of files) {
const fileNames: string[] = []
const fileBuffer = await getFileFromUpload(file.path ?? file.key)
Expand Down

0 comments on commit 6e95989

Please sign in to comment.