We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1775606 commit d53b740Copy full SHA for d53b740
src/khoj/processor/tools/online_search.py
@@ -33,6 +33,7 @@
33
GOOGLE_SEARCH_API_KEY = os.getenv("GOOGLE_SEARCH_API_KEY")
34
GOOGLE_SEARCH_ENGINE_ID = os.getenv("GOOGLE_SEARCH_ENGINE_ID")
35
SERPER_DEV_API_KEY = os.getenv("SERPER_DEV_API_KEY")
36
+AUTO_READ_WEBPAGE = is_env_var_true("AUTO_READ_WEBPAGE")
37
SERPER_DEV_URL = "https://google.serper.dev/search"
38
39
JINA_SEARCH_API_URL = "https://s.jina.ai/"
@@ -131,6 +132,10 @@ async def search_online(
131
132
logger.error(f"Error searching with {search_engine}: {e}")
133
response_dict = {}
134
135
+ if not AUTO_READ_WEBPAGE:
136
+ yield response_dict
137
+ return
138
+
139
# Gather distinct web pages from organic results for subqueries without an instant answer.
140
webpages: Dict[str, Dict] = {}
141
for subquery in response_dict:
0 commit comments