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' };