do web searches in ddg, google and google news
This commit is contained in:
@ -204,17 +204,23 @@ async def async_main():
|
||||
|
||||
def sync_main():
|
||||
# Synchronous part for scheduling
|
||||
topic = "TSLA"
|
||||
topic = "tesla news"
|
||||
interval = 1 # in minutes
|
||||
folder = "agent-py-bot/scrape/raw"
|
||||
|
||||
schedule.every(interval).minutes.do(run_web_agent, topic=topic, folder=folder)
|
||||
# Run once at the start
|
||||
run_web_agent(topic=topic, folder=folder)
|
||||
news_json = run_web_agent(topic=topic, folder=folder)
|
||||
|
||||
while True:
|
||||
schedule.run_pending()
|
||||
time.sleep(1)
|
||||
# Check if there's new data obtained from web agent
|
||||
new_data, new_summary = run_web_agent(topic=topic, folder=folder)
|
||||
|
||||
# Use the new data to call the async function
|
||||
user_message = f"New data received: {new_data}"
|
||||
query_result = query_llm(user_message)
|
||||
|
||||
if __name__ == '__main__':
|
||||
loop = asyncio.get_event_loop()
|
||||
|
Reference in New Issue
Block a user