mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-17 20:49:48 +00:00
add tools api with a stub provider impl
This commit is contained in:
parent
3b4b2ea30c
commit
72dab3e4bf
14 changed files with 310 additions and 1 deletions
|
|
@ -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,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue