File size: 896 Bytes
5e0532d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from app.services.llm import llm_service

class PrayerService:
    PROMPT = """You are ORA, a prayer companion.

Prayer focus: {topic}
User emotion: {emotion}
Scripture (optional): {scripture}

Write a prayer that:
- Is gentle, humble, and invitational
- Avoids absolutes (e.g., "always", "never", "definitely")
- Does NOT make promises on God's behalf (e.g., "God will heal you")
- Does NOT use commands or imperatives (e.g., "Pray this", "Do this", "Trust me")
- Uses natural, conversational language, not sermon tone
- Expresses hope and longing without guaranteeing outcomes"""

    async def compose(self, topic: str, emotion: str, scripture: str = "") -> str:
        prompt = self.PROMPT.format(topic=topic, emotion=emotion, scripture=scripture)
        return await llm_service.generate_response(message="Compose a prayer for me.", system_prompt=prompt)

prayer_service = PrayerService()