Bugfix/Overrideconfig for form data body (#3932)

fix overrideconfig for form data body
This commit is contained in:
Henry Heng
2025-01-27 11:19:26 +00:00
committed by GitHub
parent a2a475ba7a
commit 6e95989647
2 changed files with 4 additions and 5 deletions
+2 -2
View File
@@ -238,7 +238,7 @@ export const executeFlow = async ({
signal signal
}: IExecuteFlowParams) => { }: IExecuteFlowParams) => {
const question = incomingInput.question const question = incomingInput.question
const overrideConfig = incomingInput.overrideConfig ?? {} let overrideConfig = incomingInput.overrideConfig ?? {}
const uploads = incomingInput.uploads const uploads = incomingInput.uploads
const prependMessages = incomingInput.history ?? [] const prependMessages = incomingInput.history ?? []
const streaming = incomingInput.streaming const streaming = incomingInput.streaming
@@ -316,7 +316,7 @@ export const executeFlow = async ({
// Process form data body with files // Process form data body with files
if (files?.length) { if (files?.length) {
const overrideConfig: ICommonObject = { ...incomingInput } overrideConfig = { ...incomingInput }
for (const file of files) { for (const file of files) {
const fileNames: string[] = [] const fileNames: string[] = []
const fileBuffer = await getFileFromUpload(file.path ?? file.key) const fileBuffer = await getFileFromUpload(file.path ?? file.key)
+2 -3
View File
@@ -2,7 +2,6 @@ import { Request } from 'express'
import * as path from 'path' import * as path from 'path'
import { cloneDeep, omit } from 'lodash' import { cloneDeep, omit } from 'lodash'
import { import {
ICommonObject,
IMessage, IMessage,
addArrayFilesToStorage, addArrayFilesToStorage,
mapMimeTypeToInputField, mapMimeTypeToInputField,
@@ -47,7 +46,7 @@ export const executeUpsert = async ({
files files
}: IExecuteFlowParams) => { }: IExecuteFlowParams) => {
const question = incomingInput.question const question = incomingInput.question
const overrideConfig = incomingInput.overrideConfig ?? {} let overrideConfig = incomingInput.overrideConfig ?? {}
let stopNodeId = incomingInput?.stopNodeId ?? '' let stopNodeId = incomingInput?.stopNodeId ?? ''
const chatHistory: IMessage[] = [] const chatHistory: IMessage[] = []
const isUpsert = true const isUpsert = true
@@ -55,7 +54,7 @@ export const executeUpsert = async ({
const apiMessageId = uuidv4() const apiMessageId = uuidv4()
if (files?.length) { if (files?.length) {
const overrideConfig: ICommonObject = { ...incomingInput } overrideConfig = { ...incomingInput }
for (const file of files) { for (const file of files) {
const fileNames: string[] = [] const fileNames: string[] = []
const fileBuffer = await getFileFromUpload(file.path ?? file.key) const fileBuffer = await getFileFromUpload(file.path ?? file.key)