fix(OpenAI Node): Load correct models for operation (#8313)

This commit is contained in:
Michael Kret
2024-01-15 15:13:38 +02:00
committed by GitHub
parent c8a2fe05d2
commit a6a5372b5f
4 changed files with 128 additions and 3 deletions

View File

@@ -114,6 +114,68 @@ const createOperations: INodeProperties[] = [
show: {
resource: ['image'],
operation: ['create'],
'@version': [1],
},
},
routing: {
send: {
type: 'body',
property: 'model',
},
},
},
{
displayName: 'Model',
name: 'imageModel',
type: 'options',
default: 'dall-e-2',
description: 'The model to use for image generation',
typeOptions: {
loadOptions: {
routing: {
request: {
method: 'GET',
url: '/v1/models',
},
output: {
postReceive: [
{
type: 'rootProperty',
properties: {
property: 'data',
},
},
{
type: 'filter',
properties: {
pass: "={{ $responseItem.id.startsWith('dall-') }}",
},
},
{
type: 'setKeyValue',
properties: {
name: '={{$responseItem.id}}',
value: '={{$responseItem.id}}',
},
},
{
type: 'sort',
properties: {
key: 'name',
},
},
],
},
},
},
},
displayOptions: {
show: {
resource: ['image'],
operation: ['create'],
},
hide: {
'@version': [1],
},
},
routing: {