diff --git a/notes/day-02.md b/notes/day-02.md index fbb79ed..f93a81d 100644 --- a/notes/day-02.md +++ b/notes/day-02.md @@ -13,9 +13,13 @@ - 可以使用 `uvx adk web` 命令启动 Web 界面与智能体交互 - 支持使用 Gemini 模型(如 `gemini-2.5-flash` 或 `gemini-3`) - 使用 `uvx` 可以直接运行 ADK 命令,无需预先安装 `google-adk` 包 +- 在 `root_agent.yaml` 中加入 `tools` 字段即可配置工具 ## Challenges Faced +- 后续使用方便起见,这次直接安装了完整的 `google-adk` 包 +- 注意⚠️:其中的 `MCP` 组件强制要求Python版本在**3.10**以上,新建环境时要注意编译器的选择 +- 在Pycharm终端调用agent互动时,无法显式输出日志,只能通过prompt要求输出思考过程 - 网站上给的 command 是错误的,运行 `uvx --from google-adk adk web` 时默认时读取 a directory of agents,而不是在 agent directory。 - Tutorial: AI agent with Google Search(YAML) instruction 也是错的. `adk web` 运行的时候directory应该在agent的parent folder里。 - Tutorial: Multi-agent app with MCP (YAML) 要安装Node.Js 是firecrawl的dependency。firecrawl需要注册,free tier不需要花钱,api key能在设置里找到。 @@ -41,6 +45,9 @@ name: root_agent description: A helpful assistant for user questions. instruction: Answer user questions to the best of your knowledge. model: gemini-2.5-flash + +tools: + - name: google_search ``` ### `adk api_server` 的使用 以调取api的模式使用agent不能直接点击网页或者和UI直接交互。just in case有人和我一样不懂怎么调取api,下面是使用范例。