diff --git a/server/libs/modules/components/ai/ai-text-analysis/src/main/java/com/bytechef/component/ai/text/analysis/action/SummarizeTextAction.java b/server/libs/modules/components/ai/ai-text-analysis/src/main/java/com/bytechef/component/ai/text/analysis/action/SummarizeTextAction.java index 0979f44085..3e4dc9a182 100644 --- a/server/libs/modules/components/ai/ai-text-analysis/src/main/java/com/bytechef/component/ai/text/analysis/action/SummarizeTextAction.java +++ b/server/libs/modules/components/ai/ai-text-analysis/src/main/java/com/bytechef/component/ai/text/analysis/action/SummarizeTextAction.java @@ -72,71 +72,71 @@ public SummarizeTextAction(ApplicationProperties.Ai.Component component) { .label("Model") .description("ID of the model to use.") .options(AmazonBedrockConstants.ANTHROPIC2_MODELS) - .displayCondition("connectionProvider == 0") + .displayCondition("modelProvider == 0") .required(true), string(MODEL) .label("Model") .description("ID of the model to use.") .options(AmazonBedrockConstants.ANTHROPIC3_MODELS) - .displayCondition("connectionProvider == 1") + .displayCondition("modelProvider == 1") .required(true), string(MODEL) .label("Model") .description("ID of the model to use.") .options(AmazonBedrockConstants.COHERE_MODELS) - .displayCondition("connectionProvider == 2") + .displayCondition("modelProvider == 2") .required(true), string(MODEL) .label("Model") .description("ID of the model to use.") .options(AmazonBedrockConstants.JURASSIC2_MODELS) - .displayCondition("connectionProvider == 3") + .displayCondition("modelProvider == 3") .required(true), string(MODEL) .label("Model") .description("ID of the model to use.") .options(AmazonBedrockConstants.LLAMA_MODELS) - .displayCondition("connectionProvider == 4") + .displayCondition("modelProvider == 4") .required(true), string(MODEL) .label("Model") .description("ID of the model to use.") .options(AmazonBedrockConstants.TITAN_MODELS) - .displayCondition("connectionProvider == 5") + .displayCondition("modelProvider == 5") .required(true), string(MODEL) .label("Model") .description("ID of the model to use.") .options(AnthropicConstants.MODELS) - .displayCondition("connectionProvider == 6") + .displayCondition("modelProvider == 6") .required(true), string(MODEL) .label("Model") .description("ID of the model to use.") - .displayCondition("connectionProvider >= 7 && connectionProvider <= 9") + .displayCondition("modelProvider >= 7 && modelProvider <= 9") .required(true), string(MODEL) .label("URL") .description("Url of the inference endpoint.") - .displayCondition("connectionProvider == 10") + .displayCondition("modelProvider == 10") .required(true), string(MODEL) .label("Model") .description("ID of the model to use.") .options(MistralConstants.MODELS) - .displayCondition("connectionProvider == 11") + .displayCondition("modelProvider == 11") .required(true), string(MODEL) .label("Model") .description("ID of the model to use.") .options(OpenAIConstants.MODELS) - .displayCondition("connectionProvider == 12") + .displayCondition("modelProvider == 12") .required(true), string(MODEL) .label("Model") .description("ID of the model to use.") .options(VertexGeminiConstants.MODELS) - .displayCondition("connectionProvider == 13") + .displayCondition("modelProvider == 13") .required(true), string(TEXT) .label("Text") diff --git a/server/libs/modules/components/ai/ai-text-analysis/src/main/java/com/bytechef/component/ai/text/analysis/action/definition/AiTextAnalysisActionDefinition.java b/server/libs/modules/components/ai/ai-text-analysis/src/main/java/com/bytechef/component/ai/text/analysis/action/definition/AiTextAnalysisActionDefinition.java index 7c66d8e93d..3ca8a9b29b 100644 --- a/server/libs/modules/components/ai/ai-text-analysis/src/main/java/com/bytechef/component/ai/text/analysis/action/definition/AiTextAnalysisActionDefinition.java +++ b/server/libs/modules/components/ai/ai-text-analysis/src/main/java/com/bytechef/component/ai/text/analysis/action/definition/AiTextAnalysisActionDefinition.java @@ -43,6 +43,7 @@ import com.bytechef.config.ApplicationProperties; import com.bytechef.platform.component.definition.AbstractActionDefinitionWrapper; import com.bytechef.platform.component.definition.ParametersFactory; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -55,6 +56,7 @@ public class AiTextAnalysisActionDefinition extends AbstractActionDefinitionWrap private final ApplicationProperties.Ai.Component component; + @SuppressFBWarnings("EI") public AiTextAnalysisActionDefinition(ActionDefinition actionDefinition, ApplicationProperties.Ai.Component component) { super(actionDefinition); diff --git a/server/libs/modules/components/ai/ai-text-analysis/src/main/resources/assets/ai-text-analysis.svg b/server/libs/modules/components/ai/ai-text-analysis/src/main/resources/assets/ai-text-analysis.svg new file mode 100644 index 0000000000..35ce4d0eae --- /dev/null +++ b/server/libs/modules/components/ai/ai-text-analysis/src/main/resources/assets/ai-text-analysis.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/server/libs/modules/components/ai/ai-text-analysis/src/test/resources/definition/ai_text_analysis_v1.json b/server/libs/modules/components/ai/ai-text-analysis/src/test/resources/definition/ai_text_analysis_v1.json new file mode 100644 index 0000000000..33cd26a919 --- /dev/null +++ b/server/libs/modules/components/ai/ai-text-analysis/src/test/resources/definition/ai_text_analysis_v1.json @@ -0,0 +1,702 @@ +{ + "actions" : [ { + "batch" : null, + "deprecated" : null, + "description" : "AI reads, analyzes and summarizes your text into a shorter format.", + "help" : null, + "metadata" : null, + "name" : "summarizeText", + "properties" : [ { + "advancedOption" : null, + "description" : null, + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "modelProvider", + "type" : "INTEGER", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Model provider", + "placeholder" : null, + "maxValue" : null, + "minValue" : null, + "options" : [ { + "description" : null, + "label" : "Amazon Bedrock: Anthropic 2", + "value" : 0 + }, { + "description" : null, + "label" : "Amazon Bedrock: Anthropic 3", + "value" : 1 + }, { + "description" : null, + "label" : "Amazon Bedrock: Cohere", + "value" : 2 + }, { + "description" : null, + "label" : "Amazon Bedrock: Jurassic 2", + "value" : 3 + }, { + "description" : null, + "label" : "Amazon Bedrock: Llama", + "value" : 4 + }, { + "description" : null, + "label" : "Amazon Bedrock: Titan", + "value" : 5 + }, { + "description" : null, + "label" : "Anthropic", + "value" : 6 + }, { + "description" : null, + "label" : "Azure Open AI", + "value" : 7 + }, { + "description" : null, + "label" : "Groq", + "value" : 8 + }, { + "description" : null, + "label" : "NVIDIA", + "value" : 9 + }, { + "description" : null, + "label" : "Hugging Face", + "value" : 10 + }, { + "description" : null, + "label" : "Mistral", + "value" : 11 + }, { + "description" : null, + "label" : "Open AI", + "value" : 12 + }, { + "description" : null, + "label" : "Vertex Gemini", + "value" : 13 + } ], + "controlType" : "SELECT", + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "ID of the model to use.", + "displayCondition" : "modelProvider == 0", + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "model", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Model", + "placeholder" : null, + "controlType" : "SELECT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : [ { + "description" : null, + "label" : "anthropic.claude-instant-v1", + "value" : "anthropic.claude-instant-v1" + }, { + "description" : null, + "label" : "anthropic.claude-v2:1", + "value" : "anthropic.claude-v2:1" + }, { + "description" : null, + "label" : "anthropic.claude-v2", + "value" : "anthropic.claude-v2" + } ], + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "ID of the model to use.", + "displayCondition" : "modelProvider == 1", + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "model", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Model", + "placeholder" : null, + "controlType" : "SELECT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : [ { + "description" : null, + "label" : "anthropic.claude-instant-v1", + "value" : "anthropic.claude-instant-v1" + }, { + "description" : null, + "label" : "anthropic.claude-v2:1", + "value" : "anthropic.claude-v2:1" + }, { + "description" : null, + "label" : "anthropic.claude-v2", + "value" : "anthropic.claude-v2" + } ], + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "ID of the model to use.", + "displayCondition" : "modelProvider == 2", + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "model", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Model", + "placeholder" : null, + "controlType" : "SELECT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : [ { + "description" : null, + "label" : "cohere.command-light-text-v14", + "value" : "cohere.command-light-text-v14" + }, { + "description" : null, + "label" : "cohere.command-text-v14", + "value" : "cohere.command-text-v14" + } ], + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "ID of the model to use.", + "displayCondition" : "modelProvider == 3", + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "model", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Model", + "placeholder" : null, + "controlType" : "SELECT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : [ { + "description" : null, + "label" : "ai21.j2-ultra-v1", + "value" : "ai21.j2-ultra-v1" + }, { + "description" : null, + "label" : "ai21.j2-mid-v1", + "value" : "ai21.j2-mid-v1" + } ], + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "ID of the model to use.", + "displayCondition" : "modelProvider == 4", + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "model", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Model", + "placeholder" : null, + "controlType" : "SELECT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : [ { + "description" : null, + "label" : "meta.llama2-13b-chat-v1", + "value" : "meta.llama2-13b-chat-v1" + }, { + "description" : null, + "label" : "meta.llama3-1-8b-instruct-v1:0", + "value" : "meta.llama3-1-8b-instruct-v1:0" + }, { + "description" : null, + "label" : "meta.llama3-2-11b-instruct-v1:0", + "value" : "meta.llama3-2-11b-instruct-v1:0" + }, { + "description" : null, + "label" : "meta.llama3-1-70b-instruct-v1:0", + "value" : "meta.llama3-1-70b-instruct-v1:0" + }, { + "description" : null, + "label" : "meta.llama3-70b-instruct-v1:0", + "value" : "meta.llama3-70b-instruct-v1:0" + }, { + "description" : null, + "label" : "meta.llama3-8b-instruct-v1:0", + "value" : "meta.llama3-8b-instruct-v1:0" + }, { + "description" : null, + "label" : "meta.llama3-2-90b-instruct-v1:0", + "value" : "meta.llama3-2-90b-instruct-v1:0" + }, { + "description" : null, + "label" : "meta.llama2-70b-chat-v1", + "value" : "meta.llama2-70b-chat-v1" + }, { + "description" : null, + "label" : "meta.llama3-2-1b-instruct-v1:0", + "value" : "meta.llama3-2-1b-instruct-v1:0" + }, { + "description" : null, + "label" : "meta.llama3-2-3b-instruct-v1:0", + "value" : "meta.llama3-2-3b-instruct-v1:0" + }, { + "description" : null, + "label" : "meta.llama3-1-405b-instruct-v1:0", + "value" : "meta.llama3-1-405b-instruct-v1:0" + } ], + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "ID of the model to use.", + "displayCondition" : "modelProvider == 5", + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "model", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Model", + "placeholder" : null, + "controlType" : "SELECT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : [ { + "description" : null, + "label" : "amazon.titan-text-premier-v1:0", + "value" : "amazon.titan-text-premier-v1:0" + }, { + "description" : null, + "label" : "amazon.titan-text-express-v1", + "value" : "amazon.titan-text-express-v1" + }, { + "description" : null, + "label" : "amazon.titan-text-lite-v1", + "value" : "amazon.titan-text-lite-v1" + } ], + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "ID of the model to use.", + "displayCondition" : "modelProvider == 6", + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "model", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Model", + "placeholder" : null, + "controlType" : "SELECT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : [ { + "description" : null, + "label" : "claude-instant-1.2", + "value" : "claude-instant-1.2" + }, { + "description" : null, + "label" : "claude-3-haiku-20240307", + "value" : "claude-3-haiku-20240307" + }, { + "description" : null, + "label" : "claude-3-opus-20240229", + "value" : "claude-3-opus-20240229" + }, { + "description" : null, + "label" : "claude-2.0", + "value" : "claude-2.0" + }, { + "description" : null, + "label" : "claude-3-5-sonnet-20241022", + "value" : "claude-3-5-sonnet-20241022" + }, { + "description" : null, + "label" : "claude-3-sonnet-20240229", + "value" : "claude-3-sonnet-20240229" + }, { + "description" : null, + "label" : "claude-2.1", + "value" : "claude-2.1" + } ], + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "ID of the model to use.", + "displayCondition" : "modelProvider >= 7 && modelProvider <= 9", + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "model", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Model", + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "Url of the inference endpoint.", + "displayCondition" : "modelProvider == 10", + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "model", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "URL", + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "ID of the model to use.", + "displayCondition" : "modelProvider == 11", + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "model", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Model", + "placeholder" : null, + "controlType" : "SELECT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : [ { + "description" : null, + "label" : "open-mixtral-8x22b", + "value" : "open-mixtral-8x22b" + }, { + "description" : null, + "label" : "pixtral-12b-2409", + "value" : "pixtral-12b-2409" + }, { + "description" : null, + "label" : "mistral-small-latest", + "value" : "mistral-small-latest" + }, { + "description" : null, + "label" : "pixtral-large-latest", + "value" : "pixtral-large-latest" + }, { + "description" : null, + "label" : "open-mixtral-8x7b", + "value" : "open-mixtral-8x7b" + }, { + "description" : null, + "label" : "mistral-medium-latest", + "value" : "mistral-medium-latest" + }, { + "description" : null, + "label" : "open-mistral-7b", + "value" : "open-mistral-7b" + }, { + "description" : null, + "label" : "mistral-large-latest", + "value" : "mistral-large-latest" + } ], + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "ID of the model to use.", + "displayCondition" : "modelProvider == 12", + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "model", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Model", + "placeholder" : null, + "controlType" : "SELECT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : [ { + "description" : null, + "label" : "gpt-4-0125-preview", + "value" : "gpt-4-0125-preview" + }, { + "description" : null, + "label" : "o1-preview-2024-09-12", + "value" : "o1-preview-2024-09-12" + }, { + "description" : null, + "label" : "gpt-4-turbo-preview", + "value" : "gpt-4-turbo-preview" + }, { + "description" : null, + "label" : "gpt-4-turbo", + "value" : "gpt-4-turbo" + }, { + "description" : null, + "label" : "gpt-4o-mini", + "value" : "gpt-4o-mini" + }, { + "description" : null, + "label" : "gpt-4", + "value" : "gpt-4" + }, { + "description" : null, + "label" : "o1-preview", + "value" : "o1-preview" + }, { + "description" : null, + "label" : "gpt-3.5-turbo", + "value" : "gpt-3.5-turbo" + }, { + "description" : null, + "label" : "gpt-4-turbo-2024-04-09", + "value" : "gpt-4-turbo-2024-04-09" + }, { + "description" : null, + "label" : "gpt-3.5-turbo-0125", + "value" : "gpt-3.5-turbo-0125" + }, { + "description" : null, + "label" : "o1-mini", + "value" : "o1-mini" + }, { + "description" : null, + "label" : "o1-mini-2024-09-12", + "value" : "o1-mini-2024-09-12" + }, { + "description" : null, + "label" : "gpt-3.5-turbo-1106", + "value" : "gpt-3.5-turbo-1106" + }, { + "description" : null, + "label" : "gpt-4o", + "value" : "gpt-4o" + } ], + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "ID of the model to use.", + "displayCondition" : "modelProvider == 13", + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "model", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Model", + "placeholder" : null, + "controlType" : "SELECT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : [ { + "description" : null, + "label" : "gemini-1.5-flash-001", + "value" : "gemini-1.5-flash-001" + }, { + "description" : null, + "label" : "gemini-pro-vision", + "value" : "gemini-pro-vision" + }, { + "description" : null, + "label" : "gemini-1.5-pro-001", + "value" : "gemini-1.5-pro-001" + }, { + "description" : null, + "label" : "gemini-pro", + "value" : "gemini-pro" + } ], + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "The text that is to be summarized.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "text", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Text", + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : 100, + "options" : null, + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "In what format do you wish the text summarized?", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "format", + "type" : "INTEGER", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Format", + "placeholder" : null, + "maxValue" : null, + "minValue" : null, + "options" : [ { + "description" : null, + "label" : "A structured summary with sections", + "value" : 0 + }, { + "description" : null, + "label" : "A brief title summarizing the content in 4-7 words", + "value" : 1 + }, { + "description" : null, + "label" : "A single, concise sentence", + "value" : 2 + }, { + "description" : null, + "label" : "A bulleted list recap", + "value" : 3 + }, { + "description" : null, + "label" : "Custom Prompt", + "value" : 4 + } ], + "controlType" : "SELECT", + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "Write your prompt for summarizing text.", + "displayCondition" : "format == 4", + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "prompt", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Custom Prompt", + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + }, { + "advancedOption" : true, + "description" : "The maximum number of tokens to generate in the chat completion.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : null, + "name" : "maxTokens", + "type" : "INTEGER", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Max Tokens", + "placeholder" : null, + "maxValue" : null, + "minValue" : null, + "options" : null, + "controlType" : "INTEGER", + "optionsDataSource" : null + }, { + "advancedOption" : true, + "description" : "Controls randomness: Higher values will make the output more random, while lower values like will make it more focused and deterministic.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : null, + "name" : "temperature", + "type" : "NUMBER", + "defaultValue" : 1.0, + "exampleValue" : null, + "label" : "Temperature", + "placeholder" : null, + "maxNumberPrecision" : null, + "maxValue" : 2.0, + "minNumberPrecision" : null, + "minValue" : 0.0, + "numberPrecision" : null, + "options" : null, + "controlType" : "NUMBER", + "optionsDataSource" : null + } ], + "title" : "Summarize Text", + "perform" : { }, + "processErrorResponse" : null, + "outputDefinition" : { + "output" : null, + "outputResponse" : null, + "outputSchema" : null, + "sampleOutput" : null + }, + "workflowNodeDescription" : null + } ], + "categories" : [ { + "key" : "artificial-intelligence", + "label" : "artificial-intelligence" + } ], + "connection" : null, + "customAction" : null, + "customActionHelp" : null, + "description" : "AI Helper component for text analysis.", + "icon" : "path:assets/ai-text-analysis.svg", + "tags" : null, + "metadata" : null, + "name" : "aiTextAnalysis", + "resources" : null, + "title" : "AI Text Analysis", + "triggers" : null, + "unifiedApi" : null, + "version" : 1, + "dataStream" : null +} \ No newline at end of file