File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,10 @@ The RAG application has a number of environment variables that can be set to con
106
106
| Variable | Description | Default Value |
107
107
| :----------- | :------------------------------------------- | :----------------------------------- |
108
108
| TITLE | Main title of the application | 🚀 RAG with txtai |
109
+ | EXAMPLES | List of queries separated by ` ; ` | ` Who created Linux? ` |
110
+ | | | ` gq: Tell me about Linux ` |
111
+ | | | ` linux -> macos -> microsoft windows ` |
112
+ | | | ` linux -> macos -> microsoft windows gq: Tell me about Linux ` |
109
113
| LLM | Path to LLM | x86-64: [ Mistral-7B-OpenOrca-AWQ] ( https://huggingface.co/TheBloke/Mistral-7B-OpenOrca-AWQ ) |
110
114
| | | arm64 : [ Mistral-7B-OpenOrca-GGUF] ( https://huggingface.co/TheBloke/Mistral-7B-OpenOrca-GGUF ) |
111
115
| EMBEDDINGS | Embeddings database path | [ neuml/txtai-wikipedia-slim] ( https://huggingface.co/NeuML/txtai-wikipedia-slim ) |
Original file line number Diff line number Diff line change @@ -525,9 +525,20 @@ def instructions(self):
525
525
instructions
526
526
"""
527
527
528
+ # Example queries
529
+ if "EXAMPLES" in os .environ :
530
+ examples = [x .strip () for x in os .environ ["EXAMPLES" ].split (";" )]
531
+ else :
532
+ examples = [
533
+ "Who created Linux?" ,
534
+ "gq: Tell me about Linux" ,
535
+ "linux -> macos -> microsoft windows" ,
536
+ "linux -> macos -> microsoft windows gq: Tell me about Linux" ,
537
+ ]
538
+
528
539
# Base instructions
529
540
instructions = (
530
- "Ask a question such as `Who created Linux? `\n \n "
541
+ f "Ask a question such as `{ examples [ 0 ] } `\n \n "
531
542
f"{ '**The index is currently empty**' if not self .embeddings .count () else '' } \n \n "
532
543
"`📄 Data` can be added to this index as follows.\n \n "
533
544
"- `# file path or URL`\n "
@@ -538,12 +549,12 @@ def instructions(self):
538
549
if "graph" in self .embeddings .config :
539
550
instructions += (
540
551
"\n \n This index also supports `📈 GraphRAG`. Examples are shown below.\n "
541
- "- `gq: Tell me about Linux `\n "
552
+ f "- `{ examples [ 1 ] } `\n "
542
553
" - Graph rag query, the `gq: ` prefix enables graph rag\n "
543
- "- `linux -> macos -> microsoft windows `\n "
554
+ f "- `{ examples [ 2 ] } `\n "
544
555
" - Graph path query for a list of concepts separated by `->`\n "
545
556
" - The graph path is analyzed and described by the LLM\n "
546
- "- `linux -> macos -> microsoft windows gq: Tell me about Linux `\n "
557
+ f "- `{ examples [ 3 ] } `\n "
547
558
" - Graph path with a graph rag query"
548
559
)
549
560
You can’t perform that action at this time.
0 commit comments