mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-04 04:04:14 +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
|
@ -23,6 +23,10 @@ from .api import (
|
|||
from .event_logger import EventLogger
|
||||
|
||||
|
||||
async def get_client_impl(base_url: str):
|
||||
return InferenceClient(base_url)
|
||||
|
||||
|
||||
class InferenceClient(Inference):
|
||||
def __init__(self, base_url: str):
|
||||
print(f"Initializing client for {base_url}")
|
||||
|
|
|
@ -6,11 +6,13 @@
|
|||
|
||||
import asyncio
|
||||
|
||||
from typing import AsyncIterator, Union
|
||||
from typing import AsyncIterator, Dict, Union
|
||||
|
||||
from llama_models.llama3_1.api.datatypes import StopReason
|
||||
from llama_models.sku_list import resolve_model
|
||||
|
||||
from llama_toolchain.distribution.datatypes import Adapter, ApiSurface
|
||||
|
||||
from .api.config import MetaReferenceImplConfig
|
||||
from .api.datatypes import (
|
||||
ChatCompletionResponseEvent,
|
||||
|
@ -27,7 +29,9 @@ from .api.endpoints import (
|
|||
from .model_parallel import LlamaModelParallelGenerator
|
||||
|
||||
|
||||
async def get_adapter_impl(config: MetaReferenceImplConfig):
|
||||
async def get_adapter_impl(
|
||||
config: MetaReferenceImplConfig, _deps: Dict[ApiSurface, Adapter]
|
||||
):
|
||||
assert isinstance(
|
||||
config, MetaReferenceImplConfig
|
||||
), f"Unexpected config type: {type(config)}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue