Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(openai): add reasoning_effort option to chat completions #13056

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 34 additions & 4 deletions packages/nodes-base/nodes/OpenAi/ChatDescription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ const sharedOperations: INodeProperties[] = [
],
},
},
description: 'Whether to return a simplified version of the response instead of the raw data',
description:
'Whether to return a simplified version of the response instead of the raw data',
},

{
Expand All @@ -280,7 +281,8 @@ const sharedOperations: INodeProperties[] = [
displayName: 'Echo Prompt',
name: 'echo',
type: 'boolean',
description: 'Whether the prompt should be echo back in addition to the completion',
description:
'Whether the prompt should be echo back in addition to the completion',
default: false,
displayOptions: {
show: {
Expand Down Expand Up @@ -390,18 +392,46 @@ const sharedOperations: INodeProperties[] = [
},
},
},
{
displayName: 'Reasoning Effort',
name: 'reasoning_effort',
type: 'options',
description:
'Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. (o1 models only)',
options: [
{
name: 'Low',
value: 'low',
},
{
name: 'Medium',
value: 'medium',
},
{
name: 'High',
value: 'high',
},
],
default: 'medium',
routing: {
send: {
type: 'body',
property: 'reasoning_effort',
},
},
},
],
},
];

export const chatFields: INodeProperties[] = [
/* -------------------------------------------------------------------------- */
/* chat:complete */
/* chat:complete */
/* -------------------------------------------------------------------------- */
...completeOperations,

/* -------------------------------------------------------------------------- */
/* chat:ALL */
/* chat:ALL */
/* -------------------------------------------------------------------------- */
...sharedOperations,
];