mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-27 20:38:32 +02:00
Handle DanswerBot case where no updated at (#853)
This commit is contained in:
@@ -110,15 +110,22 @@ def build_documents_blocks(
|
|||||||
match_str = translate_vespa_highlight_to_slack(d.match_highlights, used_chars)
|
match_str = translate_vespa_highlight_to_slack(d.match_highlights, used_chars)
|
||||||
|
|
||||||
included_docs += 1
|
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(
|
header_line = f"{doc_sem_id}\n"
|
||||||
SectionBlock(text=block_text),
|
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:
|
if include_feedback and message_id is not None:
|
||||||
section_blocks.append(
|
section_blocks.append(
|
||||||
|
Reference in New Issue
Block a user