diff --git a/packages/nodes-base/nodes/OpenAi/ChatDescription.ts b/packages/nodes-base/nodes/OpenAi/ChatDescription.ts index a627ed8457578..9812d5dffbe83 100644 --- a/packages/nodes-base/nodes/OpenAi/ChatDescription.ts +++ b/packages/nodes-base/nodes/OpenAi/ChatDescription.ts @@ -1,5 +1,4 @@ import type { INodeExecutionData, INodeProperties } from 'n8n-workflow'; -import { chatBodyPresend } from './ChatFunctions'; export const chatOperations: INodeProperties[] = [ { @@ -115,7 +114,7 @@ const completeOperations: INodeProperties[] = [ send: { type: 'body', property: 'messages', - preSend: [chatBodyPresend], + value: '={{ $value.messages }}', }, }, }, diff --git a/packages/nodes-base/nodes/OpenAi/ChatFunctions.ts b/packages/nodes-base/nodes/OpenAi/ChatFunctions.ts deleted file mode 100644 index b87a4f9c8c812..0000000000000 --- a/packages/nodes-base/nodes/OpenAi/ChatFunctions.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { IDataObject, IExecuteSingleFunctions, IHttpRequestOptions } from 'n8n-workflow'; - -export async function chatBodyPresend( - this: IExecuteSingleFunctions, - requestOptions: IHttpRequestOptions, -): Promise { - const prompts = this.getNodeParameter('prompt', '{}') as IDataObject; - - requestOptions.body = Object.assign({}, requestOptions.body, { - messages: prompts.messages, - }); - - return requestOptions; -}