安装 ADK¶
创建并激活虚拟环境¶
我们推荐使用 venv 创建一个虚拟的 Python 环境:
现在,你可以根据你的操作系统和环境,使用以下命令激活虚拟环境:
# Mac / Linux
source .venv/bin/activate
# Windows CMD:
.venv\Scripts\activate.bat
# Windows PowerShell:
.venv\Scripts\Activate.ps1
安装 ADK¶
(可选)验证你的安装:
你可以使用 maven 或 gradle 添加 google-adk
和 google-adk-dev
包。
google-adk
是核心 Java ADK 库。Java ADK 还带有一个可插拔的示例 SpringBoot 服务器,可以让你的智能体无缝运行。这个可选包包含在 google-adk-dev
中。
If you are using maven, add the following to your pom.xml
:
pom.xml
<dependencies>
<!-- ADK 核心依赖 -->
<dependency>
<groupId>com.google.adk</groupId>
<artifactId>google-adk</artifactId>
<version>0.1.0</version>
</dependency>
<!-- 用于调试智能体的 ADK Dev Web UI(可选) -->
<dependency>
<groupId>com.google.adk</groupId>
<artifactId>google-adk-dev</artifactId>
<version>0.1.0</version>
</dependency>
</dependencies>
Here's a complete pom.xml file for reference.
If you are using gradle, add the dependency to your build.gradle:
下一步¶
- 通过快速入门创建你的第一个智能体