From 974cf2ee204219e0f371fd569f608cbf9a22a3c2 Mon Sep 17 00:00:00 2001 From: Edwin Jose Date: Wed, 5 Feb 2025 13:49:27 -0500 Subject: [PATCH] feat: add time range for tavily search component (#6092) * added date option in tavily api * fix lint errors * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida --- src/backend/base/langflow/components/tools/tavily.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/backend/base/langflow/components/tools/tavily.py b/src/backend/base/langflow/components/tools/tavily.py index 7a64c52b2..0838f2f7f 100644 --- a/src/backend/base/langflow/components/tools/tavily.py +++ b/src/backend/base/langflow/components/tools/tavily.py @@ -43,6 +43,15 @@ class TavilySearchComponent(Component): value="general", advanced=True, ), + DropdownInput( + name="time_range", + display_name="Time Range", + info="The time range back from the current date to include in the search results.", + options=["day", "week", "month", "year"], + value=None, + advanced=True, + combobox=True, + ), IntInput( name="max_results", display_name="Max Results", @@ -86,6 +95,7 @@ class TavilySearchComponent(Component): "max_results": self.max_results, "include_images": self.include_images, "include_answer": self.include_answer, + "time_range": self.time_range, } with httpx.Client() as client: