Skip to content

Commit 4a96dc5

Browse files
authored
Support overriding tool description (#4)
1 parent d543d0e commit 4a96dc5

File tree

1 file changed

+3
-3
lines changed
  • python/thirdweb-ai/src/thirdweb_ai/tools

1 file changed

+3
-3
lines changed

python/thirdweb-ai/src/thirdweb_ai/tools/tool.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,12 @@ def decorator(func: Callable[..., Any]):
248248
raise ValueError("Tool description is required")
249249

250250
@functools.wraps(func)
251-
def wrapper(cls: Any):
251+
def wrapper(cls: Any, description: str | None = None, name: str | None = None):
252252
return FunctionTool(
253253
func_definition=func,
254254
func_execute=lambda _cls=cls, *args, **kwargs: func(_cls, *args, **kwargs),
255-
description=func_description,
256-
name=func_name,
255+
description=description or func_description,
256+
name=name or func_name,
257257
strict=strict,
258258
)
259259

0 commit comments

Comments
 (0)