myshell-ai / AIlice

AIlice is a fully autonomous, general-purpose AI agent.
MIT License
876 stars 136 forks source link

Chrome? #46

Closed FellowTraveler closed 4 months ago

FellowTraveler commented 4 months ago

Help me understand the Chrome dependency. Do I actually need to install the Chrome browser? (I use Brave). Or is this just a headless python library that the Agent is supposed to install? Because it will try to do "Google" tool and hang.

stevenlu137 commented 4 months ago

Yes, you need a Chrome browser. In modules/AWebBrowser.py, we use Selenium with Chrome in headless mode to retrieve web page content. Due to many websites' anti-scraping mechanisms, using a real browser seems to be very necessary. I also found support for other browsers in the selenium documentation, but I haven't added support for these browsers yet. I'm not sure how to provide support for Brave, but since it is based on Chromium, it might not be impossible.

Sometimes, the LLM might choose to use the BROWSE function to directly search for content on Google, but this often fails due to Google's anti-scraping mechanisms. However, this doesn't happen very often; it usually prefers using the search-engine agent. If it encounters issues when calling the GOOGLE function, it's not surprising because this function uses an unofficial Google search package by default, which might be banned due to frequent access. If you need to perform many searches, it is recommended to refer to the "If You Need to Frequently Use Google" section in the documentation and apply for Google's API.

stevenlu137 commented 4 months ago

Some additional information: The BROWSE function relies on the Chrome browser, while the GOOGLE function relies on the googlesearch-python package.

FellowTraveler commented 4 months ago

maybe just add other search APIs like serp etc