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 <gabriel@langflow.org>
This commit is contained in:
Edwin Jose 2025-02-05 13:49:27 -05:00 committed by GitHub
commit 974cf2ee20
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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: