FunctionTool declares every functools.partial as `partial` and drops the `__call__` docstring
还没有人认领这个 Issue。
评估
调研方向
Start in google.adk.tools.function_tool.FunctionTool and google.adk.models.llm_request.LlmRequest, using the reported Python 3.13 reproduction to trace tool naming and declaration descriptions. Done means both functools.partial tools retain distinct names and docstrings, and OrderLookup's call docstring appears in its declaration.
由索引模型根据 Issue 内容生成。
描述
If you bind an API key into two tools with functools.partial, they're both declared as partial with the functools.partial docstring. Only the last one stays registered, so weather calls run get_forecast.
A callable object documented only on __call__ shows that docstring in tool.description, but its declaration doesn't have one.
Repro on main (f33d492), Python 3.13:
from functools import partial
from google.adk.models.llm_request import LlmRequest
from google.adk.tools.function_tool import FunctionTool
def get_weather(key: str, city: str):
"""Current weather for a city."""
def get_forecast(key: str, city: str):
"""Forecast for a city."""
class OrderLookup:
def __call__(self, order_id: str):
"""Finds an order by id."""
req = LlmRequest()
req.append_tools([FunctionTool(partial(get_weather, "k")),
FunctionTool(partial(get_forecast, "k")),
FunctionTool(OrderLookup())])
for d in req.config.tools[0].function_declarations:
print(d.name, repr(d.description))
It logs Duplicate tool name 'partial', prints partial twice, then OrderLookup None. I'd expect each tool under its own name and docstring.
- 主要语言
- Python
- 星标
- 21.6k
- 派生
- 4k
- 平均合并
- 13 小时 49 分钟
- 30 天内合并 PR
- 10
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
google/adk-python 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
google/adk-python#7217 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
google/adk-python#7206 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 86/100
google/adk-python#7205 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
google/adk-python#7196 · 1 条评论 ·
-
eval request clarification
难度 1/5 1-3 小时 新手友好度 86/100
google/adk-python#7146 · 2 条评论 · 已指派 1 人 ·
查看 google/adk-python 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 90/100
-
bug
难度 2/5 1-3 小时 新手友好度 86/100
zostera/django-bootstrap4#894 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
use-agent-os/agent-os#3276 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
难度 2/5 1-3 小时 新手友好度 88/100
NousResearch/hermes-agent#117848 ·