Bromate 는 웹 브라우저 상호 작용을 자동화하기위한 에이전트 워크 플로의 기능을 탐색하는 실험 프로젝트입니다.
Bromate는 자연 언어로 표현 된 사용자 요청을 이해하고 웹 브라우징 작업을 자동화하는 일련의 작업으로 변환하기 위해 대형 언어 모델 (LLM), 특히 Google의 Gemini의 힘을 활용합니다.
브라우저 제어 및 상호 작용에 셀레늄을 사용하여 웹 브라우저 환경 내에서 복잡한 워크 플로우를 자동화하는 완벽한 방법을 제공합니다.
Bromate를 사용하기 전에 Gemini API의 경우 Google에서 API 키를 얻어야합니다. 다음 단계를 수행하여 키를 얻을 수 있습니다.
개발 중에 .env 에서 API 키 설정 :
프로젝트 저장소에서 .env 파일에서 API 키를 설정할 수 있습니다.
GOOGLE_API_KEY=YOUR_API_KEY 쉘에서 echo $GOOGLE_API_KEY 입력하여 키가 구성되어 있는지 확인할 수 있습니다.
Bromate는 PYPI에서 사용할 수 있으며 PIP를 사용하여 쉽게 설치할 수 있습니다.
pip install bromateBromate를 사용하려면 자동화하려는 작업을 설명하는 자연어 쿼리를 제공 할 수 있습니다. 그런 다음 Bromate는 에이전트 (Gemini)와 상호 작용하여 쿼리를 해석하고 Selenium Webdriver가 실행할 일련의 조치를 생성합니다.
예 1 : MLOPS 커뮤니티 뉴스 레터 구독 :
Bromate "https://mlops.community 웹 사이트를 엽니 다. 'Join'링크를 클릭하십시오. 'hello@mlops'주소를 작성하십시오."
예 2 : Python 언어의 최신 버전 찾기 :
bromate-interaction.stay_open = false --agent.name "gemini-1.5-pro-latest" "python.org로 이동하십시오. 다운로드 페이지를 클릭하십시오. 향후 Python 릴리스를 위해 PEP 링크를 클릭하십시오. 릴리스 일정 날짜를 요약하십시오."
bromate -h
usage: bromate [-h] [--agent JSON] [--agent.api_key {SecretStr,null}] [--agent.name str] [--agent.temperature float] [--agent.candidate_count int]
[--agent.max_output_tokens int] [--agent.system_instructions str] [--action JSON] [--action.sleep_time float] [--driver JSON]
[--driver.name {Chrome,Firefox}] [--driver.keep_alive bool] [--driver.maximize_window bool] [--execution JSON] [--execution.stop_actions list[str]]
[--execution.default_message str] [--interaction JSON] [--interaction.stay_open bool] [--interaction.interactive bool] [--interaction.max_interactions int]
QUERY
Execute actions on web browser from a user query in natural language.
positional arguments:
QUERY User query in natural language
options:
-h , --help show this help message and exit
agent options:
Configuration of the agent
--agent JSON set agent from JSON string
--agent.api_key {SecretStr,null}
API key of the agent platform (Google) (default: ********** )
--agent.name str Name of the agent to use (default: gemini-1.5-flash-latest)
--agent.temperature float
Temperature of the agent (default: 0.0)
--agent.candidate_count int
Number of candidates to generate (default: 1)
--agent.max_output_tokens int
Maximum output tokens to generate (default: 1000)
--agent.system_instructions str
System instructions for the agent (default: You are a browser automation system. Your goal is to understand the user request and execute actions
on its browser using the tools at your disposal. After each step, you will receive a screenshot and the page source of the current browser
window.)
action options:
Configuration for all actions
--action JSON set action from JSON string
--action.sleep_time float
Time to sleep after loading a page (default: 0.5)
driver options:
Configuration of the web driver
--driver JSON set driver from JSON string
--driver.name {Chrome,Firefox}
Name of the driver to use (default: Chrome)
--driver.keep_alive bool
Keep the browser open at the end of the execution (default: True)
--driver.maximize_window bool
Maximize the browser window at the start of the execution (default: True)
execution options:
Configuration of the execution
--execution JSON set execution from JSON string
--execution.stop_actions list[str]
Name of actions that can stop the execution (default: [ ' done ' ])
--execution.default_message str
Default message to send to the agent when no input is provided by the user (default: Continue the execution if necessary or call the done tool if
you are done)
interaction options:
Configuration of the interaction
--interaction JSON set interaction from JSON string
--interaction.stay_open bool
Keep the browser open before exiting (default: True)
--interaction.interactive bool
Ask for user input after every action (default: False)
--interaction.max_interactions int
Maximum number of interactions for the agent (default: 5)Bromate는 루프에서 작동하여 Gemini 에이전트 및 Selenium Webdriver와 지속적으로 상호 작용하여 브라우저 작업을 자동화합니다. 다음은 핵심 행동의 고장입니다.
1. 초기화 :
src/bromate/actions.py 파일에 정의됩니다. 예제는 다음과 같습니다.get : 브라우저에서 특정 URL을 엽니 다.click : CSS 선택기에서 식별 된 요소를 클릭하십시오.write : 요소에 텍스트를 입력하십시오.back : 이전 페이지로 다시 탐색하십시오.done : 자동화 작업의 끝을 신호하십시오.2. 행동 선택 및 실행 :
3. 피드백 루프 :
done 작업을 실행하기로 결정할 때까지 계속됩니다. 작업이 완료되거나 최대 상호 작용에 도달 할 수 있습니다.이 반복 프로세스를 통해 Bromate는 브라우저 환경의 변화에 동적으로 적응하고 자연어 지침에 따라 복잡한 자동화 작업을 수행 할 수 있습니다.
Bromate의 개발 워크 플로우는 Pyinvoke를 사용하여 관리됩니다. tasks/ 폴더에는 프로젝트 관리를위한 다양한 작업이 포함되어 있습니다.
Bromate는 MIT 라이센스에 따라 라이센스가 부여됩니다. 자세한 내용은 라이센스 파일을 참조하십시오.