mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-15 06:00:48 +00:00
Address review comments for global vector store configuration
- Remove incorrect 'Llama-Stack v2' version reference from documentation - Move MissingEmbeddingModelError to llama_stack/apis/common/errors.py - Update docstring references to point to correct exception location - Clarify default_embedding_dimension behavior (defaults to 384) - Update test imports and exception handling
This commit is contained in:
parent
aec1df5a39
commit
501d8330d8
4 changed files with 5 additions and 6 deletions
|
@ -705,7 +705,7 @@ Precedence rules at runtime:
|
|||
|
||||
1. If `embedding_model` is explicitly passed in an API call, that value is used.
|
||||
2. Otherwise the value in `vector_store_config.default_embedding_model` is used.
|
||||
3. If neither is available the server will raise **MissingEmbeddingModelError** at store-creation time so mis-configuration is caught early.
|
||||
3. If neither is available the server will raise `MissingEmbeddingModelError` at store-creation time so mis-configuration is caught early.
|
||||
|
||||
#### Environment variables
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ class VectorStoreConfig(BaseModel):
|
|||
default_embedding_model
|
||||
The model *id* the stack should use when an embedding model is
|
||||
required but not supplied by the API caller. When *None* the
|
||||
router will raise a :class:`~llama_stack.errors.MissingEmbeddingModelError`.
|
||||
router will raise a :class:`~llama_stack.apis.common.errors.MissingEmbeddingModelError`.
|
||||
default_embedding_dimension
|
||||
Optional integer hint for vector dimension. Routers/providers
|
||||
may validate that the chosen model emits vectors of this size.
|
||||
|
|
|
@ -11,6 +11,7 @@ from typing import Any
|
|||
from llama_stack.apis.common.content_types import (
|
||||
InterleavedContent,
|
||||
)
|
||||
from llama_stack.apis.common.errors import MissingEmbeddingModelError
|
||||
from llama_stack.apis.common.vector_store_config import VectorStoreConfig
|
||||
from llama_stack.apis.models import ModelType
|
||||
from llama_stack.apis.vector_io import (
|
||||
|
@ -106,9 +107,6 @@ class VectorIORouter(VectorIO):
|
|||
return cfg.default_embedding_model, cfg.default_embedding_dimension or 384
|
||||
|
||||
# 3. error - no default
|
||||
class MissingEmbeddingModelError(RuntimeError):
|
||||
pass
|
||||
|
||||
raise MissingEmbeddingModelError(
|
||||
"Failed to create vector store: No embedding model provided. Set vector_store_config.default_embedding_model or supply one in the API call."
|
||||
)
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import pytest
|
||||
|
||||
from llama_stack.apis.common.errors import MissingEmbeddingModelError
|
||||
from llama_stack.apis.models import ModelType
|
||||
from llama_stack.distribution.routers.vector_io import VectorIORouter
|
||||
|
||||
|
@ -76,5 +77,5 @@ async def test_error_when_no_default():
|
|||
|
||||
router = VectorIORouter(routing_table=_DummyRoutingTable())
|
||||
|
||||
with pytest.raises(RuntimeError):
|
||||
with pytest.raises(MissingEmbeddingModelError):
|
||||
await router._resolve_embedding_model(None)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue