add tools api with a stub provider impl

This commit is contained in:
Dinesh Yeduguru 2024-12-13 12:09:12 -08:00
parent 3b4b2ea30c
commit 72dab3e4bf
14 changed files with 310 additions and 1 deletions

View file

@ -15,6 +15,7 @@ from llama_stack.apis.safety import * # noqa: F403
from llama_stack.apis.datasetio import * # noqa: F403
from llama_stack.apis.scoring import * # noqa: F403
from llama_stack.apis.eval import * # noqa: F403
from llama_stack.apis.tools import * # noqa: F403
class MemoryRouter(Memory):
@ -372,3 +373,23 @@ class EvalRouter(Eval):
task_id,
job_id,
)
class ToolRuntimeRouter(ToolRuntime):
def __init__(
self,
routing_table: RoutingTable,
) -> None:
self.routing_table = routing_table
async def initialize(self) -> None:
pass
async def shutdown(self) -> None:
pass
async def invoke_tool(self, tool_id: str, args: Dict[str, Any]) -> Any:
return await self.routing_table.get_provider_impl(tool_id).invoke_tool(
tool_id=tool_id,
args=args,
)