File tree Expand file tree Collapse file tree
src/ucl_module_chat/chains Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020for accurate and up-to-date information.
2121"""
2222
23+ examples = [
24+ "When can I take a module on medical statistics?" ,
25+ "What are the prerequisites for taking Supervised Learning?" ,
26+ "What is the difference between the two modules on Trauma for \
27+ paediatric dentistry?" ,
28+ ]
29+
2330
2431def convert_history (history : list [dict ]) -> list [BaseMessage ]:
2532 """Convert conversation history into Langchain messages"""
@@ -55,8 +62,7 @@ def chat(input: str, history: list[dict] = None) -> str:
5562 gr .Markdown ("# Chat with the module catalogue" )
5663 gr .Markdown (description )
5764 gr .ChatInterface (
58- fn = chat ,
59- type = "messages" ,
65+ fn = chat , type = "messages" , examples = examples , cache_examples = False
6066 )
6167
6268 module_chat .launch ()
Original file line number Diff line number Diff line change 2424 The first time you refer to a module in the conversation, refer to
2525 it by it's full name followed by the module code in brackets, e.g.
2626 Supervised Learning (COMP0078).
27- If you don't know the answer, say that you don't know.
27+ If you don't know the answer, apologise, say that
28+ you don't know the answer, and suggest that the user
29+ manually reviews the UCL website and module catalogue.
2830 Use five sentences maximum and keep the answer concise.
2931 Use professional British English and avoid using slang.
3032 Do not refer to the context directly in your answer, but you
You can’t perform that action at this time.
0 commit comments