mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-20 15:34:23 +01:00
consolidate browser settings
This commit is contained in:
@@ -9,9 +9,6 @@ BROWSE_CHUNK_MAX_LENGTH=8192
|
|||||||
# USER_AGENT="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36"
|
# USER_AGENT="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36"
|
||||||
# AI_SETTINGS_FILE - Specifies which AI Settings file to use (defaults to ai_settings.yaml)
|
# AI_SETTINGS_FILE - Specifies which AI Settings file to use (defaults to ai_settings.yaml)
|
||||||
AI_SETTINGS_FILE=ai_settings.yaml
|
AI_SETTINGS_FILE=ai_settings.yaml
|
||||||
# USE_WEB_BROWSER - Sets the web-browser drivers to use with selenium (defaults to chrome).
|
|
||||||
# Note: set this to either 'chrome', 'firefox', or 'safari' depending on your current browser
|
|
||||||
# USE_WEB_BROWSER=chrome
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
### LLM PROVIDER
|
### LLM PROVIDER
|
||||||
@@ -138,8 +135,11 @@ GITHUB_USERNAME=your-github-username
|
|||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
### BROWSER
|
### BROWSER
|
||||||
# HEADLESS_BROWSER - Whether to run the browser in headless mode
|
# USE_WEB_BROWSER - Sets the web-browser drivers to use with selenium (defaults to chrome).
|
||||||
HEADLESS_BROWSER=True
|
# HEADLESS_BROWSER - Whether to run the browser in headless mode (defaults to True)
|
||||||
|
# Note: set this to either 'chrome', 'firefox', or 'safari' depending on your current browser
|
||||||
|
# USE_WEB_BROWSER=chrome
|
||||||
|
# HEADLESS_BROWSER=True
|
||||||
|
|
||||||
### GOOGLE
|
### GOOGLE
|
||||||
# GOOGLE_API_KEY - Google API key (Example: my-google-api-key)
|
# GOOGLE_API_KEY - Google API key (Example: my-google-api-key)
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ def scrape_text_with_selenium(url: str) -> tuple[WebDriver, str]:
|
|||||||
options.add_argument("--remote-debugging-port=9222")
|
options.add_argument("--remote-debugging-port=9222")
|
||||||
|
|
||||||
options.add_argument("--no-sandbox")
|
options.add_argument("--no-sandbox")
|
||||||
if CFG.headless_browser:
|
if CFG.selenium_headless:
|
||||||
options.add_argument("--headless")
|
options.add_argument("--headless")
|
||||||
options.add_argument("--disable-gpu")
|
options.add_argument("--disable-gpu")
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ class Config(metaclass=Singleton):
|
|||||||
self.skip_reprompt = False
|
self.skip_reprompt = False
|
||||||
self.allow_downloads = False
|
self.allow_downloads = False
|
||||||
|
|
||||||
self.selenium_web_browser = os.getenv("USE_WEB_BROWSER", "chrome")
|
|
||||||
self.ai_settings_file = os.getenv("AI_SETTINGS_FILE", "ai_settings.yaml")
|
self.ai_settings_file = os.getenv("AI_SETTINGS_FILE", "ai_settings.yaml")
|
||||||
self.fast_llm_model = os.getenv("FAST_LLM_MODEL", "gpt-3.5-turbo")
|
self.fast_llm_model = os.getenv("FAST_LLM_MODEL", "gpt-3.5-turbo")
|
||||||
self.smart_llm_model = os.getenv("SMART_LLM_MODEL", "gpt-4")
|
self.smart_llm_model = os.getenv("SMART_LLM_MODEL", "gpt-4")
|
||||||
@@ -87,7 +86,11 @@ class Config(metaclass=Singleton):
|
|||||||
"HUGGINGFACE_AUDIO_TO_TEXT_MODEL"
|
"HUGGINGFACE_AUDIO_TO_TEXT_MODEL"
|
||||||
)
|
)
|
||||||
|
|
||||||
# User agent headers to use when browsing web
|
# Selenium browser settings
|
||||||
|
self.selenium_web_browser = os.getenv("USE_WEB_BROWSER", "chrome")
|
||||||
|
self.selenium_headless = os.getenv("HEADLESS_BROWSER", "True") == "True"
|
||||||
|
|
||||||
|
# User agent header to use when making HTTP requests
|
||||||
# Some websites might just completely deny request with an error code if
|
# Some websites might just completely deny request with an error code if
|
||||||
# no user agent was found.
|
# no user agent was found.
|
||||||
self.user_agent = os.getenv(
|
self.user_agent = os.getenv(
|
||||||
@@ -95,7 +98,7 @@ class Config(metaclass=Singleton):
|
|||||||
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36"
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36"
|
||||||
" (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36",
|
" (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36",
|
||||||
)
|
)
|
||||||
self.headless_browser = os.getenv('HEADLESS_BROWSER',"True") == "True"
|
|
||||||
self.redis_host = os.getenv("REDIS_HOST", "localhost")
|
self.redis_host = os.getenv("REDIS_HOST", "localhost")
|
||||||
self.redis_port = os.getenv("REDIS_PORT", "6379")
|
self.redis_port = os.getenv("REDIS_PORT", "6379")
|
||||||
self.redis_password = os.getenv("REDIS_PASSWORD", "")
|
self.redis_password = os.getenv("REDIS_PASSWORD", "")
|
||||||
|
|||||||
Reference in New Issue
Block a user