mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-13 16:14:07 -08:00
15 lines
437 B
TypeScript
15 lines
437 B
TypeScript
import type { IDataObject, IExecuteSingleFunctions, IHttpRequestOptions } from 'n8n-workflow';
|
|
|
|
export async function chatBodyPresend(
|
|
this: IExecuteSingleFunctions,
|
|
requestOptions: IHttpRequestOptions,
|
|
): Promise<IHttpRequestOptions> {
|
|
const prompts = this.getNodeParameter('prompt', '{}') as IDataObject;
|
|
|
|
requestOptions.body = Object.assign({}, requestOptions.body, {
|
|
messages: prompts.messages,
|
|
});
|
|
|
|
return requestOptions;
|
|
}
|