AIDE 使用与配置指南
1. 项目目录结构及介绍
AIDE 项目目录结构如下:
aideml/
├── .github/ # GitHub 仓库相关文件
├── .streamlit/ # Streamlit Web UI 相关文件
├── aide/ # AIDE 核心代码
│ ├── webui/ # Web UI 相关代码
│ └── ... # 其他 AIDE 功能模块
├── sample_results/ # 示例结果数据
├── Dockerfile # Docker 配置文件
├── LICENSE # 项目许可证文件
├── Makefile # Makefile 配置文件
├── README.md # 项目说明文件
├── requirements.txt # 项目依赖文件
└── setup.py # 项目安装与设置文件
.github/
:包含 GitHub Actions 工作流等 GitHub 仓库相关文件。.streamlit/
:Streamlit Web UI 的相关配置和脚本。aide/
:存放 AIDE 的核心代码,包括 Web UI 和其他功能模块。sample_results/
:包含示例结果数据。Dockerfile
:用于构建 AIDE 的 Docker 容器。LICENSE
:项目使用的开源许可证。Makefile
:Makefile 文件用于定义项目的构建过程。README.md
:项目说明文档,介绍项目的相关信息。requirements.txt
:项目依赖文件,列出了项目运行所需的 Python 包。setup.py
:项目安装与设置脚本,用于安装项目。
2. 项目的启动文件介绍
AIDE 的启动方式有两种:通过 Web UI 或命令行。
通过 Web UI 启动
- 确保已安装 AIDE 开发版本及其依赖。
- 切换到
aide/webui
目录。 - 运行 Streamlit 应用:
streamlit run app.py
或者在项目根目录运行:
streamlit run aide/webui/app.py
通过命令行启动
- 确保已安装 Python 3.10 或以上版本。
- 安装 AIDE:
pip install -U aideml
- 设置 API 密钥:
export OPENAI_API_KEY=<your API key>
# 或者
export ANTHROPIC_API_KEY=<your API key>
- 运行 AIDE:
aide data_dir="<path to your data directory>" goal="<describe the agent's goal>" eval="<evaluation metric>"
例如,运行 AIDE 进行房价预测任务:
aide data_dir="example_tasks/house_prices" goal="Predict the sales price for each house" eval="Use the RMSE metric between the logarithm of the predicted and observed values."
3. 项目的配置文件介绍
AIDE 的配置文件主要包括 config.yaml
。
config.yaml
文件用于配置 AIDE 运行的相关参数,例如:
agent.code.model
:指定代理使用的编程模型(默认为gpt-4-turbo
)。agent.steps
:配置代理运行的改进迭代次数(默认为 20)。agent.search.num_drafts
:配置代理生成的初始草稿数量(默认为 5)。
根据需求,可以在 config.yaml
中调整更多配置项,以满足特定的使用场景。