Bases: VectorStoreValidator
Validator for Chroma vector store configuration.
Validates collection settings and existence for Chroma
vector store backend.
Attributes: |
-
configuration
–
Settings for vector store
-
chroma_client
–
Client for Chroma interactions
|
Source code in src/embedding/validators/vector_store_validators.py
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104 | class ChromaVectorStoreValidator(VectorStoreValidator):
"""Validator for Chroma vector store configuration.
Validates collection settings and existence for Chroma
vector store backend.
Attributes:
configuration: Settings for vector store
chroma_client: Client for Chroma interactions
"""
def __init__(
self,
configuration: ChromaConfiguration,
chroma_client: ChromaClient,
):
"""Initialize validator with configuration and client.
Args:
configuration: Chroma vector store settings
chroma_client: Client for Chroma operations
"""
self.configuration = configuration
self.chroma_client = chroma_client
def validate(self) -> None:
"""
Valiuate the Chroma vector store settings.
"""
self.validate_collection()
def validate_collection(self) -> None:
"""Validate Chroma collection existence.
Raises:
CollectionExistsException: If collection already exists
"""
collection_name = self.configuration.collection_name
if collection_name in self.chroma_client.list_collections():
raise CollectionExistsException(collection_name)
|
__init__(configuration, chroma_client)
Initialize validator with configuration and client.
Parameters: |
-
configuration
(ChromaConfiguration )
–
Chroma vector store settings
-
chroma_client
(ClientAPI )
–
Client for Chroma operations
|
Source code in src/embedding/validators/vector_store_validators.py
76
77
78
79
80
81
82
83
84
85
86
87
88 | def __init__(
self,
configuration: ChromaConfiguration,
chroma_client: ChromaClient,
):
"""Initialize validator with configuration and client.
Args:
configuration: Chroma vector store settings
chroma_client: Client for Chroma operations
"""
self.configuration = configuration
self.chroma_client = chroma_client
|
validate()
Valiuate the Chroma vector store settings.
Source code in src/embedding/validators/vector_store_validators.py
| def validate(self) -> None:
"""
Valiuate the Chroma vector store settings.
"""
self.validate_collection()
|
validate_collection()
Validate Chroma collection existence.
Raises: |
-
CollectionExistsException
–
If collection already exists
|
Source code in src/embedding/validators/vector_store_validators.py
96
97
98
99
100
101
102
103
104 | def validate_collection(self) -> None:
"""Validate Chroma collection existence.
Raises:
CollectionExistsException: If collection already exists
"""
collection_name = self.configuration.collection_name
if collection_name in self.chroma_client.list_collections():
raise CollectionExistsException(collection_name)
|