File tree Expand file tree Collapse file tree
python/beeai_framework/tools Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939
4040
4141class 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 )
You can’t perform that action at this time.
0 commit comments