Skip to content

Commit 6e95989

Browse files
authored
Bugfix/Overrideconfig for form data body (#3932)
fix overrideconfig for form data body
1 parent a2a475b commit 6e95989

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

packages/server/src/utils/buildChatflow.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ export const executeFlow = async ({
238238
signal
239239
}: IExecuteFlowParams) => {
240240
const question = incomingInput.question
241-
const overrideConfig = incomingInput.overrideConfig ?? {}
241+
let overrideConfig = incomingInput.overrideConfig ?? {}
242242
const uploads = incomingInput.uploads
243243
const prependMessages = incomingInput.history ?? []
244244
const streaming = incomingInput.streaming
@@ -316,7 +316,7 @@ export const executeFlow = async ({
316316

317317
// Process form data body with files
318318
if (files?.length) {
319-
const overrideConfig: ICommonObject = { ...incomingInput }
319+
overrideConfig = { ...incomingInput }
320320
for (const file of files) {
321321
const fileNames: string[] = []
322322
const fileBuffer = await getFileFromUpload(file.path ?? file.key)

packages/server/src/utils/upsertVector.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { Request } from 'express'
22
import * as path from 'path'
33
import { cloneDeep, omit } from 'lodash'
44
import {
5-
ICommonObject,
65
IMessage,
76
addArrayFilesToStorage,
87
mapMimeTypeToInputField,
@@ -47,15 +46,15 @@ export const executeUpsert = async ({
4746
files
4847
}: IExecuteFlowParams) => {
4948
const question = incomingInput.question
50-
const overrideConfig = incomingInput.overrideConfig ?? {}
49+
let overrideConfig = incomingInput.overrideConfig ?? {}
5150
let stopNodeId = incomingInput?.stopNodeId ?? ''
5251
const chatHistory: IMessage[] = []
5352
const isUpsert = true
5453
const chatflowid = chatflow.id
5554
const apiMessageId = uuidv4()
5655

5756
if (files?.length) {
58-
const overrideConfig: ICommonObject = { ...incomingInput }
57+
overrideConfig = { ...incomingInput }
5958
for (const file of files) {
6059
const fileNames: string[] = []
6160
const fileBuffer = await getFileFromUpload(file.path ?? file.key)

0 commit comments

Comments
 (0)