Skip to content

Commit

Permalink
fixing quick start code
Browse files Browse the repository at this point in the history
  • Loading branch information
TuanaCelik committed Jan 10, 2024
1 parent f3196f1 commit 847da30
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions content/overview/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ import os
from haystack import Pipeline, Document
from haystack.document_stores import InMemoryDocumentStore
from haystack.components.retrievers import InMemoryBM25Retriever
from haystack.components.generators import GPTGenerator
from haystack.components.generators import OpenAIGenerator
from haystack.components.builders.prompt_builder import PromptBuilder

# Write documents to InMemoryDocumentStore
document_store = InMemoryDocumentStore()
document_store.write_documents([
Document(text="My name is Jean and I live in Paris."),
Document(text="My name is Mark and I live in Berlin."),
Document(text="My name is Giorgio and I live in Rome.")
Document(content="My name is Jean and I live in Paris."),
Document(content="My name is Mark and I live in Berlin."),
Document(content="My name is Giorgio and I live in Rome.")
])

# Build a RAG pipeline
Expand All @@ -73,10 +73,9 @@ Question: {{question}}
Answer:
"""

document_store = InMemoryDocumentStore()
retriever = InMemoryBM25Retriever(document_store=document_store)
prompt_builder = PromptBuilder(template=prompt_template)
llm = GPTGenerator(api_key=api_key)
llm = OpenAIGenerator(api_key=api_key)

rag_pipeline = Pipeline()
rag_pipeline.add_component("retriever", retriever)
Expand Down

1 comment on commit 847da30

@vercel
Copy link

@vercel vercel bot commented on 847da30 Jan 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.