Spaces:
Sleeping
Sleeping
fix fstring
Browse files
orator.py
CHANGED
@@ -115,15 +115,16 @@ class DocumentDatabase(Database):
|
|
115 |
# Step 2: Format the retrieved docs into a prompt
|
116 |
def format_prompt(inputs):
|
117 |
message, docs = inputs
|
|
|
118 |
prompt = [
|
119 |
SystemMessage(
|
120 |
-
"You are an assistant for question-answering tasks. "
|
121 |
-
"Use the following pieces of retrieved context to answer "
|
122 |
-
"the question. If you don't know the answer, say that you "
|
123 |
-
"don't know. Use three sentences maximum and keep the "
|
124 |
-
"answer concise."
|
125 |
-
"\n\n"
|
126 |
-
|
127 |
),
|
128 |
HumanMessage(message)
|
129 |
]
|
|
|
115 |
# Step 2: Format the retrieved docs into a prompt
|
116 |
def format_prompt(inputs):
|
117 |
message, docs = inputs
|
118 |
+
docs_in_promp = '\n\n'.join(doc.page_content for doc in docs)
|
119 |
prompt = [
|
120 |
SystemMessage(
|
121 |
+
"You are an assistant for question-answering tasks. " +
|
122 |
+
"Use the following pieces of retrieved context to answer " +
|
123 |
+
"the question. If you don't know the answer, say that you " +
|
124 |
+
"don't know. Use three sentences maximum and keep the " +
|
125 |
+
"answer concise." +
|
126 |
+
"\n\n" +
|
127 |
+
docs_in_promp
|
128 |
),
|
129 |
HumanMessage(message)
|
130 |
]
|