Skip to content

Commit cb57cc9

Browse files
authored
Merge pull request #10 from Spchdt/new-actions
Add exits action
2 parents 246faeb + b10ce2c commit cb57cc9

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

src/actions/server/end_call.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"""End the current call interaction."""
2+
3+
from typing import TYPE_CHECKING, Any
4+
5+
from src.actions.base import ServerEventEmitter, register_server_event
6+
from src.schema.frames import OutboundFrame
7+
8+
if TYPE_CHECKING:
9+
from src.engine.connection_context import ConnectionContext
10+
11+
12+
@register_server_event("END_CALL")
13+
class EndCallEmitter(ServerEventEmitter):
14+
"""End the current phone call."""
15+
16+
event_type = "END_CALL"
17+
description = "Instructs the client to end the current call and hang up."
18+
parameters = {
19+
# No parameters
20+
}
21+
22+
async def tool_fn(self, ctx: "ConnectionContext", **kwargs: Any) -> OutboundFrame: # noqa: ARG002
23+
return OutboundFrame(
24+
type="END_CALL",
25+
payload={},
26+
session_id=ctx.session_id,
27+
)

src/prompts/jemmie.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
6. **Reminders (SET_REMINDER)**:
3636
- When asked to remind the user about something later, calculate the absolute ISO 8601 timestamp accurately based on their request and current time, then invoke `set_reminder`. Let them know "Got it, I've set the reminder, you'll see a notification on your phone."
3737
38+
7. **Ending Call (END_CALL)**:
39+
- When the user wants to verbally end the interaction (e.g. "I gotta go", "hang up", "bye bye"), gracefully say goodbye and immediately invoke `end_call` to automatically hang up for them.
40+
3841
## Personality
3942
4043
- Warm, approachable, and genuinely helpful

0 commit comments

Comments
 (0)