[เว็บไซต์] [arxiv] [PDF]
Cradle Framework ช่วยให้โมเดลมูลนิธิตั้งขึ้นใหม่ในการทำงานคอมพิวเตอร์ที่ซับซ้อนผ่านการใช้อินเทอร์เฟซแบบ Unified Interface เดียวกันเช่นการใช้งานเช่นภาพหน้าจอเป็นอินพุตและการดำเนินการแป้นพิมพ์และเมาส์เป็นเอาต์พุต
คลิกที่ภาพย่อวิดีโอด้านบนเพื่อดูบน YouTube
ขณะนี้เราให้การเข้าถึง API ของ Openai และ Claude โปรดสร้างไฟล์ .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 เป็นคีย์ API ของมานุษยวิทยา คุณสามารถรับได้จากมานุษยวิทยา
RF_CLAUDE_AK และ RF_CLAUDE_SK เป็นคีย์ API RESTFUL และรหัสลับสำหรับ Claude API
IDE_NAME หมายถึงสภาพแวดล้อม IDE ที่รหัสของที่เก็บทำงานเช่น PyCharm
หรือ Code
(vScode) ส่วนใหญ่จะใช้เพื่อเปิดใช้งานการสลับอัตโนมัติระหว่าง IDE และสภาพแวดล้อมเป้าหมาย
โปรดตั้งค่าสภาพแวดล้อม Python ของคุณและติดตั้งการพึ่งพาที่ต้องการเป็น:
# 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
│ └── ...
└── ...
เนื่องจากการตั้งค่าของเกมแต่ละเกมและระบบปฏิบัติการที่เข้ากันได้นั้นแตกต่างกัน Cradle จึงไม่สามารถแทนที่ชื่อเกมหนึ่งเกมเพื่อย้ายไปยังเกมใหม่ได้ เราขอแนะนำให้พิจารณาแต่ละเกมโดยเฉพาะ ตัวอย่างเช่น RDR2 ซึ่งเป็นเกม AAA อิสระต้องใช้การต่อสู้แบบเรียลไทม์ดังนั้นเราจึงต้องหยุดเกมชั่วคราวเพื่อรอการตอบสนองของ GPT-4O จากนั้นปล่อยเกมออกไปเพื่อดำเนินการ Stardew มีปัญหาเดียวกัน เกมอื่น ๆ เช่นชีวิตของตัวแทนจำหน่าย 2 และเมือง: Skylines ไม่มีข้อกำหนดแบบเรียลไทม์ดังนั้นพวกเขาจึงไม่จำเป็นต้องหยุดชั่วคราว หากเกมใหม่คล้ายกับเกมหลังเราขอแนะนำให้คัดลอกเมือง: การใช้งานของ Skylines และติดตามเส้นทางการใช้งานเพื่อสร้างโมดูลที่เกี่ยวข้อง แม้ว่าแต่ละเกมอาจแตกต่างกันอย่างมีนัยสำคัญ แต่เฟรมเวิร์ก Cradle ของเรายังคงสามารถปรับตัวแบบครบวงจรสำหรับเกมได้ สมมติว่าชื่อเกมใหม่คือ 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}
}