refactor: simplify rag client initialization (#3401)

* Simplified Qdrant and ChromaDB client initialization
* Refactored factory structure and updated tests accordingly
This commit is contained in:
Greyson LaLonde
2025-08-26 08:54:51 -04:00
committed by GitHub
parent 869bb115c8
commit 4b4a119a9f
9 changed files with 44 additions and 57 deletions

View File

@@ -40,8 +40,19 @@ class ChromaDBClient(BaseClient):
embedding_function: Function to generate embeddings for documents.
"""
client: ChromaDBClientType
embedding_function: ChromaEmbeddingFunction[Embeddable]
def __init__(
self,
client: ChromaDBClientType,
embedding_function: ChromaEmbeddingFunction[Embeddable],
) -> None:
"""Initialize ChromaDBClient with client and embedding function.
Args:
client: Pre-configured ChromaDB client instance.
embedding_function: Embedding function for text to vector conversion.
"""
self.client = client
self.embedding_function = embedding_function
def create_collection(
self, **kwargs: Unpack[ChromaDBCollectionCreateParams]