Google 在 Gemini API 预览 Tool Retrieval,按需加载工具参数
Google 在 Gemini API 的 Interactions API 中预览 Tool Retrieval 功能:模型只看到工具名和简短描述,参数 schema 在需要时才加载,避免每次请求都携带全部工具定义。Google 文档称,几十个函数声明每次请求可消耗数万 token。用法是在 tools 数组加入 tool_search,并对函数设 defer_loading: true;模型需要时依次返回 tool_search_call、tool_search_result、function_call,前两步…
推荐理由接入几十个函数或 MCP 工具的 Agent,可省下每次请求数万 token 的工具定义开销