mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-13 16:32:37 +00:00
simplified some, walked back some decisions
This commit is contained in:
parent
af7472cdb0
commit
636764c2a1
90 changed files with 887 additions and 570 deletions
|
|
@ -8,7 +8,9 @@ import yaml
|
|||
|
||||
from llama_stack.core.datatypes import StackRunConfig
|
||||
from llama_stack.core.storage.datatypes import (
|
||||
PostgresKVStoreConfig,
|
||||
PostgresSqlStoreConfig,
|
||||
SqliteKVStoreConfig,
|
||||
SqliteSqlStoreConfig,
|
||||
)
|
||||
|
||||
|
|
@ -20,21 +22,26 @@ def test_starter_distribution_config_loads_and_resolves():
|
|||
|
||||
config = StackRunConfig(**config_dict)
|
||||
|
||||
# Config should have storage with default backend
|
||||
# Config should have named backends and explicit store references
|
||||
assert config.storage is not None
|
||||
assert "default" in config.storage.backends
|
||||
assert isinstance(config.storage.backends["default"], SqliteSqlStoreConfig)
|
||||
assert "kv_default" in config.storage.backends
|
||||
assert "sql_default" in config.storage.backends
|
||||
assert isinstance(config.storage.backends["kv_default"], SqliteKVStoreConfig)
|
||||
assert isinstance(config.storage.backends["sql_default"], SqliteSqlStoreConfig)
|
||||
|
||||
# Stores should reference the default backend
|
||||
assert config.storage.metadata is not None
|
||||
assert config.storage.metadata.backend == "default"
|
||||
assert config.storage.metadata.namespace is not None
|
||||
assert config.metadata_store is not None
|
||||
assert config.metadata_store.backend == "kv_default"
|
||||
assert config.metadata_store.namespace == "registry"
|
||||
|
||||
assert config.storage.inference is not None
|
||||
assert config.storage.inference.backend == "default"
|
||||
assert config.storage.inference.table_name is not None
|
||||
assert config.storage.inference.max_write_queue_size > 0
|
||||
assert config.storage.inference.num_writers > 0
|
||||
assert config.inference_store is not None
|
||||
assert config.inference_store.backend == "sql_default"
|
||||
assert config.inference_store.table_name == "inference_store"
|
||||
assert config.inference_store.max_write_queue_size > 0
|
||||
assert config.inference_store.num_writers > 0
|
||||
|
||||
assert config.conversations_store is not None
|
||||
assert config.conversations_store.backend == "sql_default"
|
||||
assert config.conversations_store.table_name == "openai_conversations"
|
||||
|
||||
|
||||
def test_postgres_demo_distribution_config_loads():
|
||||
|
|
@ -46,17 +53,15 @@ def test_postgres_demo_distribution_config_loads():
|
|||
|
||||
# Should have postgres backend
|
||||
assert config.storage is not None
|
||||
assert "default" in config.storage.backends
|
||||
assert isinstance(config.storage.backends["default"], PostgresSqlStoreConfig)
|
||||
|
||||
# Both stores use same postgres backend
|
||||
assert config.storage.metadata is not None
|
||||
assert config.storage.metadata.backend == "default"
|
||||
|
||||
assert config.storage.inference is not None
|
||||
assert config.storage.inference.backend == "default"
|
||||
|
||||
# Backend config should be Postgres
|
||||
postgres_backend = config.storage.backends["default"]
|
||||
assert "kv_default" in config.storage.backends
|
||||
assert "sql_default" in config.storage.backends
|
||||
postgres_backend = config.storage.backends["sql_default"]
|
||||
assert isinstance(postgres_backend, PostgresSqlStoreConfig)
|
||||
assert postgres_backend.host == "${env.POSTGRES_HOST:=localhost}"
|
||||
|
||||
kv_backend = config.storage.backends["kv_default"]
|
||||
assert isinstance(kv_backend, PostgresKVStoreConfig)
|
||||
|
||||
# Stores target the Postgres backends explicitly
|
||||
assert config.metadata_store.backend == "kv_default"
|
||||
assert config.inference_store.backend == "sql_default"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue