feat(code): improve concat of strings in ui (#1785)

This commit is contained in:
igeni 2024-04-02 17:42:40 +03:00 committed by GitHub
parent ea153fb92f
commit bac818add5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -103,12 +103,12 @@ class PrivateGptUi:
sources_text = "\n\n\n"
used_files = set()
for index, source in enumerate(cur_sources, start=1):
if (source.file + "-" + source.page) not in used_files:
if f"{source.file}-{source.page}" not in used_files:
sources_text = (
sources_text
+ f"{index}. {source.file} (page {source.page}) \n\n"
)
used_files.add(source.file + "-" + source.page)
used_files.add(f"{source.file}-{source.page}")
full_response += sources_text
yield full_response