Files
ws-sanctum-chronicler/app/llm/prompts.py

61 lines
2.3 KiB
Python

"""LLM prompt templates and generation utilities."""
from typing import Optional
class PromptTemplates:
"""Collection of prompt templates for different modes."""
@staticmethod
def gentle_prompt(current_theme: Optional[str] = None) -> str:
"""Generate a gentle prompt when chat has been inactive."""
if current_theme:
return f"Gently prompt the chat about: {current_theme}"
return "Generate a gentle, inviting prompt to encourage discussion in the stream."
@staticmethod
def steward_response(message: str, context: Optional[str] = None) -> str:
"""Generate a response as the Steward mode."""
prompt = f"As a thoughtful steward of this stream, respond briefly and helpfully to: {message}"
if context:
prompt += f"\nContext: {context}"
return prompt
@staticmethod
def warden_analysis(message: str) -> str:
"""Generate analysis for suspicious content detection."""
return f"Analyze this message for suspicious patterns (spam, scams, manipulation): {message}"
@staticmethod
def librarian_summary(messages: list[str]) -> str:
"""Generate a summary of important discussion points."""
messages_text = "\n".join(messages)
return f"Summarize the key discussion points from this chat log:\n{messages_text}"
@staticmethod
def scribe_ledger(
theme: str,
discussion: list[str],
actions: list[str],
clips: list[str],
seeds: list[str],
) -> str:
"""Generate markdown ledger summary."""
return f"""Generate a professional markdown ledger with these sections:
- Theme: {theme}
- Notable Discussion: {len(discussion)} key points
- Agent Actions: {len(actions)} recorded
- Clip Candidates: {len(clips)} identified
- Blog Seeds: {len(seeds)} proposed"""
@staticmethod
def clip_candidate_reason(message: str) -> str:
"""Generate reasoning for marking a message as a clip candidate."""
return f"Explain why this is a good clip candidate: {message}"
@staticmethod
def blog_seed_topic(context: list[str]) -> str:
"""Generate a blog post topic from discussion context."""
context_text = "\n".join(context[:5]) # First 5 messages
return f"Based on this discussion, suggest a blog post topic:\n{context_text}"