mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-04-08 03:48:14 +02:00
Handle DanswerBot case where no updated at (#853)
This commit is contained in:
parent
c6f354fd03
commit
c4ad03a65d
@ -110,15 +110,22 @@ def build_documents_blocks(
|
||||
match_str = translate_vespa_highlight_to_slack(d.match_highlights, used_chars)
|
||||
|
||||
included_docs += 1
|
||||
updated_at = timeago.format(d.updated_at, datetime.now(pytz.utc))
|
||||
if d.link:
|
||||
block_text = f"<{d.link}|{doc_sem_id}>\nUpdated {updated_at}\n>{remove_slack_text_interactions(match_str)}"
|
||||
else:
|
||||
block_text = f"{doc_sem_id}\nUpdated {updated_at}\n>{remove_slack_text_interactions(match_str)}"
|
||||
|
||||
section_blocks.append(
|
||||
SectionBlock(text=block_text),
|
||||
)
|
||||
header_line = f"{doc_sem_id}\n"
|
||||
if d.link:
|
||||
header_line = f"<{d.link}|{doc_sem_id}>\n"
|
||||
|
||||
updated_at_line = ""
|
||||
if d.updated_at is not None:
|
||||
updated_at_line = (
|
||||
f"Updated {timeago.format(d.updated_at, datetime.now(pytz.utc))}\n"
|
||||
)
|
||||
|
||||
body_text = f">{remove_slack_text_interactions(match_str)}"
|
||||
|
||||
block_text = header_line + updated_at_line + body_text
|
||||
|
||||
section_blocks.append(SectionBlock(text=block_text))
|
||||
|
||||
if include_feedback and message_id is not None:
|
||||
section_blocks.append(
|
||||
|
Loading…
x
Reference in New Issue
Block a user