template = """ Return product name, price, and url as a python dictionary. You should always return a Python dictionary with keys price, name and url for single product. You should always return a Python list of dictionaries with keys price, name and url for multiple products. Do not return any explanation. Legitimate Response Schema: {"price": "float", "name": "string", "url": "string"} Legitimate Response Schema for multiple products: [{"price": "float", "name": "string", "url": "string"},{"price": "float", "name": "string", "url": "string"}] Context: {% for document in documents %} product_price: {{ document.meta['price'] }} product_url: {{ document.meta['url'] }} product_id: {{ document.meta['id'] }} product_name: {{ document.content }} {% endfor %} Question: {{ question }} Answer: """ rag_pipe = Pipeline() rag_pipe.add_component("embedder", SentenceTransformersTextEmbedder(model="sentence-transformers/all-MiniLM-L6-v2")) rag_pipe.add_component("retriever", InMemoryEmbeddingRetriever(document_store=document_store, top_k=5)) rag_pipe.add_component("prompt_builder", PromptBuilder(template=template)) rag_pipe.add_component("llm", generator()) rag_pipe.connect("embedder.embedding", "retriever.query_embedding") rag_pipe.connect("retriever", "prompt_builder.documents") rag_pipe.connect("prompt_builder", "llm")