-
Notifications
You must be signed in to change notification settings - Fork 775
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add tools api with a stub provider impl
- Loading branch information
Showing
14 changed files
with
172 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
llama_stack/providers/inline/tool_runtime/meta_reference/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
llama_stack/providers/inline/tool_runtime/meta_reference/meta_reference.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
7 changes: 0 additions & 7 deletions
7
llama_stack/providers/inline/tools/meta_reference/__init__.py
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
llama_stack/providers/inline/tools/meta_reference/meta_reference.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# 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 List | ||
|
||
from llama_stack.distribution.datatypes import Api, InlineProviderSpec, ProviderSpec | ||
|
||
|
||
def available_providers() -> List[ProviderSpec]: | ||
return [ | ||
InlineProviderSpec( | ||
api=Api.tool_runtime, | ||
provider_type="inline::meta-reference", | ||
pip_packages=[], | ||
module="llama_stack.providers.inline.tool_runtime.meta_reference", | ||
config_class="llama_stack.providers.inline.tool_runtime.meta_reference.MetaReferenceToolRuntimeConfig", | ||
), | ||
] |