mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-17 15:49:49 +00:00
Create a separate inline::chromadb provider
This commit is contained in:
parent
44ab7d93fb
commit
f0e045d1c8
7 changed files with 73 additions and 45 deletions
|
|
@ -4,22 +4,13 @@
|
|||
# This source code is licensed under the terms described in the LICENSE file in
|
||||
# the root directory of this source tree.
|
||||
|
||||
from typing import Any, Dict, Optional
|
||||
from typing import Any, Dict
|
||||
|
||||
from llama_models.schema_utils import json_schema_type
|
||||
from pydantic import BaseModel, model_validator
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
@json_schema_type
|
||||
class ChromaConfig(BaseModel):
|
||||
# You can either specify the url of the chroma server or the path to the local db
|
||||
url: Optional[str] = None
|
||||
db_path: Optional[str] = None
|
||||
|
||||
@model_validator(mode="after")
|
||||
def check_url_or_db_path(self):
|
||||
if not (self.url or self.db_path):
|
||||
raise ValueError("Either url or db_path must be specified")
|
||||
class ChromaRemoteImplConfig(BaseModel):
|
||||
url: str
|
||||
|
||||
@classmethod
|
||||
def sample_config(cls) -> Dict[str, Any]:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue