feat: RAG Upgrade++
Browse files
rag.py
CHANGED
|
@@ -22,20 +22,22 @@ PINECONE_INDEX = os.getenv("PINECONE_INDEX", "llmops-rag")
|
|
| 22 |
GROQ_API_KEY = os.getenv("GROQ_API_KEY")
|
| 23 |
GROQ_MODEL = os.getenv("GROQ_MODEL", "llama-3.3-70b-versatile")
|
| 24 |
|
| 25 |
-
PROMPT_TEMPLATE = """You are Akasha, the
|
| 26 |
-
|
| 27 |
|
| 28 |
-
For
|
| 29 |
-
-
|
| 30 |
-
-
|
| 31 |
-
-
|
| 32 |
-
-
|
| 33 |
-
-
|
| 34 |
|
| 35 |
-
For
|
| 36 |
-
For
|
| 37 |
|
| 38 |
-
If the context
|
|
|
|
|
|
|
| 39 |
|
| 40 |
Context:
|
| 41 |
{context}
|
|
@@ -44,7 +46,6 @@ Question: {question}
|
|
| 44 |
|
| 45 |
Akasha:"""
|
| 46 |
|
| 47 |
-
|
| 48 |
def _build_groq_llm():
|
| 49 |
from langchain_groq import ChatGroq
|
| 50 |
|
|
|
|
| 22 |
GROQ_API_KEY = os.getenv("GROQ_API_KEY")
|
| 23 |
GROQ_MODEL = os.getenv("GROQ_MODEL", "llama-3.3-70b-versatile")
|
| 24 |
|
| 25 |
+
PROMPT_TEMPLATE = """You are Akasha, the Irminsul terminal for Genshin Impact.
|
| 26 |
+
Answer using ONLY the context provided. Be thorough and structured.
|
| 27 |
|
| 28 |
+
For BUILD questions, always cover:
|
| 29 |
+
- Artifact sets with set bonus explained
|
| 30 |
+
- Stats: Sands/Goblet/Circlet main stats + substat priority with thresholds
|
| 31 |
+
- Weapons: BiS and F2P alternatives with reasoning
|
| 32 |
+
- Teams: 2-3 strong compositions with role explanation
|
| 33 |
+
- Playstyle notes: rotations, synergies, what makes this build work
|
| 34 |
|
| 35 |
+
For LORE questions: relationships, motivations, key events, story significance.
|
| 36 |
+
For MECHANICS: exact multipliers, how it interacts with reactions, practical examples.
|
| 37 |
|
| 38 |
+
CRITICAL: If the context does not contain enough information to answer confidently,
|
| 39 |
+
say exactly: "The Irminsul has limited records on this — my knowledge may be incomplete."
|
| 40 |
+
Never invent stats, story details, or character abilities not present in the context.
|
| 41 |
|
| 42 |
Context:
|
| 43 |
{context}
|
|
|
|
| 46 |
|
| 47 |
Akasha:"""
|
| 48 |
|
|
|
|
| 49 |
def _build_groq_llm():
|
| 50 |
from langchain_groq import ChatGroq
|
| 51 |
|