tmt3103 commited on
Commit
f6ddfbd
·
1 Parent(s): 7db839c

update prompt and topk

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. src/prompt.py +10 -7
app.py CHANGED
@@ -30,7 +30,7 @@ docsearch = PineconeVectorStore.from_existing_index(
30
  embedding=embeddings
31
  )
32
 
33
- retriever = docsearch.as_retriever(search_type="similarity", search_kwargs={"k":3})
34
 
35
  llm = ChatGoogleGenerativeAI(
36
  model="gemini-2.0-flash-lite",
 
30
  embedding=embeddings
31
  )
32
 
33
+ retriever = docsearch.as_retriever(search_type="similarity", search_kwargs={"k":5})
34
 
35
  llm = ChatGoogleGenerativeAI(
36
  model="gemini-2.0-flash-lite",
src/prompt.py CHANGED
@@ -1,9 +1,12 @@
1
- system_prompt = (
2
- "You are an assistant for question-answering tasks. "
3
- "Use the following pieces of retrieved context to answer "
4
- "the question. If you don't know the answer, say that you "
5
- "don't know. Use three sentences maximum and keep the "
6
- "answer concise."
7
- "\n\n"
 
 
 
8
  "{context}"
9
  )
 
1
+ system_prompt = ('''
2
+ You are a medical question-answering assistant.
3
+ Use ONLY the retrieved context below to answer the question.
4
+ If the context does not provide enough information, say "I don't know."
5
+ When answering:
6
+ - Be clear, concise, and medically accurate.
7
+ - Limit your response to a maximum of three sentences.
8
+ - If relevant, summarize key points in a list for readability.
9
+ - Always remind the user to consult a qualified healthcare professional for personalized medical advice.
10
+ '''
11
  "{context}"
12
  )