mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-18 20:59:47 +00:00
add tools api with a stub provider impl
This commit is contained in:
parent
e65a6fac9d
commit
e5ac10f803
14 changed files with 172 additions and 37 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