[웹 사이트] [ARXIV] [PDF]
Cradle Framework는 초기 기초 모델이 동일한 통합 인터페이스 인간 사용, 즉 입력 및 키보드 및 마우스 작업을 출력과 동일한 통합 인터페이스 인간 사용을 통해 복잡한 컴퓨터 작업을 수행하도록 권한을 부여합니다.
위의 비디오 썸네일 중 하나를 클릭하여 YouTube에서 시청하십시오.
우리는 현재 OpenAi 및 Claude의 API에 대한 액세스를 제공합니다. 리포지토리의 루트에 .env
파일을 작성하여 키를 저장하십시오 (그 중 하나는 충분합니다).
개인 정보가 포함 된 샘플 .env
파일 :
OA_OPENAI_KEY = "abc123abc123abc123abc123abc123ab"
RF_CLAUDE_AK = "abc123abc123abc123abc123abc123ab" # Access Key for Claude
RF_CLAUDE_SK = "123abc123abc123abc123abc123abc12" # Secret Access Key for Claude
AZ_OPENAI_KEY = "123abc123abc123abc123abc123abc12"
AZ_BASE_URL = "https://abc123.openai.azure.com/"
RF_CLAUDE_AK = "abc123abc123abc123abc123abc123ab"
RF_CLAUDE_SK = "123abc123abc123abc123abc123abc12"
IDE_NAME = "Code"
OA_OPENAI_KEY는 OpenAI API 키입니다. Openai에서 얻을 수 있습니다.
AZ_OPENAI_KEY는 Azure OpenAI API 키입니다. Azure Portal에서 얻을 수 있습니다.
OA_CLAUDE_KEY는 의인성 Claude API 키입니다. 당신은 인류에서 그것을 얻을 수 있습니다.
RF_CLAUDE_AK 및 RF_CLAUDE_SK는 Claude API의 AWS RESTFUL API 키 및 비밀 키입니다.
IDE_NAME은 PyCharm
또는 Code
(VSCODE)와 같은 저장소의 코드가 실행되는 IDE 환경을 나타냅니다. 주로 IDE와 대상 환경 사이의 자동 전환을 가능하게하는 데 사용됩니다.
파이썬 환경을 설정하고 필요한 종속성을 다음과 같이 설치하십시오.
# Clone the repository
git clone https://github.com/BAAI-Agents/Cradle.git
cd Cradle
# Create a new conda environment
conda create --name cradle-dev python=3.10
conda activate cradle-dev
pip install -r requirements.txt
1. Option 1
# Download best-matching version of specific model for your spaCy installation
python -m spacy download en_core_web_lg
or
# pip install .tar.gz archive or .whl from path or URL
pip install https://github.com/explosion/spacy-models/releases/download/en_core_web_lg-3.7.1/en_core_web_lg-3.7.1.tar.gz
2. Option 2
# Copy this url https://github.com/explosion/spacy-models/releases/download/en_core_web_lg-3.7.1/en_core_web_lg-3.7.1.tar.gz
# Paste it in the browser and download the file to res/spacy/data
cd res/spacy/data
pip install en_core_web_lg-3.7.1.tar.gz
각 게임과 소프트웨어 간의 큰 차이로 인해 아래 각각의 특정 설정을 제공했습니다.
일부 사용자는 우리의 프레임 워크를 새로운 게임에 적용하기를 원할 수 있으므로이 섹션은 주로 크래들의 핵심 디렉토리와 조직 구조를 보여줍니다. 우리는 ""새로운 게임으로 마이그레이션하는 것과 관련된 모듈을 강조하고 나중에 자세한 설명을 제공 할 것입니다.
Cradle
├── cache # Cache the GroundingDino model and the bert-base-uncased model
├── conf # The configuration files for the environment and the llm model
│ ├── env_config_dealers.json
│ ├── env_config_rdr2_main_storyline.json
│ ├── env_config_rdr2_open_ended_mission.json
│ ├── env_config_skylines.json
│ ├── env_config_stardew_cultivation.json
│ ├── env_config_stardew_farm_clearup.json
│ ├── env_config_stardew_shopping.json
│ ├── openai_config.json
│ ├── claude_config.json
│ ├── restful_claude_config.json
│ └── ...
├── deps # The dependencies for the Cradle framework, ignore this folder
├── docs # The documentation for the Cradle framework, ignore this folder
├── res # The resources for the Cradle framework
│ ├── models # Ignore this folder
│ ├── tool # Subfinder for RDR2
│ ├── [game or software] # The resources for game, exmpale: rdr2, dealers, skylines, stardew, outlook, chrome, capcut, meitu, feishu
│ │ ├── prompts # The prompts for the game
│ │ │ └── templates
│ │ │ ├── action_planning.prompt
│ │ │ ├── information_gathering.prompt
│ │ │ ├── self_reflection.prompt
│ │ │ └── task_inference.prompt
│ │ ├── skills # The skills json for the game, it will be generated automatically
│ │ ├── icons # The icons difficult for GPT-4 to recognize in the game can be replaced with text for better recognition using an icon replacer
│ │ └── saves # Save files in the game
│ └── ...
├── requirements.txt # The requirements for the Cradle framework
├── runner.py # The main entry for the Cradle framework
├── cradle # Cradle's core modules
│ ├── config # The configuration for the Cradle framework
│ ├── environment # The environment for the Cradle framework
│ │ ├── [game or software] # The environment for the game, exmpale: rdr2, dealers, skylines, stardew, outlook, chrome, capcut, meitu, feishu
│ │ │ ├── __init__.py # The initialization file for the environment
│ │ │ ├── atomic_skills # Atomic skills in the game. Users should customise them to suit the needs of the game or software, e.g. character movement
│ │ │ ├── composite_skills # Combination skills for atomic skills in games or software
│ │ │ ├── skill_registry.py # The skill registry for the game. Will register all atomic skills and composite skills into the registry.
│ │ │ └── ui_control.py # The UI control for the game. Define functions to pause the game and switch to the game window
│ │ └── ...
│ ├── gameio # Interfaces that directly wrap the skill registry and ui control in the environment
│ ├── log # The log for the Cradle framework
│ ├── memory # The memory for the Cradle framework
│ ├── module # Currently there is only the skill execution module. Later will migrate action planning, self-reflection and other modules from planner and provider
│ ├── planner # The planner for the Cradle framework. Unified interface for action planning, self-reflection and other modules. This module will be deleted later and will be moved to the module module.
│ ├── runner # The logical flow of execution for each game and software. All game and software processes will then be unified into a single runner
│ ├── utils # Defines some helper functions such as save json and load json
│ └── provider # The provider for the Cradle framework. We have semantically decomposed most of the execution flow in the runner into providers
│ ├── augment # Methods for image augmentation
│ ├── llm # Call for the LLM model, e.g. OpenAI's GPT-4o, Claude, etc.
│ ├── module # The module for the Cradle framework. e.g., action planning, self-reflection and other modules. It will be migrated to the cradle/module later.
│ ├── object_detect # Methods for object detection
│ ├── process # Methods for pre-processing and post-processing for action planning, self-reflection and other modules
│ ├── video # Methods for video processing
│ ├── others # Methods for other operations, e.g., save and load coordinates for skylines
│ ├── circle_detector.py # The circle detector for the rdr2
│ ├── icon_replacer.py # Methods for replacing icons with text
│ ├── sam_provider.py # Segment anything for software
│ └── ...
└── ...
각 게임의 설정과 호환되는 운영 체제는 다르기 때문에 크래들은 단순히 하나의 게임 이름을 교체하여 새 게임으로 마이그레이션 할 수 없습니다. 각 게임을 구체적으로 고려하는 것이 좋습니다. 예를 들어, 독립적 인 AAA 게임 인 RDR2는 실시간 전투가 필요하므로 GPT-4O의 응답을 기다린 다음 게임을 해제하여 작업을 실행하기 위해 게임을 일시 중지해야합니다. Stardew는 같은 문제가 있습니다. Dealer 's Life 2 및 도시와 같은 다른 게임에는 실시간 요구 사항이 없으므로 잠시 멈출 필요가 없습니다. 새로운 게임이 후자와 유사한 경우, 도시를 복사하는 것이 좋습니다 : Skylines '구현 및 해당 모듈을 만들기 위해 구현 경로를 따릅니다. 각 게임이 크게 다를 수 있지만 크래들 프레임 워크는 여전히 게임에 대한 통합 적응을 달성 할 수 있습니다. 새로운 게임의 이름이 NewGame 이라고 가정하면 특정 마이그레이션 파이프 라인은 새로운 게임 가이드로 마이그레이션 할 수 있습니다.
우리의 일이 유용하다고 생각되면, 우리를 인용하는 것을 고려하십시오!
@article{tan2024cradle,
title={Cradle: Empowering Foundation Agents towards General Computer Control},
author={Weihao Tan and Wentao Zhang and Xinrun Xu and Haochong Xia and Ziluo Ding and Boyu Li and Bohan Zhou and Junpeng Yue and Jiechuan Jiang and Yewen Li and Ruyi An and Molei Qin and Chuqiao Zong and Longtao Zheng and Yujie Wu and Xiaoqiang Chai and Yifei Bi and Tianbao Xie and Pengjie Gu and Xiyun Li and Ceyao Zhang and Long Tian and Chaojie Wang and Xinrun Wang and Börje F. Karlsson and Bo An and Shuicheng Yan and Zongqing Lu},
journal={arXiv preprint arXiv:2403.03186},
year={2024}
}