working tools runtime

This commit is contained in:
Dinesh Yeduguru 2024-12-17 12:55:59 -08:00
parent 744eb0888c
commit 84d01fe8f8
6 changed files with 224 additions and 5 deletions

View file

@ -49,6 +49,10 @@ class Tool(Resource):
)
class ToolStore(Protocol):
def get_tool(self, identifier: str) -> Tool: ...
@runtime_checkable
@trace_protocol
class Tools(Protocol):
@ -88,6 +92,8 @@ class Tools(Protocol):
@runtime_checkable
@trace_protocol
class ToolRuntime(Protocol):
tool_store: ToolStore
@webmethod(route="/tool-runtime/invoke", method="POST")
async def invoke_tool(self, tool_id: str, args: Dict[str, Any]) -> Any:
"""Run a tool with the given arguments"""