Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class DuckDuckGoSearchComponent(Component):
]

def _build_wrapper(self) -> DuckDuckGoSearchRun:
"""Build the DuckDuckGo search wrapper."""
return DuckDuckGoSearchRun()
"""Return the DuckDuckGo search instance."""
return self.duck_duck_go_instance

def run_model(self) -> list[Data]:
return self.fetch_content()
Expand Down Expand Up @@ -89,3 +89,7 @@ def fetch_content_text(self) -> Message:
result_string = "\n".join(item.text for item in data)
self.status = result_string
return Message(text=result_string)

def __init__(self):
"""Initialize the component and create the DuckDuckGo search instance once."""
self.duck_duck_go_instance = DuckDuckGoSearchRun()
Loading