mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-04 12:07:34 +00:00
Bring agentic system api to toolchain
Add adapter dependencies and resolve adapters using a topological sort
This commit is contained in:
parent
b0e5340645
commit
be19b22391
31 changed files with 2740 additions and 25 deletions
|
@ -21,6 +21,10 @@ from .api import (
|
|||
)
|
||||
|
||||
|
||||
async def get_client_impl(base_url: str):
|
||||
return SafetyClient(base_url)
|
||||
|
||||
|
||||
class SafetyClient(Safety):
|
||||
def __init__(self, base_url: str):
|
||||
print(f"Initializing client for {base_url}")
|
||||
|
|
|
@ -6,6 +6,10 @@
|
|||
|
||||
import asyncio
|
||||
|
||||
from typing import Dict
|
||||
|
||||
from llama_toolchain.distribution.datatypes import Adapter, ApiSurface
|
||||
|
||||
from .config import SafetyConfig
|
||||
from .api.endpoints import * # noqa
|
||||
from .shields import (
|
||||
|
@ -19,7 +23,7 @@ from .shields import (
|
|||
)
|
||||
|
||||
|
||||
async def get_adapter_impl(config: SafetyConfig):
|
||||
async def get_adapter_impl(config: SafetyConfig, _deps: Dict[ApiSurface, Adapter]):
|
||||
assert isinstance(config, SafetyConfig), f"Unexpected config type: {type(config)}"
|
||||
|
||||
impl = MetaReferenceSafetyImpl(config)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue