Update indexing and rag default templates to use InMemoryDocumentStore (#7782)

This commit is contained in:
Silvano Cerza 2024-06-04 12:57:33 +02:00 committed by GitHub
parent 55a657ba81
commit fd838fc573
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 24 additions and 23 deletions

View File

@ -45,10 +45,12 @@ components:
init_parameters:
document_store:
init_parameters:
collection_name: documents
embedding_function: default
persist_path: .
type: haystack_integrations.document_stores.chroma.document_store.ChromaDocumentStore
bm25_tokenization_regex: (?u)\b\w\w+\b
bm25_algorithm: BM25L
bm25_parameters: {}
embedding_similarity_function: dot_product
index: documents
type: haystack.document_stores.in_memory.document_store.InMemoryDocumentStore
policy: NONE
type: haystack.components.writers.document_writer.DocumentWriter

View File

@ -34,13 +34,15 @@ components:
init_parameters:
document_store:
init_parameters:
collection_name: documents
embedding_function: default
persist_path: .
type: haystack_integrations.document_stores.chroma.document_store.ChromaDocumentStore
bm25_tokenization_regex: (?u)\b\w\w+\b
bm25_algorithm: BM25L
bm25_parameters: {}
embedding_similarity_function: dot_product
index: documents
type: haystack.document_stores.in_memory.document_store.InMemoryDocumentStore
filters: null
top_k: 10
type: haystack_integrations.components.retrievers.chroma.retriever.ChromaEmbeddingRetriever
type: haystack.components.retrievers.in_memory.embedding_retriever.InMemoryEmbeddingRetriever
text_embedder:
init_parameters:

View File

@ -117,7 +117,6 @@ extra-dependencies = [
"langdetect", # TextLanguageRouter and DocumentLanguageClassifier
"sentence-transformers>=2.2.0", # SentenceTransformersTextEmbedder and SentenceTransformersDocumentEmbedder
"openai-whisper>=20231106", # LocalWhisperTranscriber
"chroma-haystack", # pipeline predefined templates
# OpenAPI
"jsonref", # OpenAPIServiceConnector, OpenAPIServiceToFunctions

View File

@ -595,7 +595,6 @@ class TestPipeline:
def test_from_template(self, monkeypatch):
monkeypatch.setenv("OPENAI_API_KEY", "fake_key")
with patch("haystack_integrations.document_stores.chroma.document_store.ChromaDocumentStore"):
pipe = Pipeline.from_template(PredefinedPipeline.INDEXING)
assert pipe.get_component("cleaner")

View File

@ -50,7 +50,6 @@ class TestPipelineTemplate:
# Building a pipeline directly using all default components specified in a predefined or custom template.
def test_build_pipeline_with_default_components(self, monkeypatch):
monkeypatch.setenv("OPENAI_API_KEY", "fake_key")
with mock.patch("haystack_integrations.document_stores.chroma.document_store.ChromaDocumentStore"):
rendered = PipelineTemplate.from_predefined(PredefinedPipeline.INDEXING).render()
pipeline = Pipeline.loads(rendered)