mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-17 23:39:48 +00:00
working tools runtime
This commit is contained in:
parent
744eb0888c
commit
84d01fe8f8
6 changed files with 224 additions and 5 deletions
|
|
@ -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"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue