Nik Fedorov commited on
Commit
c7cf5ac
Β·
1 Parent(s): 02d7651

feat: improve prompt and update vectorstore

Browse files
app.py CHANGED
@@ -13,22 +13,21 @@ vectorstore = Chroma(
13
  )
14
 
15
  # arrange search template
16
- template = """Given the following extracted parts of a set of documents and a question, create an answer with references ("Sources").
17
- The answer should describe what information user is able to find on the website.
18
- If you don't know the answer, just say that you don't know. Don't try to make up an answer.
19
- Keep the answer concise.
20
- Always return a "Sources" part in your answer.
21
 
22
- Question: {question}
 
 
23
 
24
- Context: {context}
25
- Answer:"""
26
-
27
- # run script if quesry is set
28
  if query:
29
 
30
  # search vectorstores
31
- docs = vectorstore.similarity_search(query, 10)
32
 
33
  # arrange context string
34
  context = '';
 
13
  )
14
 
15
  # arrange search template
16
+ template = """As a doctor's assistant, when presented with a user's medical query and specific website context, generate consolidated guidance directing them to pertinent website links.
17
+ If multiple context chunks are similar, combine them into a single suggestion, citing all relevant sources using hyperlinked text in the format <a href="SOURCE_HERE">description</a>.
18
+ If the context doesn't directly address the query, state the absence of a direct match and provide the closest matching guidance.
19
+ Always adhere strictly to the provided context and maintain terminology consistency.
20
+ Don't mention the word "context" in your answer. Pretend that you're answering the user directly.
21
 
22
+ Query: {question}
23
+ Context:
24
+ {context}"""
25
 
26
+ # run script if query is set
 
 
 
27
  if query:
28
 
29
  # search vectorstores
30
+ docs = vectorstore.similarity_search(query, 6)
31
 
32
  # arrange context string
33
  context = '';
vectorstore/{52cf6466-c585-436a-8047-fdd44e17950b β†’ 1f3b3422-1ab2-4f97-bad6-bc5af0b3f4fd}/data_level0.bin RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:0a3469b0f83795ccba14fe5e41b50a01fc0de3b36d282ed8ec2cb250648153ea
3
- size 8380000
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0066f1798e9bbe3a2a5a87d2c16b9f2ea1c0412682cebe138b73710ac08b65ab
3
+ size 18436000
vectorstore/{52cf6466-c585-436a-8047-fdd44e17950b β†’ 1f3b3422-1ab2-4f97-bad6-bc5af0b3f4fd}/header.bin RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:f41dd1e773c44435e7815add75708210757f634ad68726af767e166806d6a49a
3
  size 100
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1e8924c1bef2e9b21521083efed68904f0074b978a6d12f47937a4fcdc4e7bbc
3
  size 100
vectorstore/{52cf6466-c585-436a-8047-fdd44e17950b β†’ 1f3b3422-1ab2-4f97-bad6-bc5af0b3f4fd}/index_metadata.pickle RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:bdec2bdf99dfc70eae997d311f98d5cb2dc3c288248179664e0b009f63a6b3eb
3
- size 288034
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9422eed03e670d6cae3e20752e3bf56f024385c12d658cbc04b763566cc3ca38
3
+ size 636115
vectorstore/{52cf6466-c585-436a-8047-fdd44e17950b β†’ 1f3b3422-1ab2-4f97-bad6-bc5af0b3f4fd}/length.bin RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:b05077a2368764b4551b95cf01ad2519ab2586f81ef068dc971144af5aad5cb7
3
- size 20000
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:897aead7fc1c8504cd2f5e6521abe81e8db3523750a12797e7c1660c1b6fe635
3
+ size 44000
vectorstore/{52cf6466-c585-436a-8047-fdd44e17950b β†’ 1f3b3422-1ab2-4f97-bad6-bc5af0b3f4fd}/link_lists.bin RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:4fde1621a0b2b4e62b739c694d465743985b64ebf79d694709f247bb420254bc
3
- size 43052
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8b61aa11ea1d332db693ec78a4e04d4b522d5d7380cebd5570daf7daf794d4ae
3
+ size 97380
vectorstore/chroma.sqlite3 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:d8e10178429007aa71a8f362ece0ea5df97d6abf3283b76e5fc02a1fae26324c
3
- size 20107264
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:49ff7a7d0500cc02a1dc9882f38e567509122c40c1e8ef14f034d5db0fe52659
3
+ size 35893248