Update main.py
Browse files
main.py
CHANGED
@@ -189,6 +189,7 @@ async def on_message(message: cl.Message):
|
|
189 |
if len(search) > 0:
|
190 |
test = []
|
191 |
sources_text = ""
|
|
|
192 |
count = 0
|
193 |
for i in range(0,len(search)):
|
194 |
if search[i].metadata['Lien'] not in test:
|
@@ -196,14 +197,23 @@ async def on_message(message: cl.Message):
|
|
196 |
count = count + 1
|
197 |
test.append(search[i].metadata['Lien'])
|
198 |
sources_text = sources_text + str(count) + ". " + search[i].metadata['Titre'] + ', ' + search[i].metadata['Auteurs'] + ', ' + search[i].metadata['Lien'] + "\n"
|
199 |
-
|
|
|
200 |
cl.Text(name="Sources", content=sources_text, display="inline")
|
201 |
]
|
202 |
|
203 |
await cl.Message(
|
204 |
content="Sources : ",
|
205 |
-
elements=
|
206 |
-
).send()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
207 |
#await msg.send()
|
208 |
#memory.chat_memory.add_user_message(message.content)
|
209 |
#memory.chat_memory.add_ai_message(msg.content)
|
|
|
189 |
if len(search) > 0:
|
190 |
test = []
|
191 |
sources_text = ""
|
192 |
+
verbatim_text = ""
|
193 |
count = 0
|
194 |
for i in range(0,len(search)):
|
195 |
if search[i].metadata['Lien'] not in test:
|
|
|
197 |
count = count + 1
|
198 |
test.append(search[i].metadata['Lien'])
|
199 |
sources_text = sources_text + str(count) + ". " + search[i].metadata['Titre'] + ', ' + search[i].metadata['Auteurs'] + ', ' + search[i].metadata['Lien'] + "\n"
|
200 |
+
verbatim_text = verbatim_text + str(count) + ". " + search[i].metadata['Phrase'] + "\n"
|
201 |
+
sources = [
|
202 |
cl.Text(name="Sources", content=sources_text, display="inline")
|
203 |
]
|
204 |
|
205 |
await cl.Message(
|
206 |
content="Sources : ",
|
207 |
+
elements=sources,
|
208 |
+
).send()
|
209 |
+
verbatim = [
|
210 |
+
cl.Text(name="Verbatim", content=verbatim_text, display="side")
|
211 |
+
]
|
212 |
+
|
213 |
+
await cl.Message(
|
214 |
+
content="Verbatim : ",
|
215 |
+
elements=verbatim,
|
216 |
+
).send()
|
217 |
#await msg.send()
|
218 |
#memory.chat_memory.add_user_message(message.content)
|
219 |
#memory.chat_memory.add_ai_message(msg.content)
|