Load a prompt file from social/prompts/{name}.md Automatically injects brand components: - {about} -> content from brand/about.md - {visual_style} -> content from brand/visual.md - {bee_character} -> content from brand/bee.md - {links} -> content from brand/links.md Args:
(name: str)
| 214 | |
| 215 | |
| 216 | def load_prompt(name: str) -> str: |
| 217 | """Load a prompt file from social/prompts/{name}.md |
| 218 | |
| 219 | Automatically injects brand components: |
| 220 | - {about} -> content from brand/about.md |
| 221 | - {visual_style} -> content from brand/visual.md |
| 222 | - {bee_character} -> content from brand/bee.md |
| 223 | - {links} -> content from brand/links.md |
| 224 | |
| 225 | Args: |
| 226 | name: 'tone/twitter', 'gist', 'highlights', etc. |
| 227 | |
| 228 | Returns: |
| 229 | The prompt content as a string with brand components injected |
| 230 | """ |
| 231 | prompt_path = PROMPTS_DIR / f"{name}.md" |
| 232 | |
| 233 | if not prompt_path.exists(): |
| 234 | print(f"Warning: Prompt file not found: {prompt_path}") |
| 235 | return "" |
| 236 | |
| 237 | with open(prompt_path, "r", encoding="utf-8") as f: |
| 238 | content = f.read() |
| 239 | |
| 240 | # Remove the markdown title (first line starting with #) |
| 241 | lines = content.split("\n") |
| 242 | if lines and lines[0].startswith("#"): |
| 243 | content = "\n".join(lines[1:]).strip() |
| 244 | |
| 245 | # Inject brand prompt components |
| 246 | content = _inject_shared_prompts(content) |
| 247 | |
| 248 | return content |
| 249 | |
| 250 | |
| 251 | def load_format(platform: str) -> str: |
no test coverage detected