diff --git a/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/FlowiseChatGoogleGenerativeAI.ts b/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/FlowiseChatGoogleGenerativeAI.ts index 89981e871..e99392a5f 100644 --- a/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/FlowiseChatGoogleGenerativeAI.ts +++ b/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/FlowiseChatGoogleGenerativeAI.ts @@ -552,6 +552,13 @@ function zodToGeminiParameters(zodObj: any) { const jsonSchema: any = zodToJsonSchema(zodObj) // eslint-disable-next-line unused-imports/no-unused-vars const { $schema, additionalProperties, ...rest } = jsonSchema + if (rest.properties) { + Object.keys(rest.properties).forEach((key) => { + if (rest.properties[key].enum?.length) { + rest.properties[key] = { type: 'string', format: 'enum', enum: rest.properties[key].enum } + } + }) + } return rest } diff --git a/packages/components/nodes/multiagents/Supervisor/Supervisor.ts b/packages/components/nodes/multiagents/Supervisor/Supervisor.ts index 0a799d9a2..f3bc403ca 100644 --- a/packages/components/nodes/multiagents/Supervisor/Supervisor.ts +++ b/packages/components/nodes/multiagents/Supervisor/Supervisor.ts @@ -273,10 +273,8 @@ class Supervisor_MultiAgents implements INode { * So we have to place the system + human prompt at last */ let prompt = ChatPromptTemplate.fromMessages([ - ['human', systemPrompt], - ['ai', ''], + ['system', systemPrompt], new MessagesPlaceholder('messages'), - ['ai', ''], ['human', userPrompt] ])