mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-05 12:21:52 +00:00
kvstore impls for redis / sqlite moved
This commit is contained in:
parent
c1ab66f1e6
commit
61974e337f
16 changed files with 137 additions and 114 deletions
|
@ -16,7 +16,7 @@ from llama_stack.apis.safety import Safety
|
|||
from llama_stack.apis.agents import * # noqa: F403
|
||||
|
||||
from .agent_instance import ChatAgent
|
||||
from .config import MetaReferenceImplConfig
|
||||
from .config import MetaReferenceAgentsImplConfig
|
||||
from .tools.builtin import (
|
||||
CodeInterpreterTool,
|
||||
PhotogenTool,
|
||||
|
@ -33,10 +33,25 @@ logger.setLevel(logging.INFO)
|
|||
AGENT_INSTANCES_BY_ID = {}
|
||||
|
||||
|
||||
class KVStore(Protocol):
|
||||
def get(self, key: str) -> str:
|
||||
...
|
||||
|
||||
def set(self, key: str, value: str) -> None:
|
||||
...
|
||||
|
||||
def kvstore_impl(config: KVStoreConfig) -> KVStore:
|
||||
if config.type == KVStoreType.redis:
|
||||
from .kvstore_impls.redis import RedisKVStoreImpl
|
||||
return RedisKVStoreImpl(config)
|
||||
|
||||
return None
|
||||
|
||||
|
||||
class MetaReferenceAgentsImpl(Agents):
|
||||
def __init__(
|
||||
self,
|
||||
config: MetaReferenceImplConfig,
|
||||
config: MetaReferenceAgentsImplConfig,
|
||||
inference_api: Inference,
|
||||
memory_api: Memory,
|
||||
safety_api: Safety,
|
||||
|
@ -45,6 +60,7 @@ class MetaReferenceAgentsImpl(Agents):
|
|||
self.inference_api = inference_api
|
||||
self.memory_api = memory_api
|
||||
self.safety_api = safety_api
|
||||
self.kvstore = kvstore_impl(config.kvstore)
|
||||
|
||||
async def initialize(self) -> None:
|
||||
pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue