Skip to content

Commit 5e1d5db

Browse files
committed
Update search_internet_node.py
1 parent 80053a2 commit 5e1d5db

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

scrapegraphai/nodes/search_internet_node.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -87,19 +87,13 @@ def execute(self, state: dict) -> dict:
8787
if self.verbose:
8888
print(f"Search Query: {search_query}")
8989

90+
answer = search_on_web(
91+
query=search_query, max_results=self.max_results)
9092

91-
<< << << < HEAD
92-
answer = search_on_web(
93-
query=search_query, max_results=self.max_results)
94-
== == == =
93+
if len(answer) == 0:
94+
# raise an exception if no answer is found
95+
raise ValueError("Zero results found for the search query.")
9596

96-
answer = search_on_web(query=search_query, max_results=self.max_results)
97-
>>>>>> > 532adb639d58640bc89e8b162903b2ed97be9853
98-
99-
if len(answer) == 0:
100-
# raise an exception if no answer is found
101-
raise ValueError("Zero results found for the search query.")
102-
103-
# Update the state with the generated answer
104-
state.update({self.output[0]: answer})
105-
return state
97+
# Update the state with the generated answer
98+
state.update({self.output[0]: answer})
99+
return state

0 commit comments

Comments
 (0)