mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-09-26 00:24:14 +00:00
Update indexing and rag default templates to use InMemoryDocumentStore (#7782)
This commit is contained in:
parent
55a657ba81
commit
fd838fc573
@ -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
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
@ -595,9 +595,8 @@ 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")
|
||||
pipe = Pipeline.from_template(PredefinedPipeline.INDEXING)
|
||||
assert pipe.get_component("cleaner")
|
||||
|
||||
def test_walk_pipeline_with_no_cycles(self):
|
||||
"""
|
||||
|
@ -50,15 +50,14 @@ 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)
|
||||
rendered = PipelineTemplate.from_predefined(PredefinedPipeline.INDEXING).render()
|
||||
pipeline = Pipeline.loads(rendered)
|
||||
|
||||
# pipeline has components
|
||||
assert pipeline.get_component("cleaner")
|
||||
assert pipeline.get_component("writer")
|
||||
assert pipeline.get_component("embedder")
|
||||
# pipeline has components
|
||||
assert pipeline.get_component("cleaner")
|
||||
assert pipeline.get_component("writer")
|
||||
assert pipeline.get_component("embedder")
|
||||
|
||||
# pipeline should have inputs and outputs
|
||||
assert len(pipeline.inputs()) > 0
|
||||
assert len(pipeline.outputs()) > 0
|
||||
# pipeline should have inputs and outputs
|
||||
assert len(pipeline.inputs()) > 0
|
||||
assert len(pipeline.outputs()) > 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user