feat: support duckduckgo search engine

This commit is contained in:
He Tao
2025-04-10 11:45:04 +08:00
parent 03798ded08
commit 1195612c47
13 changed files with 88 additions and 119 deletions

View File

@@ -1,4 +1,4 @@
from .tools import TAVILY_MAX_RESULTS
from .tools import SEARCH_MAX_RESULTS, SELECTED_SEARCH_ENGINE, SearchEngine
from .loader import load_yaml_config
from dotenv import load_dotenv
@@ -38,5 +38,7 @@ __all__ = [
# Other configurations
"TEAM_MEMBERS",
"TEAM_MEMBER_CONFIGRATIONS",
"TAVILY_MAX_RESULTS",
"SEARCH_MAX_RESULTS",
"SELECTED_SEARCH_ENGINE",
"SearchEngine",
]

View File

@@ -1,2 +1,15 @@
import os
import enum
from dotenv import load_dotenv
load_dotenv()
class SearchEngine(enum.Enum):
TAVILY = "tavily"
DUCKDUCKGO = "duckduckgo"
# Tool configuration
TAVILY_MAX_RESULTS = 3
SELECTED_SEARCH_ENGINE = os.getenv("SEARCH_API", SearchEngine.TAVILY.value)
SEARCH_MAX_RESULTS = 3