mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(OpenAI Node): Update models to only show those supported (#5805)
This commit is contained in:
parent
e6ad17ec64
commit
29959be688
|
@ -35,39 +35,53 @@ const completeOperations: INodeProperties[] = [
|
||||||
name: 'model',
|
name: 'model',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
description:
|
description:
|
||||||
'The model to use. Currently, only gpt-3.5-turbo and gpt-3.5-turbo-0301 are supported.',
|
'The model which will generate the completion. <a href="https://beta.openai.com/docs/models/overview">Learn more</a>.',
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
operation: ['complete'],
|
operation: ['complete'],
|
||||||
resource: ['chat'],
|
resource: ['chat'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
options: [
|
typeOptions: {
|
||||||
{
|
loadOptions: {
|
||||||
name: 'gpt-3.5-turbo',
|
routing: {
|
||||||
value: 'gpt-3.5-turbo',
|
request: {
|
||||||
|
method: 'GET',
|
||||||
|
url: '/v1/models',
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
postReceive: [
|
||||||
|
{
|
||||||
|
type: 'rootProperty',
|
||||||
|
properties: {
|
||||||
|
property: 'data',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'filter',
|
||||||
|
properties: {
|
||||||
|
pass: "={{ $responseItem.id.startsWith('gpt-') }}",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'setKeyValue',
|
||||||
|
properties: {
|
||||||
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased-id
|
||||||
|
name: '={{$responseItem.id}}',
|
||||||
|
value: '={{$responseItem.id}}',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'sort',
|
||||||
|
properties: {
|
||||||
|
key: 'name',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
},
|
||||||
name: 'gpt-3.5-turbo-0301',
|
|
||||||
value: 'gpt-3.5-turbo-0301',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'gpt-4',
|
|
||||||
value: 'gpt-4',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'gpt-4-0314',
|
|
||||||
value: 'gpt-4-0314',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'gpt-4-32k',
|
|
||||||
value: 'gpt-4-32k',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'gpt-4-32k-0314',
|
|
||||||
value: 'gpt-4-32k-0314',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
routing: {
|
routing: {
|
||||||
send: {
|
send: {
|
||||||
type: 'body',
|
type: 'body',
|
||||||
|
|
|
@ -84,7 +84,7 @@ const completeOperations: INodeProperties[] = [
|
||||||
{
|
{
|
||||||
type: 'filter',
|
type: 'filter',
|
||||||
properties: {
|
properties: {
|
||||||
pass: "={{ !$responseItem.id.startsWith('audio-') && !['cushman:2020-05-03', 'davinci-if:3.0.0', 'davinci-instruct-beta:2.0.0', 'if'].includes($responseItem.id) && !$responseItem.id.includes('-edit-') && !$responseItem.id.endsWith(':001') }}",
|
pass: "={{ !$responseItem.id.startsWith('audio-') && !$responseItem.id.startsWith('gpt-') && !$responseItem.id.startsWith('whisper-') && !['cushman:2020-05-03', 'davinci-if:3.0.0', 'davinci-instruct-beta:2.0.0', 'if'].includes($responseItem.id) && !$responseItem.id.includes('-edit-') && !$responseItem.id.endsWith(':001') }}",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue