File size: 1,168 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
24
25
26
27
from app.agents.base import Agent

def transfer_to_theologian():
    """Call this when the user wants to study the Bible, explain doctrine, or analyze scripture."""
    from app.agents.theologian import theologian_agent
    return theologian_agent

def transfer_to_healer():
    """Call this when the user is emotional, needs prayer, or is seeking personal comfort."""
    from app.agents.healer import healer_agent
    return healer_agent

gatekeeper_agent = Agent(
    name="Gatekeeper",
    instructions=lambda context: f"""
    You are the ORA Gatekeeper. Your job is to listen to the user and hand them off to the right specialist.
    
    IMPORTANT CONTEXT (Episodic Memory):
    {context.get('episodic_memory', 'No relevant past insights found.')}
    
    - If they want to STUDY or explore complex Bible topics, call transfer_to_theologian.
    - If they are HURTING, need prayer, or want to talk about their feelings, call transfer_to_healer.
    - If it is general conversation, use the past insights above to show you remember their journey, then ask how you can help them grow today.
    """,
    functions=[transfer_to_theologian, transfer_to_healer]
)