mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-19 08:58:40 +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
|
|
@ -0,0 +1,14 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the terms described in the LICENSE file in
|
||||
# the root directory of this source tree.
|
||||
|
||||
from .config import MetaReferenceToolRuntimeConfig
|
||||
from .meta_reference import MetaReferenceToolRuntimeImpl
|
||||
|
||||
|
||||
async def get_provider_impl(config: MetaReferenceToolRuntimeConfig, _deps):
|
||||
impl = MetaReferenceToolRuntimeImpl(config)
|
||||
await impl.initialize()
|
||||
return impl
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the terms described in the LICENSE file in
|
||||
# the root directory of this source tree.
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class MetaReferenceToolRuntimeConfig(BaseModel):
|
||||
pass
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the terms described in the LICENSE file in
|
||||
# the root directory of this source tree.
|
||||
|
||||
from typing import Any, Dict
|
||||
|
||||
from llama_stack.apis.tools import Tool, ToolRuntime
|
||||
from llama_stack.providers.datatypes import ToolsProtocolPrivate
|
||||
|
||||
from .config import MetaReferenceToolRuntimeConfig
|
||||
|
||||
|
||||
class MetaReferenceToolRuntimeImpl(ToolsProtocolPrivate, ToolRuntime):
|
||||
def __init__(self, config: MetaReferenceToolRuntimeConfig):
|
||||
self.config = config
|
||||
|
||||
async def initialize(self):
|
||||
pass
|
||||
|
||||
async def register_tool(self, tool: Tool):
|
||||
print(f"registering tool {tool.identifier}")
|
||||
pass
|
||||
|
||||
async def unregister_tool(self, tool_id: str) -> None:
|
||||
pass
|
||||
|
||||
async def invoke_tool(self, tool_id: str, args: Dict[str, Any]) -> Any:
|
||||
pass
|
||||
Loading…
Add table
Add a link
Reference in a new issue