Skip to content

Commit 60f7592

Browse files
monikakusterivicac
authored andcommitted
2319 - SF
1 parent 7273c3e commit 60f7592

File tree

4 files changed

+2752
-19
lines changed

4 files changed

+2752
-19
lines changed

server/libs/modules/components/tavily/openapi.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ paths:
104104
urls:
105105
type: "array"
106106
description: "A list of URLs to extract content from."
107+
title: "URLs"
107108
items:
108109
type: "string"
109110
include_images:
@@ -154,7 +155,6 @@ paths:
154155
response_time:
155156
type: "number"
156157
description: "Time in seconds it took to complete the request."
157-
158158
components:
159159
securitySchemes:
160160
bearerAuth:

server/libs/modules/components/tavily/src/main/java/com/bytechef/component/tavily/TavilyComponentHandler.java

+13-16
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,14 @@
2121
import com.bytechef.component.OpenApiComponentHandler;
2222
import com.bytechef.component.definition.ActionDefinition;
2323
import com.bytechef.component.definition.ComponentCategory;
24-
import com.bytechef.component.definition.ComponentDsl.ModifiableArrayProperty;
2524
import com.bytechef.component.definition.ComponentDsl.ModifiableComponentDefinition;
2625
import com.bytechef.component.definition.ComponentDsl.ModifiableProperty;
2726
import com.bytechef.component.definition.ComponentDsl.ModifiableStringProperty;
2827
import com.google.auto.service.AutoService;
2928
import java.util.Objects;
3029

3130
/**
32-
* This class will not be overwritten on the subsequent calls of the generator.
31+
* @author Marija Horvat
3332
*/
3433
@AutoService(OpenApiComponentHandler.class)
3534
public class TavilyComponentHandler extends AbstractTavilyComponentHandler {
@@ -38,7 +37,8 @@ public class TavilyComponentHandler extends AbstractTavilyComponentHandler {
3837
public ModifiableComponentDefinition modifyComponent(ModifiableComponentDefinition modifiableComponentDefinition) {
3938
return modifiableComponentDefinition
4039
.icon("path:assets/tavily.svg")
41-
.categories(ComponentCategory.ARTIFICIAL_INTELLIGENCE);
40+
.categories(ComponentCategory.ARTIFICIAL_INTELLIGENCE)
41+
.customAction(true);
4242
}
4343

4444
@Override
@@ -48,28 +48,25 @@ public ModifiableProperty<?> modifyProperty(
4848
if (Objects.equals(modifiableProperty.getName(), "topic")) {
4949
((ModifiableStringProperty) modifiableProperty)
5050
.options(
51-
option("General", "general", "general-purpose searches that may include a wide range of sources"),
52-
option("News", "news", "real-time updates"));
51+
option("General", "general", "General-purpose searches that may include a wide range of sources."),
52+
option("News", "news", "Real-time updates."));
5353
} else if (Objects.equals(modifiableProperty.getName(), "search_depth")) {
5454
((ModifiableStringProperty) modifiableProperty)
5555
.options(
56-
option("Basic", "basic", "provides generic content snippets from each source"),
57-
option("Advanced", "advanced", "retrieves the most relevant sources"));
56+
option("Basic", "basic", "Provides generic content snippets from each source."),
57+
option("Advanced", "advanced", "Retrieves the most relevant sources."));
5858
} else if (Objects.equals(modifiableProperty.getName(), "time_range")) {
5959
((ModifiableStringProperty) modifiableProperty)
6060
.options(
61-
option("Day", "day", "returns results from the past 24 hours"),
62-
option("Week", "week", "returns results from the past 7 days"),
63-
option("Month", "month", "returns results from the past 30 days"),
64-
option("Year", "year", "returns results from the past 365 days"));
65-
} else if (Objects.equals(modifiableProperty.getName(), "urls")) {
66-
((ModifiableArrayProperty) modifiableProperty)
67-
.label("URLs");
61+
option("Day", "day", "Results from the past 24 hours"),
62+
option("Week", "week", "Results from the past 7 days"),
63+
option("Month", "month", "Results from the past 30 days"),
64+
option("Year", "year", "Results from the past 365 days"));
6865
} else if (Objects.equals(modifiableProperty.getName(), "extract_depth")) {
6966
((ModifiableStringProperty) modifiableProperty)
7067
.options(
71-
option("Basic", "basic", "retrieves basic data"),
72-
option("Advanced", "advanced", "retrieves more data, including tables and embedded content"));
68+
option("Basic", "basic", "Retrieves basic data."),
69+
option("Advanced", "advanced", "Retrieves more data, including tables and embedded content."));
7370
}
7471

7572
return modifiableProperty;

server/libs/modules/components/tavily/src/main/java/com/bytechef/component/tavily/action/TavilyExtractAction.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class TavilyExtractAction {
5353
.metadata(
5454
Map.of(
5555
"type", PropertyType.BODY))
56-
.label("Urls")
56+
.label("URLs")
5757
.description("A list of URLs to extract content from.")
5858
.required(true),
5959
bool("include_images").metadata(

server/libs/modules/components/tavily/src/test/resources/definition/tavily_v1.json

+2,737-1
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)