Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 5 additions & 4 deletions source_collectors/auto_googler/AutoGooglerCollector.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import asyncio

from collector_manager.AsyncCollectorBase import AsyncCollectorBase
from collector_manager.enums import CollectorType
from core.EnvVarManager import EnvVarManager
from core.preprocessors.AutoGooglerPreprocessor import AutoGooglerPreprocessor
from source_collectors.auto_googler.AutoGoogler import AutoGoogler
from source_collectors.auto_googler.DTOs import AutoGooglerInputDTO, AutoGooglerInnerOutputDTO
from source_collectors.auto_googler.GoogleSearcher import GoogleSearcher
from source_collectors.auto_googler.SearchConfig import SearchConfig
from util.helper_functions import get_from_env, base_model_list_dump
from util.helper_functions import base_model_list_dump


class AutoGooglerCollector(AsyncCollectorBase):
Expand All @@ -16,14 +16,15 @@ class AutoGooglerCollector(AsyncCollectorBase):

async def run_to_completion(self) -> AutoGoogler:
dto: AutoGooglerInputDTO = self.dto
env_var_manager = EnvVarManager.get()
auto_googler = AutoGoogler(
search_config=SearchConfig(
urls_per_result=dto.urls_per_result,
queries=dto.queries,
),
google_searcher=GoogleSearcher(
api_key=get_from_env("GOOGLE_API_KEY"),
cse_id=get_from_env("GOOGLE_CSE_ID"),
api_key=env_var_manager.google_api_key,
cse_id=env_var_manager.google_cse_id,
)
)
async for log in auto_googler.run():
Expand Down
Empty file.