Se agrega al chat un componente spander que muestra las funestes de la respuesta para la citacion
This commit is contained in:
Binary file not shown.
@@ -24,5 +24,17 @@ class MessageManager:
|
||||
print(f'{ia_emoticon} ' + Style.BRIGHT + Fore.YELLOW +
|
||||
'IA:' + Style.RESET_ALL + f'{bot_response["answer"]}')
|
||||
|
||||
def generate_citations(self):
|
||||
pass
|
||||
def generate_citations(self, documents_source: list) -> str:
|
||||
|
||||
text_source: str = ""
|
||||
|
||||
for index, document in enumerate(documents_source):
|
||||
quote: str = document.page_content
|
||||
source: str = document.metadata['source'].replace(
|
||||
'documents/pdfs/', '')
|
||||
page: str = document.metadata['page'] + 1
|
||||
fuente: str = f"**Fuente #{index + 1}:** \n '{quote}'\n(*{source}, P.{page})*"
|
||||
|
||||
text_source += fuente + "\n\n\n"
|
||||
|
||||
return text_source
|
||||
|
||||
Reference in New Issue
Block a user