Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions server/apps/server-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ dependencies {
implementation(project(":server:libs:modules:components:accelo"))
implementation(project(":server:libs:modules:components:active-campaign"))
implementation(project(":server:libs:modules:components:affinity"))
implementation(project(":server:libs:modules:components:ai:ai-text-analysis"))
implementation(project(":server:libs:modules:components:airtable"))
implementation(project(":server:libs:modules:components:aitable"))
implementation(project(":server:libs:modules:components:app-event"))
Expand Down
1 change: 1 addition & 0 deletions server/ee/apps/worker-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ dependencies {
implementation(project(":server:libs:modules:components:accelo"))
implementation(project(":server:libs:modules:components:active-campaign"))
implementation(project(":server:libs:modules:components:affinity"))
implementation(project(":server:libs:modules:components:ai:ai-text-analysis"))
implementation(project(":server:libs:modules:components:airtable"))
implementation(project(":server:libs:modules:components:aitable"))
implementation(project(":server:libs:modules:components:app-event"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,16 +304,25 @@ public void setLevel(Level level) {
*/
public static class Ai {

private Component component = new Component();
private Copilot copilot = new Copilot();

public Copilot getCopilot() {
return copilot;
}

public Component getComponent() {
return component;
}

public void setCopilot(Copilot copilot) {
this.copilot = copilot;
}

public void setComponent(Component component) {
this.component = component;
}

public static class Copilot {

public enum Provider {
Expand Down Expand Up @@ -396,6 +405,215 @@ public void setModel(String model) {
}
}
}

public static class Component {
private AmazonBedrock amazonBedrock = new AmazonBedrock();

public AmazonBedrock getAmazonBedrock() {
return amazonBedrock;
}

public void setAmazonBedrock(AmazonBedrock amazonBedrock) {
this.amazonBedrock = amazonBedrock;
}

public static class AmazonBedrock {

private String apiKey;

public String getApiKey() {
return apiKey;
}

public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
}

private Anthropic anthropic = new Anthropic();

public Anthropic getAnthropic() {
return anthropic;
}

public void setAnthropic(Anthropic anthropic) {
this.anthropic = anthropic;
}

public static class Anthropic {

private String apiKey;

public String getApiKey() {
return apiKey;
}

public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
}

private AzureOpenAi azureOpenAi = new AzureOpenAi();

public AzureOpenAi getAzureOpenAi() {
return azureOpenAi;
}

public void setAzureOpenAi(AzureOpenAi azureOpenAi) {
this.azureOpenAi = azureOpenAi;
}

public static class AzureOpenAi {

private String apiKey;

public String getApiKey() {
return apiKey;
}

public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
}

private Groq groq = new Groq();

public Groq getGroq() {
return groq;
}

public void setGroq(Groq groq) {
this.groq = groq;
}

public static class Groq {

private String apiKey;

public String getApiKey() {
return apiKey;
}

public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
}

private Nvidia nvidia = new Nvidia();

public Nvidia getNvidia() {
return nvidia;
}

public void setNvidia(Nvidia nvidia) {
this.nvidia = nvidia;
}

public static class Nvidia {

private String apiKey;

public String getApiKey() {
return apiKey;
}

public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
}

private HuggingFace huggingFace = new HuggingFace();

public HuggingFace getHuggingFace() {
return huggingFace;
}

public void setHuggingFace(HuggingFace huggingFace) {
this.huggingFace = huggingFace;
}

public static class HuggingFace {

private String apiKey;

public String getApiKey() {
return apiKey;
}

public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
}

private Mistral mistral = new Mistral();

public Mistral getMistral() {
return mistral;
}

public void setMistral(Mistral mistral) {
this.mistral = mistral;
}

public static class Mistral {

private String apiKey;

public String getApiKey() {
return apiKey;
}

public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
}

private OpenAi openAi = new OpenAi();

public OpenAi getOpenAi() {
return openAi;
}

public void setOpenAi(OpenAi openAi) {
this.openAi = openAi;
}

public static class OpenAi {

private String apiKey;

public String getApiKey() {
return apiKey;
}

public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
}

private VertexGemini vertexGemini = new VertexGemini();

public VertexGemini getVertexGemini() {
return vertexGemini;
}

public void setVertexGemini(VertexGemini vertexGemini) {
this.vertexGemini = vertexGemini;
}

public static class VertexGemini {

private String apiKey;

public String getApiKey() {
return apiKey;
}

public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
}
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version="1.0"

dependencies {
implementation("org.springframework.boot:spring-boot-autoconfigure")

implementation(project(":server:libs:config:app-config"))
implementation(project(":server:libs:platform:platform-component:platform-component-api"))

implementation(project(":server:libs:modules:components:llm"))
implementation(project(":server:libs:modules:components:llm:amazon-bedrock"))
implementation(project(":server:libs:modules:components:llm:anthropic"))
implementation(project(":server:libs:modules:components:llm:azure-openai"))
implementation(project(":server:libs:modules:components:llm:groq"))
implementation(project(":server:libs:modules:components:llm:hugging-face"))
implementation(project(":server:libs:modules:components:llm:mistral"))
implementation(project(":server:libs:modules:components:llm:nvidia"))
implementation(project(":server:libs:modules:components:llm:openai"))
implementation(project(":server:libs:modules:components:llm:stability"))
implementation(project(":server:libs:modules:components:llm:vertex:gemini"))
implementation(project(":server:libs:modules:components:llm:watsonx"))
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* Copyright 2023-present ByteChef Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.bytechef.component.ai.text.analysis;

import static com.bytechef.component.definition.ComponentDsl.component;
import static com.bytechef.platform.component.definition.AIComponentDefinition.AI_TEXT_ANALYSIS;

import com.bytechef.component.ComponentHandler;
import com.bytechef.component.ai.text.analysis.action.SummarizeTextAction;
import com.bytechef.component.definition.ComponentCategory;
import com.bytechef.component.definition.ComponentDefinition;
import com.bytechef.config.ApplicationProperties;
import com.bytechef.platform.component.definition.AIComponentDefinition;
import com.bytechef.platform.component.definition.AbstractComponentDefinitionWrapper;
import org.springframework.stereotype.Component;

/**
* @author Marko Kriskovic
*/
@Component(AI_TEXT_ANALYSIS + "_v1_ComponentHandler")
public class AiTextAnalysisComponentHandler implements ComponentHandler {

private final AIComponentDefinition componentDefinition;

public AiTextAnalysisComponentHandler(ApplicationProperties applicationProperties) {
ApplicationProperties.Ai ai = applicationProperties.getAi();

this.componentDefinition = new AiTextAnalysisComponentDefinitionImpl(ai.getComponent());
}

@Override
public ComponentDefinition getDefinition() {
return componentDefinition;
}

private static class AiTextAnalysisComponentDefinitionImpl
extends AbstractComponentDefinitionWrapper implements AIComponentDefinition {

private AiTextAnalysisComponentDefinitionImpl(ApplicationProperties.Ai.Component component) {
super(
component(AI_TEXT_ANALYSIS)
.title("AI Text Analysis")
.description("AI Helper component for text analysis.")
.icon("path:assets/ai-text-analysis.svg")
.categories(ComponentCategory.ARTIFICIAL_INTELLIGENCE)
.actions(new SummarizeTextAction(component).actionDefinition));
}
}
}
Loading
Loading