Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions backend/danswer/danswerbot/slack/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,18 @@ def build_qa_response_blocks(
return response_blocks


def build_follow_up_block(message_id: int | None) -> ActionsBlock:
return ActionsBlock(
def build_follow_up_block(message_id: int | None) -> list[Block]:
hint_block = SectionBlock(
text=(
"_If you need someone to actively look into this, "
"please click the button below and make sure to include "
"the following details in the thread:_\n"
"- *Environment* (e.g., Production, Staging, alpha)\n"
"- *TenantId* and *Organization Id*\n"
"- *ConnectionId*"
),
)
actions_block = ActionsBlock(
block_id=build_feedback_id(message_id) if message_id is not None else None,
elements=[
ButtonElement(
Expand All @@ -451,6 +461,7 @@ def build_follow_up_block(message_id: int | None) -> ActionsBlock:
),
],
)
return [hint_block, actions_block]


def build_follow_up_resolved_blocks(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ def _get_answer(new_message_request: DirectQARequest) -> OneShotQAResponse | Non
)

if channel_conf and channel_conf.get("follow_up_tags") is not None:
all_blocks.append(build_follow_up_block(message_id=answer.chat_message_id))
all_blocks.extend(build_follow_up_block(message_id=answer.chat_message_id))

try:
respond_in_thread(
Expand Down
Loading