Skip to content

Commit 0226022

Browse files
feat: Remove table and reformat body
1 parent 94edab0 commit 0226022

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/slackBotFunction/app/slack/slack_events.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def _create_response_body(citations: list[dict[str, str]], feedback_data: dict[s
205205
response_text = response_text.replace("cit_", "")
206206

207207
# Remove Thinking
208-
response_text = re.sub(r"<thinking>(\n|\s|.)*</thinking>", "", response_text, flags=re.DOTALL)
208+
response_text = re.sub(r"<thinking>(\\n|\n|.)*</thinking>", "", response_text, flags=re.DOTALL)
209209

210210
# Main body
211211
blocks.append({"type": "section", "text": {"type": "mrkdwn", "text": response_text}})
@@ -233,6 +233,9 @@ def _create_citation(i: int, citation: dict[str, str], feedback_data: dict, resp
233233
if not reference:
234234
logger.info("No reference found in citation")
235235
return {"action_buttons": [], "response_text": response_text}
236+
237+
# Get first reference and its content
238+
reference = reference[0]
236239
content: str = reference.get("content", {}).get("text", invalid_body)
237240
title: str = reference.get("location", {}).get("s3Location", {}).get("uri", "/").split("/")[-1]
238241

0 commit comments

Comments
 (0)