community[patch],core[minor]: Move BaseToolKit to core.tools (#20669)

This commit is contained in:
Eugene Yurtsev
2024-04-22 14:04:30 -04:00
committed by GitHub
parent ce23f8293a
commit 38adbfdf34
2 changed files with 11 additions and 14 deletions

View File

@@ -22,7 +22,7 @@ from __future__ import annotations
import inspect
import uuid
import warnings
from abc import abstractmethod
from abc import ABC, abstractmethod
from functools import partial
from inspect import signature
from typing import Any, Awaitable, Callable, Dict, List, Optional, Tuple, Type, Union
@@ -1038,3 +1038,11 @@ args: {"expression": {"type": "string"}}
args_schema = str(tool.args)
tool_strings.append(f"{tool.name}: {tool.description}, args: {args_schema}")
return "\n".join(tool_strings)
class BaseToolkit(BaseModel, ABC):
"""Base Toolkit representing a collection of related tools."""
@abstractmethod
def get_tools(self) -> List[BaseTool]:
"""Get the tools in the toolkit."""