FunctionTool declares every functools.partial as `partial` and drops the `__call__` docstring
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 74/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 21.6k
- Fork
- 4k
- Merge medio
- 13h 49m
- PR unite (30g)
- 10
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di google/adk-python
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
google/adk-python#7217 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
google/adk-python#7206 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
google/adk-python#7205 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
google/adk-python#7196 · 1 commento ·
-
eval request clarification
Difficoltà 1/5 1-3 ore Idoneità per principianti 86/100
google/adk-python#7146 · 2 commenti · 1 assegnatario ·
Tutte le issue di google/adk-python
Issue simili
-
link-check link-check:sphinx-theme
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
OpenHands/extensions#626 · 1 commento ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
CSCfi/sd-search-api#39 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100