diff --git a/app/server/appsmith-plugins/openAiPlugin/src/main/resources/editor/chat.json b/app/server/appsmith-plugins/openAiPlugin/src/main/resources/editor/chat.json index c29af65c27..73feb0ca80 100644 --- a/app/server/appsmith-plugins/openAiPlugin/src/main/resources/editor/chat.json +++ b/app/server/appsmith-plugins/openAiPlugin/src/main/resources/editor/chat.json @@ -1,92 +1,99 @@ { "identifier": "CHAT", - "controlType": "SECTION", + "controlType": "SECTION_V2", "conditionals": { "show": "{{actionConfiguration.formData.command.data === 'CHAT'}}" }, "children": [ { - "label": "Models", - "tooltipText": "Select the model for response generation", - "subtitle": "ID of the model to use.", - "isRequired": true, - "propertyName": "chat_model_id", - "configProperty": "actionConfiguration.formData.chatModel.data", - "controlType": "DROP_DOWN", - "initialValue": "", - "options": [], - "placeholderText": "All models will be fetched.", - "fetchOptionsConditionally": true, - "setFirstOptionAsDefault": true, - "alternateViewTypes": ["json"], - "conditionals": { - "enable": "{{true}}", - "fetchDynamicValues": { - "condition": "{{actionConfiguration.formData.command.data === 'CHAT'}}", - "config": { - "params": { - "requestType": "CHAT_MODELS", - "displayType": "DROP_DOWN" + "controlType": "DOUBLE_COLUMN_ZONE", + "children": [ + { + "label": "Models", + "tooltipText": "Select the model for response generation", + "subtitle": "ID of the model to use.", + "isRequired": true, + "propertyName": "chat_model_id", + "configProperty": "actionConfiguration.formData.chatModel.data", + "controlType": "DROP_DOWN", + "initialValue": "", + "options": [], + "placeholderText": "All models will be fetched.", + "fetchOptionsConditionally": true, + "setFirstOptionAsDefault": true, + "alternateViewTypes": ["json"], + "conditionals": { + "enable": "{{true}}", + "fetchDynamicValues": { + "condition": "{{actionConfiguration.formData.command.data === 'CHAT'}}", + "config": { + "params": { + "requestType": "CHAT_MODELS", + "displayType": "DROP_DOWN" + } + } } } - } - } - }, - { - "label": "Max Tokens", - "tooltipText": "The maximum number of tokens to generate in the chat completion.", - "subtitle": "The maximum number of tokens to generate in the chat completion.", - "Description": "Put a positive integer value", - "configProperty": "actionConfiguration.formData.maxTokens", - "controlType": "INPUT_TEXT", - "initialValue": "16", - "isRequired": true, - "dataType": "NUMBER", - "customStyles": { - "width": "270px", - "minWidth": "270px" - } - }, - { - "label": "Messages", - "tooltipText": "Ask a question", - "subtitle": "A list of messages comprising the conversation so far.", - "propertyName": "messages", - "isRequired": true, - "configProperty": "actionConfiguration.formData.messages.data", - "controlType": "ARRAY_FIELD", - "alternateViewTypes": ["json"], - "addMoreButtonLabel": "Add message", - "schema": [ - { - "label": "Role", - "key": "role", - "controlType": "QUERY_DYNAMIC_INPUT_TEXT", - "placeholderText": "user OR system", - "initialValue": "user" }, { - "label": "Content", - "key": "content", - "controlType": "QUERY_DYNAMIC_INPUT_TEXT", - "placeholderText": "{{ UserInput.text }}" + "label": "Max Tokens", + "tooltipText": "The maximum number of tokens to generate in the chat completion.", + "subtitle": "The maximum number of tokens to generate in the chat completion.", + "Description": "Put a positive integer value", + "configProperty": "actionConfiguration.formData.maxTokens", + "controlType": "INPUT_TEXT", + "initialValue": "16", + "isRequired": true, + "dataType": "NUMBER" } ] }, { - "label": "Temperature", - "tooltipText": "Put a value between 0 and 2", - "Description": "Put a value between 0 and 2", - "subtitle": "What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.", - "configProperty": "actionConfiguration.formData.temperature", - "controlType": "INPUT_TEXT", - "dataType": "NUMBER", - "initialValue": "0", - "isRequired": false, - "customStyles": { - "width": "270px", - "minWidth": "270px" - } + "controlType": "SINGLE_COLUMN_ZONE", + "children": [ + { + "label": "Messages", + "tooltipText": "Ask a question", + "subtitle": "A list of messages comprising the conversation so far.", + "propertyName": "messages", + "isRequired": true, + "configProperty": "actionConfiguration.formData.messages.data", + "controlType": "ARRAY_FIELD", + "alternateViewTypes": ["json"], + "addMoreButtonLabel": "Add message", + "schema": [ + { + "label": "Role", + "key": "role", + "controlType": "QUERY_DYNAMIC_INPUT_TEXT", + "placeholderText": "user OR system", + "initialValue": "user" + }, + { + "label": "Content", + "key": "content", + "controlType": "QUERY_DYNAMIC_INPUT_TEXT", + "placeholderText": "{{ UserInput.text }}" + } + ] + } + ] + }, + { + "controlType": "DOUBLE_COLUMN_ZONE", + "children": [ + { + "label": "Temperature", + "tooltipText": "Put a value between 0 and 2", + "Description": "Put a value between 0 and 2", + "subtitle": "What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.", + "configProperty": "actionConfiguration.formData.temperature", + "controlType": "INPUT_TEXT", + "dataType": "NUMBER", + "initialValue": "0", + "isRequired": false + } + ] } ] } diff --git a/app/server/appsmith-plugins/openAiPlugin/src/main/resources/editor/embeddings.json b/app/server/appsmith-plugins/openAiPlugin/src/main/resources/editor/embeddings.json index 362172f9de..eb5560da1e 100644 --- a/app/server/appsmith-plugins/openAiPlugin/src/main/resources/editor/embeddings.json +++ b/app/server/appsmith-plugins/openAiPlugin/src/main/resources/editor/embeddings.json @@ -1,63 +1,78 @@ { "identifier": "EMBEDDINGS", - "controlType": "SECTION", + "controlType": "SECTION_V2", "conditionals": { "show": "{{actionConfiguration.formData.command.data === 'EMBEDDINGS'}}" }, "children": [ { - "label": "Models", - "tooltipText": "Select the model for embedding generation", - "subtitle": "ID of the model to use.", - "isRequired": true, - "propertyName": "embedding_model_id", - "configProperty": "actionConfiguration.formData.embeddingsModel.data", - "controlType": "DROP_DOWN", - "initialValue": "", - "options": [], - "placeholderText": "All models will be fetched.", - "fetchOptionsConditionally": true, - "setFirstOptionAsDefault": true, - "alternateViewTypes": ["json"], - "conditionals": { - "enable": "{{true}}", - "fetchDynamicValues": { - "condition": "{{actionConfiguration.formData.command.data === 'EMBEDDINGS'}}", - "config": { - "params": { - "requestType": "EMBEDDING_MODELS", - "displayType": "DROP_DOWN" + "controlType": "DOUBLE_COLUMN_ZONE", + "children": [ + { + "label": "Models", + "tooltipText": "Select the model for embedding generation", + "subtitle": "ID of the model to use.", + "isRequired": true, + "propertyName": "embedding_model_id", + "configProperty": "actionConfiguration.formData.embeddingsModel.data", + "controlType": "DROP_DOWN", + "initialValue": "", + "options": [], + "placeholderText": "All models will be fetched.", + "fetchOptionsConditionally": true, + "setFirstOptionAsDefault": true, + "alternateViewTypes": ["json"], + "conditionals": { + "enable": "{{true}}", + "fetchDynamicValues": { + "condition": "{{actionConfiguration.formData.command.data === 'EMBEDDINGS'}}", + "config": { + "params": { + "requestType": "EMBEDDING_MODELS", + "displayType": "DROP_DOWN" + } + } } } } - } + ] }, { - "label": "Input", - "tooltipText": "Provide the string or array of strings", - "subtitle": "Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays.", - "propertyName": "input", - "configProperty": "actionConfiguration.formData.input", - "controlType": "QUERY_DYNAMIC_TEXT", - "isRequired": true, - "placeholderText": "Hello World! OR ['hello', 'world']" + "controlType": "SINGLE_COLUMN_ZONE", + "children": [ + { + "label": "Input", + "tooltipText": "Provide the string or array of strings", + "subtitle": "Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays.", + "propertyName": "input", + "configProperty": "actionConfiguration.formData.input", + "controlType": "QUERY_DYNAMIC_TEXT", + "isRequired": true, + "placeholderText": "Hello World! OR ['hello', 'world']" + } + ] }, { - "label": "Encoding Format", - "tooltipText": "Defaults to float", - "subtitle": "The format to return the embeddings in. Can be either float or base64", - "configProperty": "actionConfiguration.formData.encodingFormat", - "controlType": "DROP_DOWN", - "isRequired": false, - "initialValue": "float", - "options": [ + "controlType": "DOUBLE_COLUMN_ZONE", + "children": [ { - "label": "float", - "value": "float" - }, - { - "label": "base64", - "value": "base64" + "label": "Encoding Format", + "tooltipText": "Defaults to float", + "subtitle": "The format to return the embeddings in. Can be either float or base64", + "configProperty": "actionConfiguration.formData.encodingFormat", + "controlType": "DROP_DOWN", + "isRequired": false, + "initialValue": "float", + "options": [ + { + "label": "float", + "value": "float" + }, + { + "label": "base64", + "value": "base64" + } + ] } ] } diff --git a/app/server/appsmith-plugins/openAiPlugin/src/main/resources/editor/root.json b/app/server/appsmith-plugins/openAiPlugin/src/main/resources/editor/root.json index cdc832c9e9..45a64dc74f 100644 --- a/app/server/appsmith-plugins/openAiPlugin/src/main/resources/editor/root.json +++ b/app/server/appsmith-plugins/openAiPlugin/src/main/resources/editor/root.json @@ -1,28 +1,33 @@ { "editor": [ { - "controlType": "SECTION", + "controlType": "SECTION_V2", "identifier": "SELECTOR", "children": [ { - "label": "Command", - "description": "Choose the method you would like to use", - "configProperty": "actionConfiguration.formData.command.data", - "controlType": "DROP_DOWN", - "isRequired": true, - "initialValue": "CHAT", - "options": [ + "controlType": "DOUBLE_COLUMN_ZONE", + "children": [ { - "label": "Chat", - "value": "CHAT" - }, - { - "label": "Embeddings", - "value": "EMBEDDINGS" - }, - { - "label": "Vision", - "value": "VISION" + "label": "Command", + "description": "Choose the method you would like to use", + "configProperty": "actionConfiguration.formData.command.data", + "controlType": "DROP_DOWN", + "isRequired": true, + "initialValue": "CHAT", + "options": [ + { + "label": "Chat", + "value": "CHAT" + }, + { + "label": "Embeddings", + "value": "EMBEDDINGS" + }, + { + "label": "Vision", + "value": "VISION" + } + ] } ] } diff --git a/app/server/appsmith-plugins/openAiPlugin/src/main/resources/editor/vision.json b/app/server/appsmith-plugins/openAiPlugin/src/main/resources/editor/vision.json index 2a72bcbb93..d0641b18c6 100644 --- a/app/server/appsmith-plugins/openAiPlugin/src/main/resources/editor/vision.json +++ b/app/server/appsmith-plugins/openAiPlugin/src/main/resources/editor/vision.json @@ -1,124 +1,128 @@ { "identifier": "VISION", - "controlType": "SECTION", + "controlType": "SECTION_V2", "conditionals": { "show": "{{actionConfiguration.formData.command.data === 'VISION'}}" }, "children": [ { - "label": "Models", - "tooltipText": "Select the model for response generation", - "subtitle": "ID of the model to use.", - "isRequired": true, - "propertyName": "vision_model_id", - "configProperty": "actionConfiguration.formData.visionModel.data", - "controlType": "DROP_DOWN", - "initialValue": "", - "options": [], - "placeholderText": "All models will be fetched.", - "fetchOptionsConditionally": true, - "setFirstOptionAsDefault": true, - "alternateViewTypes": ["json"], - "conditionals": { - "enable": "{{true}}", - "fetchDynamicValues": { - "condition": "{{actionConfiguration.formData.command.data === 'VISION'}}", - "config": { - "params": { - "requestType": "VISION_MODELS", - "displayType": "DROP_DOWN" + "controlType": "DOUBLE_COLUMN_ZONE", + "children": [ + { + "label": "Models", + "tooltipText": "Select the model for response generation", + "subtitle": "ID of the model to use.", + "isRequired": true, + "propertyName": "vision_model_id", + "configProperty": "actionConfiguration.formData.visionModel.data", + "controlType": "DROP_DOWN", + "initialValue": "", + "options": [], + "placeholderText": "All models will be fetched.", + "fetchOptionsConditionally": true, + "setFirstOptionAsDefault": true, + "alternateViewTypes": ["json"], + "conditionals": { + "enable": "{{true}}", + "fetchDynamicValues": { + "condition": "{{actionConfiguration.formData.command.data === 'VISION'}}", + "config": { + "params": { + "requestType": "VISION_MODELS", + "displayType": "DROP_DOWN" + } + } } } - } - } - }, - { - "label": "Max Tokens", - "tooltipText": "The maximum number of tokens to generate in the chat completion.", - "subtitle": "The maximum number of tokens to generate in the chat completion.", - "Description": "Put a positive integer value", - "configProperty": "actionConfiguration.formData.maxTokens", - "controlType": "INPUT_TEXT", - "initialValue": "16", - "isRequired": true, - "dataType": "NUMBER", - "customStyles": { - "width": "270px", - "minWidth": "270px" - } - }, - { - "label": "System Messages", - "tooltipText": "Provide system instructions to the assistant", - "subtitle": "A list of messages for Assistant as instructions", - "propertyName": "systemMessages", - "isRequired": false, - "configProperty": "actionConfiguration.formData.systemMessages.data", - "controlType": "ARRAY_FIELD", - "alternateViewTypes": ["json"], - "addMoreButtonLabel": "Add System Message", - "customStyles": { - "width": "40vw" - }, - "schema": [ + }, { - "label": "Content", - "key": "content", - "controlType": "QUERY_DYNAMIC_INPUT_TEXT", - "placeholderText": "{{ UserInput.text }}", - "initialValue": "As an OCR expert your skills are unparalleled. Respond with just the text in the image" + "label": "Max Tokens", + "tooltipText": "The maximum number of tokens to generate in the chat completion.", + "subtitle": "The maximum number of tokens to generate in the chat completion.", + "Description": "Put a positive integer value", + "configProperty": "actionConfiguration.formData.maxTokens", + "controlType": "INPUT_TEXT", + "initialValue": "16", + "isRequired": true, + "dataType": "NUMBER" } ] }, { - "label": "User Messages", - "tooltipText": "Provide User queries", - "subtitle": "A list of user messages or images. You can pass a link to the image or the base64 encoded image directly in the request.", - "propertyName": "userMessages", - "isRequired": true, - "configProperty": "actionConfiguration.formData.userMessages.data", - "controlType": "ARRAY_FIELD", - "alternateViewTypes": ["json"], - "addMoreButtonLabel": "Add User message or Image", - "schema": [ + "controlType": "SINGLE_COLUMN_ZONE", + "children": [ { - "label": "Type", - "key": "type", - "controlType": "DROP_DOWN", - "initialValue": "text", - "options": [ + "label": "System Messages", + "tooltipText": "Provide system instructions to the assistant", + "subtitle": "A list of messages for Assistant as instructions", + "propertyName": "systemMessages", + "isRequired": false, + "configProperty": "actionConfiguration.formData.systemMessages.data", + "controlType": "ARRAY_FIELD", + "alternateViewTypes": ["json"], + "addMoreButtonLabel": "Add System Message", + "schema": [ { - "label": "Text", - "value": "text" - }, - { - "label": "Image", - "value": "image" + "label": "Content", + "key": "content", + "controlType": "QUERY_DYNAMIC_INPUT_TEXT", + "placeholderText": "{{ UserInput.text }}", + "initialValue": "As an OCR expert your skills are unparalleled. Respond with just the text in the image" } ] }, { - "label": "Content", - "key": "content", - "controlType": "QUERY_DYNAMIC_INPUT_TEXT", - "placeholderText": "{{Img1.image}} or {{Input1.text}}" + "label": "User Messages", + "tooltipText": "Provide User queries", + "subtitle": "A list of user messages or images. You can pass a link to the image or the base64 encoded image directly in the request.", + "propertyName": "userMessages", + "isRequired": true, + "configProperty": "actionConfiguration.formData.userMessages.data", + "controlType": "ARRAY_FIELD", + "alternateViewTypes": ["json"], + "addMoreButtonLabel": "Add User message or Image", + "schema": [ + { + "label": "Type", + "key": "type", + "controlType": "DROP_DOWN", + "initialValue": "text", + "options": [ + { + "label": "Text", + "value": "text" + }, + { + "label": "Image", + "value": "image" + } + ] + }, + { + "label": "Content", + "key": "content", + "controlType": "QUERY_DYNAMIC_INPUT_TEXT", + "placeholderText": "{{Img1.image}} or {{Input1.text}}" + } + ] } ] }, { - "label": "Temperature", - "tooltipText": "Put a value between 0 and 2", - "Description": "Put a value between 0 and 2", - "subtitle": "What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.", - "configProperty": "actionConfiguration.formData.temperature", - "controlType": "INPUT_TEXT", - "dataType": "NUMBER", - "initialValue": "0", - "isRequired": false, - "customStyles": { - "width": "270px", - "minWidth": "270px" - } + "controlType": "DOUBLE_COLUMN_ZONE", + "children": [ + { + "label": "Temperature", + "tooltipText": "Put a value between 0 and 2", + "Description": "Put a value between 0 and 2", + "subtitle": "What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.", + "configProperty": "actionConfiguration.formData.temperature", + "controlType": "INPUT_TEXT", + "dataType": "NUMBER", + "initialValue": "0", + "isRequired": false + } + ] } ] }