Skip to content

armgit / txtai

Public Imported from GitHub
0

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

Update documentation

davidmezzetti38520439b955
diff --git a/docs/pipeline/text/rag.md b/docs/pipeline/text/rag.md
index 6a1c41cc..a31581fb 100644
--- a/docs/pipeline/text/rag.md
+++ b/docs/pipeline/text/rag.md
@@ -42,6 +42,38 @@ rag = RAG(embeddings, "google/flan-t5-base", template="""
""")
rag("What was won?")
+
+# Instruction tuned models typically require string prompts to
+# follow a specific chat template set by the model
+rag = RAG(embeddings, "meta-llama/Meta-Llama-3.1-8B-Instruct", template="""
+ <|im_start|>system
+ You are a friendly assistant.<|im_end|>
+ <|im_start|>user
+ Answer the following question using the provided context.
+
+ Question:
+ {question}
+
+ Context:
+ {context}
+ <|im_start|>assistant
+ """
+)
+rag("What was won?")
+
+# LLM options can be passed as additional arguments
+rag = RAG(embeddings, "meta-llama/Meta-Llama-3.1-8B-Instruct", template="""
+ Answer the following question using the provided context.
+
+ Question:
+ {question}
+
+ Context:
+ {context}
+""")
+
+# Set the default role to user and string inputs are converted to chat messages
+rag("What was won?", defaultrole="user")
```
See the [Embeddings](../../../embeddings) and [LLM](../llm) pages for additional configuration options.