umaiku commited on
Commit
309b510
·
verified ·
1 Parent(s): 756edd3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -3
app.py CHANGED
@@ -40,12 +40,21 @@ def respond(
40
  """
41
 
42
  spacer = " \n "
 
 
 
 
 
 
 
 
43
 
44
  message = f"""
45
  The user is asking for information about the following: {message}.
46
- Answer him in his own language using the information from the following links and mention these links:
47
- {spacer.join(str(doc.metadata) for doc in documents)}
48
- Please mention your sources.
 
49
 
50
  """
51
 
 
40
  """
41
 
42
  spacer = " \n "
43
+
44
+ context = ""
45
+
46
+ for doc in documents:
47
+ context += "Case number: " + doc.metadata["case_nb"] + "\n"
48
+ context += "Case date: " + doc.metadata["case_date"] + "\n"
49
+ context += "Case url: " + doc.metadata["case_url"] + "\n"
50
+ context += "Case chunk: " + doc.page_content + "\n"
51
 
52
  message = f"""
53
  The user is asking for information about the following: {message}.
54
+ Answer him in his own language using the information from the following Swiss federal jurisprudence cases:
55
+ {context}
56
+ Please mention your sources in your answer.
57
+ If you don't know just mention the sources.
58
 
59
  """
60