Skip to content

Commit

Permalink
Adress inmemory import path changes after beta5 (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
bilgeyucel authored Jan 19, 2024
1 parent 255edfd commit 2025bb7
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 32 deletions.
6 changes: 3 additions & 3 deletions integrations/assemblyai.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ from haystack.components.writers import DocumentWriter
from haystack.components.preprocessors import DocumentSplitter
from haystack.components.embedders import SentenceTransformersDocumentEmbedder
from haystack.pipeline import Pipeline
from haystack.document_stores import InMemoryDocumentStore
from haystack.document_stores.in_memory import InMemoryDocumentStore
from assemblyai_haystack.transcriber import AssemblyAITranscriber

document_store = InMemoryDocumentStore()
Expand Down Expand Up @@ -117,7 +117,7 @@ The example below illustrates a generative QA pipeline that seamlessly integrate

```python
from haystack import Pipeline
from haystack.components.retrievers import InMemoryEmbeddingRetriever
from haystack.components.retrievers.in_memory import InMemoryEmbeddingRetriever
from haystack.components.builders.prompt_builder import PromptBuilder
from haystack.components.generators import OpenAIGenerator
from assemblyai_haystack.transcriber import AssemblyAITranscriber
Expand Down Expand Up @@ -152,7 +152,7 @@ Explore the example below to see how to index speaker diarization information an
```python
from haystack.document_stores.in_memory import InMemoryDocumentStore
from haystack import Pipeline
from haystack.components.retrievers import InMemoryBM25Retriever
from haystack.components.retrievers.in_memory import InMemoryBM25Retriever
from haystack.components.builders.prompt_builder import PromptBuilder
from haystack.components.generators import OpenAIGenerator
from assemblyai_haystack.transcriber import AssemblyAITranscriber
Expand Down
4 changes: 2 additions & 2 deletions integrations/cohere.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Below is the example indexing pipeline with `InMemoryDocumentStore`, `CohereDocu

```python
from haystack import Document, Pipeline
from haystack.document_stores import InMemoryDocumentStore
from haystack.document_stores.in_memory import InMemoryDocumentStore
from haystack.components.writers import DocumentWriter
from cohere_haystack.embedders.document_embedder import CohereDocumentEmbedder

Expand All @@ -77,7 +77,7 @@ Below is the example of generative questions answering pipeline using RAG with `

```python
from haystack import Pipeline
from haystack.components.retrievers import InMemoryEmbeddingRetriever
from haystack.components.retrievers.in_memory import InMemoryEmbeddingRetriever
from haystack.components.builders.prompt_builder import PromptBuilder
from cohere_haystack.embedders.text_embedder import CohereTextEmbedder
from cohere_haystack.generator import CohereGenerator
Expand Down
4 changes: 2 additions & 2 deletions integrations/gradient.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ You can use embedding models with `GradientDocumentEmbedder`` to create embeddin
import os

from haystack import Pipeline
from haystack.document_stores import InMemoryDocumentStore
from haystack.document_stores.in_memory import InMemoryDocumentStore
from haystack.components.writers import DocumentWriter

from haystack_integrations.components.embedders.gradient import GradientDocumentEmbedder
Expand All @@ -69,7 +69,7 @@ You can use embedding models with `GradientTextEmbedder` and generative models w
```python
from haystack.components.builders.answer_builder import AnswerBuilder
from haystack.components.builders.prompt_builder import PromptBuilder
from haystack.components.retrievers import InMemoryEmbeddingRetriever
from haystack.components.retrievers.in_memory import InMemoryEmbeddingRetriever

from haystack_integrations.components.embedders.gradient import GradientTextEmbedder
from haystack_integrations.components.generators.gradient import GradientGenerator
Expand Down
12 changes: 6 additions & 6 deletions integrations/huggingface.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Below is the example indexing pipeline with `InMemoryDocumentStore`, `DocumentWr
```python
from haystack import Document
from haystack import Pipeline
from haystack.document_stores import InMemoryDocumentStore
from haystack.document_stores.in_memory import InMemoryDocumentStore
from haystack.components.embedders import SentenceTransformersDocumentEmbedder
from haystack.components.writers import DocumentWriter

Expand Down Expand Up @@ -80,7 +80,7 @@ Below is the example query pipeline that uses `mistralai/Mistral-7B-v0.1` hosted

```python
from haystack import Pipeline
from haystack.components.retrievers import InMemoryBM25Retriever
from haystack.components.retrievers.in_memory import InMemoryBM25Retriever
from haystack.components.builders.prompt_builder import PromptBuilder
from haystack.components.generators import HuggingFaceTGIGenerator

Expand Down Expand Up @@ -117,8 +117,8 @@ Below is the example of document retrieval pipeline with `InMemoryBM25Retriever`

```python
from haystack import Document, Pipeline
from haystack.document_stores import InMemoryDocumentStore
from haystack.components.retrievers import InMemoryBM25Retriever
from haystack.document_stores.in_memory import InMemoryDocumentStore
from haystack.components.retrievers.in_memory import InMemoryBM25Retriever
from haystack.components.rankers import TransformersSimilarityRanker

docs = [Document(content="Paris is in France"),
Expand Down Expand Up @@ -148,8 +148,8 @@ Below is the example of extractive question answering pipeline with `InMemoryBM2

```python
from haystack import Document, Pipeline
from haystack.document_stores import InMemoryDocumentStore
from haystack.components.retrievers import InMemoryBM25Retriever
from haystack.document_stores.in_memory import InMemoryDocumentStore
from haystack.components.retrievers.in_memory import InMemoryBM25Retriever
from haystack.components.readers import ExtractiveReader

docs = [Document(content="Paris is the capital of France."),
Expand Down
12 changes: 6 additions & 6 deletions integrations/instructor-embedder.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ print(f"Embedding Dimension: {len(result['embedding'])}")

```python
from instructor_embedders.instructor_document_embedder import InstructorDocumentEmbedder
from haystack.preview.dataclasses import Document
from haystack.dataclasses import Document


doc_embedding_instruction = "Represent the Medical Document for retrieval:"
Expand Down Expand Up @@ -147,11 +147,11 @@ print(f"Embedding Dimension: {len(result['documents'][0].embedding)}")

```python
# Import necessary modules and classes
from haystack.preview.document_stores import InMemoryDocumentStore
from haystack.preview.dataclasses import Document
from haystack.preview import Pipeline
from haystack.preview.components.writers import DocumentWriter
from haystack.preview.components.retrievers import InMemoryEmbeddingRetriever
from haystack.document_stores.in_memory import InMemoryDocumentStore
from haystack.dataclasses import Document
from haystack import Pipeline
from haystack.components.writers import DocumentWriter
from haystack.components.retrievers.in_memory import InMemoryEmbeddingRetriever
from datasets import load_dataset

# Import custom INSTRUCTOR Embedders
Expand Down
2 changes: 1 addition & 1 deletion integrations/jina.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Below is the example indexing pipeline with `InMemoryDocumentStore`, `JinaDocume

```python
from haystack import Document, Pipeline
from haystack.document_stores import InMemoryDocumentStore
from haystack.document_stores.in_memory import InMemoryDocumentStore
from haystack.components.writers import DocumentWriter
from jina_haystack import JinaDocumentEmbedder

Expand Down
2 changes: 1 addition & 1 deletion integrations/lmformatenforcer.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ To activate the the enforcer with Haystack V2, a `LMFormatEnforcerLocalGenerator

Here is a simple example:
```python
from haystack.preview.components.generators.hugging_face.hugging_face_local import HuggingFaceLocalGenerator
from haystack.components.generators.hugging_face.hugging_face_local import HuggingFaceLocalGenerator
from lmformatenforcer.integrations.haystackv2 import LMFormatEnforcerLocalGenerator


Expand Down
2 changes: 1 addition & 1 deletion integrations/notion-extractor.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ exported_pages = exporter.run(file_paths=["<list-of-page-ids>"])
The following example shows how to use the `NotionExporter` inside an indexing pipeline:
```python
from notion_haystack import NotionExporter
from haystack.document_stores import InMemoryDocumentStore
from haystack.document_stores.in_memory import InMemoryDocumentStore
from haystack import Pipeline

document_store = InMemoryDocumentStore()
Expand Down
2 changes: 1 addition & 1 deletion integrations/ollama.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Below is the example of generative questions answering pipeline using RAG with `
```python
from haystack import Document, Pipeline
from haystack.components.builders.prompt_builder import PromptBuilder
from haystack.components.retrievers import InMemoryBM25Retriever
from haystack.components.retrievers.in_memory import InMemoryBM25Retriever
from haystack.document_stores.in_memory import InMemoryDocumentStore

from haystack_integrations.components.generators.ollama import OllamaGenerator
Expand Down
8 changes: 4 additions & 4 deletions integrations/openai.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Below is the example indexing pipeline with `InMemoryDocumentStore`, `OpenAIDocu

```python
from haystack import Document, Pipeline
from haystack.document_stores import InMemoryDocumentStore
from haystack.document_stores.in_memory import InMemoryDocumentStore
from haystack.components.embedders import OpenAIDocumentEmbedder
from haystack.components.writers import DocumentWriter

Expand Down Expand Up @@ -78,7 +78,7 @@ Below is the example of generative questions answering pipeline using RAG with `

```python
from haystack import Pipeline
from haystack.components.retrievers import InMemoryBM25Retriever
from haystack.components.retrievers.in_memory import InMemoryBM25Retriever
from haystack.components.builders.prompt_builder import PromptBuilder
from haystack.components.generators import GPTGenerator

Expand Down Expand Up @@ -124,7 +124,7 @@ from haystack import Pipeline
from haystack.components.audio import LocalWhisperTranscriber
from haystack.components.preprocessors import DocumentSplitter, DocumentCleaner
from haystack.components.writers import DocumentWriter
from haystack.document_stores import InMemoryDocumentStore
from haystack.document_stores.in_memory import InMemoryDocumentStore

document_store = InMemoryDocumentStore()
pipeline = Pipeline()
Expand Down Expand Up @@ -159,7 +159,7 @@ Below is the example indexing pipeline with `PreProcessor`, `InMemoryDocumentSto

```python
from haystack.nodes import EmbeddingRetriever
from haystack.document_stores import InMemoryDocumentStore
from haystack.document_stores.in_memory import InMemoryDocumentStore
from haystack.pipelines import Pipeline
from haystack.schema import Document

Expand Down
6 changes: 3 additions & 3 deletions integrations/unstructured-file-converter.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ documents = converter.run(paths = ["a/file/path.pdf", "a/directory/path"])["docu
### In a Haystack Pipeline
```python
import os
from haystack.preview import Pipeline
from haystack.preview.components.writers import DocumentWriter
from haystack.preview.document_stores import InMemoryDocumentStore
from haystack import Pipeline
from haystack.components.writers import DocumentWriter
from haystack.document_stores.in_memory import InMemoryDocumentStore
from haystack_integrations.components.converters.unstructured import UnstructuredFileConverter

document_store = InMemoryDocumentStore()
Expand Down
4 changes: 2 additions & 2 deletions integrations/voyage.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ Load the dataset:
# Install HuggingFace Datasets using "pip install datasets"
from datasets import load_dataset
from haystack import Pipeline
from haystack.components.retrievers import InMemoryEmbeddingRetriever
from haystack.components.retrievers.in_memory import InMemoryEmbeddingRetriever
from haystack.components.writers import DocumentWriter
from haystack.dataclasses import Document
from haystack.document_stores import InMemoryDocumentStore
from haystack.document_stores.in_memory import InMemoryDocumentStore

# Import Voyage Embedders
from voyage_embedders.voyage_document_embedder import VoyageDocumentEmbedder
Expand Down

0 comments on commit 2025bb7

Please sign in to comment.