umaiku commited on
Commit
a1c75cc
·
verified ·
1 Parent(s): dff7a5c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -44,8 +44,8 @@ def respond(
44
  documents = retriever.invoke(message)
45
 
46
  spacer = " \n"
47
-
48
  context = ""
 
49
 
50
  for doc in documents:
51
  case_text = df[df["case_url"] == doc.metadata["case_url"]].case_text.values[0]
@@ -58,11 +58,12 @@ def respond(
58
  break
59
 
60
  message = f"""
61
- Context: Answer the user's question using the following case extracts collected from various Federal Supreme Court of Switzerland and European Court of Human Rights cases:
 
 
62
  {context}
63
- Task: A user is asking a question, so start by summarizing these case in the user's question's language and reference the sources, including the urls and dates.
64
- Instructions: Always answer the user using the language used in his question.
65
- Question: {message}
66
  """
67
 
68
  print(message)
 
44
  documents = retriever.invoke(message)
45
 
46
  spacer = " \n"
 
47
  context = ""
48
+ print(len(documents))
49
 
50
  for doc in documents:
51
  case_text = df[df["case_url"] == doc.metadata["case_url"]].case_text.values[0]
 
58
  break
59
 
60
  message = f"""
61
+ A user is asking you the following question: {message}
62
+ Please answer the user in the same language that he used in his question using the following context.
63
+ Context: The following case extracts have been found to fit the question from various Federal Supreme Court of Switzerland and European Court of Human Rights cases:
64
  {context}
65
+ Task: Start by summarizing these case in the user's question's language and reference the sources, including the urls and dates.
66
+ Instructions: Always answer the user using the language used in his question: {message}
 
67
  """
68
 
69
  print(message)