1
1
mirror of https://github.com/n8n-io/n8n.git synced 2024-09-19 17:07:18 +03:00

fix(OpenAI Node): Message text operation parameters case fix (#8804)

This commit is contained in:
Michael Kret 2024-03-05 15:46:03 +02:00 committed by GitHub
parent 4850f6a9cc
commit e38e96bbec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -171,6 +171,16 @@ export async function execute(this: IExecuteFunctions, i: number): Promise<INode
const options = this.getNodeParameter('options', i, {});
const jsonOutput = this.getNodeParameter('jsonOutput', i, false) as boolean;
if (options.maxTokens !== undefined) {
options.max_tokens = options.maxTokens;
delete options.maxTokens;
}
if (options.topP !== undefined) {
options.top_p = options.topP;
delete options.topP;
}
let response_format;
if (jsonOutput) {
response_format = { type: 'json_object' };