Skip to content

Commit 8e18bb0

Browse files
authored
docs(tools): add docstrings to tool base class (#1409)
Signed-off-by: iron-prog <dt915725@gmail.com>
1 parent 077af0c commit 8e18bb0

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • python/beeai_framework/tools

python/beeai_framework/tools/tool.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939

4040

4141
class Tool(Generic[TInput, TRunOptions, TOutput], ABC):
42+
"""
43+
Base class for all tools in the BeeAI framework.
44+
Handles tool initialization, input validation, execution, and caching.
45+
"""
4246
def __init__(self, options: dict[str, Any] | None = None) -> None:
4347
self._options: dict[str, Any] | None = options or None
4448
self._cache = self.options.get("cache", NullCache[TOutput]()) if self.options else NullCache[TOutput]()
@@ -257,6 +261,9 @@ def tool(
257261
with_context: bool = False,
258262
emitter: Emitter | None = None,
259263
) -> AnyTool | Callable[[TFunction], AnyTool]:
264+
"""
265+
Decorator to easily create a Tool instance from a standard Python function.
266+
"""
260267
def create_tool(fn: TFunction) -> AnyTool:
261268
tool_name = name or fn.__name__
262269
tool_description = description or inspect.getdoc(fn)

0 commit comments

Comments
 (0)