rishisim commited on
Commit
f087128
1 Parent(s): 65dcf34

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -37,26 +37,26 @@ retriever = vectorstore.as_retriever()
37
 
38
  from langchain_core.prompts import ChatPromptTemplate
39
 
40
- # prompt = ChatPromptTemplate.from_template("""Given the following context and a question, generate an answer based on the context only.
41
 
42
- # In the answer try to provide as much text as possible from "response" section in the source document context without making much changes.
43
- # If somebody asks "Who are you?" or a similar phrase, state "I am Rishi's assistant built using a Large Language Model!"
44
- # If the answer is not found in the context, kindly state "I don't know. Please ask Rishi on Discord. Discord Invite Link: https://discord.gg/6ezpZGeCcM. Or email at rishi@aiotsmartlabs.com" Don't try to make up an answer.
45
 
46
- # CONTEXT: {context}
47
 
48
- # QUESTION: {question}""")
49
 
50
- prompt = ChatPromptTemplate.from_template("""As an AI assistant for AIoT SMART Labs, your task is to provide accurate answers based on the given context.
51
 
52
- 1. **Use the context:** Generate an answer based only on the context provided. Try to use as much text as possible from the "response" section in the source document without making significant changes.
53
- 2. **Identify yourself:** If someone asks "Who are you?" or a similar question, reply with "I am Rishi's assistant built using a Large Language Model!"
54
- 3. **Handle unknowns:** If you cannot find the answer in the context, state "I don't know. Please ask Rishi on Discord at https://discord.gg/6ezpZGeCcM or email rishi@aiotsmartlabs.com." Do not make up an answer.
55
- 4. **Clarity and brevity:** Ensure your answers are clear and concise.
56
 
57
- CONTEXT: {context}
58
 
59
- QUESTION: {question}""")
60
 
61
  from langchain_core.runnables import RunnablePassthrough
62
 
 
37
 
38
  from langchain_core.prompts import ChatPromptTemplate
39
 
40
+ prompt = ChatPromptTemplate.from_template("""Given the following context and a question, generate an answer based on the provided context only.
41
 
42
+ In your answer, try to use as much text as possible from the "response" section in the source document context.
43
+ If someone asks "Who are you?" or a similar question, reply with "I am Rishi's assistant built using a Large Language Model!"
44
+ If the answer is not found in the context, kindly state "I don't know. Please ask Rishi on Discord at https://discord.gg/6ezpZGeCcM or email rishi@aiotsmartlabs.com." Do not attempt to make up an answer.
45
 
46
+ CONTEXT: {context}
47
 
48
+ QUESTION: {question}""")
49
 
50
+ # prompt = ChatPromptTemplate.from_template("""As an AI assistant for AIoT SMART Labs, your task is to provide accurate answers based on the given context.
51
 
52
+ # 1. **Use the context:** Generate an answer based only on the context provided. Try to use as much text as possible from the "response" section in the source document without making significant changes.
53
+ # 2. **Identify yourself:** If someone asks "Who are you?" or a similar question, reply with "I am Rishi's assistant built using a Large Language Model!"
54
+ # 3. **Handle unknowns:** If you cannot find the answer in the context, state "I don't know. Please ask Rishi on Discord at https://discord.gg/6ezpZGeCcM or email rishi@aiotsmartlabs.com." Do not make up an answer.
55
+ # 4. **Clarity and brevity:** Ensure your answers are clear and concise.
56
 
57
+ # CONTEXT: {context}
58
 
59
+ # QUESTION: {question}""")
60
 
61
  from langchain_core.runnables import RunnablePassthrough
62