adk-tool-scaffold

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

ADK Tool Scaffold Skill

ADK Tool 脚手架技能

This skill automates the creation of standard
BaseTool
implementations for the Agent Development Kit.
该技能可自动为Agent开发工具包创建标准的
BaseTool
实现。

Instructions

操作说明

  1. Identify the Tool Name: Extract the name of the tool the user wants to build (e.g., "StockPrice", "EmailSender").
  2. Review the Example: Check
    examples/WeatherTool.py
    to understand the expected structure of an ADK tool (imports, inheritance, schema).
  3. Run the Scaffolder: Execute the python script to generate the initial file.
    bash
    python scripts/scaffold_tool.py <ToolName>
  4. Refine: After generation, you must edit the file to:
    • Update the
      execute
      method with real logic.
    • Define the JSON schema in
      get_schema
      .
  1. 确定工具名称: 提取用户想要构建的工具名称(例如:"StockPrice"、"EmailSender")。
  2. 查看示例: 查看
    examples/WeatherTool.py
    以了解ADK工具的预期结构(导入、继承、模式)。
  3. 运行脚手架生成器: 执行Python脚本以生成初始文件。
    bash
    python scripts/scaffold_tool.py <ToolName>
  4. 优化完善: 生成后,你需要编辑文件以:
    • 使用实际逻辑更新
      execute
      方法。
    • get_schema
      中定义JSON模式。

Example Usage

示例用法

User: "Create a tool to search Wikipedia." Agent:
  1. Runs
    python scripts/scaffold_tool.py WikipediaSearch
  2. Editing
    WikipediaSearchTool.py
    to add the
    requests
    logic and
    query
    argument schema.
用户:"创建一个用于搜索维基百科的工具。" Agent:
  1. 运行
    python scripts/scaffold_tool.py WikipediaSearch
  2. 编辑
    WikipediaSearchTool.py
    以添加
    requests
    逻辑和
    query
    参数模式。