mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-17 07:07:19 +00:00
donot use global state
This commit is contained in:
parent
4b6367838f
commit
26a14c1d92
5 changed files with 19 additions and 11 deletions
|
@ -7,6 +7,8 @@
|
|||
from typing import Any
|
||||
|
||||
from llama_stack.distribution.datatypes import * # noqa: F403
|
||||
import llama_stack.distribution.store as distribution_store
|
||||
|
||||
from .routing_tables import (
|
||||
DatasetsRoutingTable,
|
||||
MemoryBanksRoutingTable,
|
||||
|
@ -20,6 +22,7 @@ async def get_routing_table_impl(
|
|||
api: Api,
|
||||
impls_by_provider_id: Dict[str, RoutedProtocol],
|
||||
_deps,
|
||||
dist_registry: distribution_store.Registry,
|
||||
) -> Any:
|
||||
api_to_tables = {
|
||||
"memory_banks": MemoryBanksRoutingTable,
|
||||
|
@ -32,7 +35,7 @@ async def get_routing_table_impl(
|
|||
if api.value not in api_to_tables:
|
||||
raise ValueError(f"API {api.value} not found in router map")
|
||||
|
||||
impl = api_to_tables[api.value](impls_by_provider_id)
|
||||
impl = api_to_tables[api.value](impls_by_provider_id, dist_registry)
|
||||
await impl.initialize()
|
||||
return impl
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue