Skip to content

Commit 1f56e86

Browse files
feat: roll back to mrkdwn
1 parent 20b7c7d commit 1f56e86

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed

packages/cdk/prompts/systemPrompt.txt

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,24 +62,26 @@ IMPORTANT: This is informational guidance only. Always verify against current cl
6262
- Medication dosing: "Consult BNF/local formulary and prescribing clinician"
6363
- Patient-specific data: "Cannot access or discuss patient health information"
6464

65-
6. Text Formatting
66-
a. Use Markdown text formatting
67-
a. Bold for:
68-
- Headings, subheadings: **Answer:**, **Bibliography:**
69-
- Source names: **NHS Digital**, **EPS**
70-
b. Italic for:
65+
6. Slack Formatting Standards
66+
a. *Bold* for:
67+
- Headings, subheadings: *Answer:*, *Bibliography:*
68+
- Source names: *NHS Digital*, *EPS*
69+
b. _Italic_ for:
7170
- Citations, references
7271
- Document titles: _Integration Guide v3.2_
73-
c. Block Quotes for:
74-
- Direct quotes
72+
c. ```code blocks``` for:
73+
- Direct quotes >1 sentence
7574
- Technical specifications, parameters
7675
- Example configurations
77-
d. Inline Code for:
76+
d. `inline code` for:
7877
- System names, field names: `PrescriptionID`
7978
- Short technical terms: `HL7 FHIR`
79+
e. Links:
80+
- Format: <https://example.com|Descriptive Name>
81+
- Always test readability of link text
8082

8183
7. Bibliography and References
8284
a. In line citations should be proceeded by [cit_{index number}] and use a http link
83-
b. Citations in the [citation] sections should be formatted: <cit>source number|title|link|filename|reference text</cit>
85+
b. Citations in the [citation] sections should be formatted: <cit>source number|title|link|filename|reference text|</cit>
8486
- If the link doesn't exist, or the link isn't to a website, enter "none" in the link section
8587
c. Any source used, inline or as a source to generate an answer, should be listed in the Bibliography section

packages/slackBotFunction/app/slack/slack_events.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,14 @@ def _create_feedback_blocks(
174174
citation_link = citation.get("link") or ""
175175
citation_number = citation.get("source number", 0)
176176

177+
# Buttons can only be 75 characters long, truncate to be safe
178+
button_text = f"[{citation_number}] {title}"
177179
button = {
178180
"type": "button",
179-
"text": {"type": "plain_text", "text": title},
181+
"text": {
182+
"type": "plain_text",
183+
"text": button_text if len(button_text) < 75 else f"{button_text[:70]}...",
184+
},
180185
"action_id": f"cite_{citation_number}",
181186
"value": json.dumps(
182187
{**feedback_data, "title": title, "body": body, "link": citation_link},
@@ -198,7 +203,7 @@ def _create_feedback_blocks(
198203
)
199204

200205
# Main body
201-
blocks.append({"type": "section", "text": {"type": "markdown", "text": response_text}})
206+
blocks.append({"type": "section", "text": {"type": "mrkdwn", "text": response_text}})
202207

203208
# Citation action block
204209
if action_buttons:
@@ -632,7 +637,7 @@ def open_citation(channel: str, timestamp: str, message: Any, params: Dict[str,
632637
citation_block = {
633638
"type": "section",
634639
"text": {
635-
"type": "markdown",
640+
"type": "mrkdwn",
636641
"text": f"{title}\n\n{body}\n\n<{link}|View Source>" if link else f"*{title}*\n\n{body}",
637642
},
638643
"block_id": "citation_block",

0 commit comments

Comments
 (0)