Spaces:
Sleeping
Sleeping
update prompt and topk
Browse files- app.py +1 -1
- 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":
|
| 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 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
| 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 |
)
|