-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathexamples.tsp
More file actions
179 lines (166 loc) · 3.78 KB
/
Copy pathexamples.tsp
File metadata and controls
179 lines (166 loc) · 3.78 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
/**
* Operation examples for the Calling API
*
* These examples can be imported and used with @opExample decorator on operations
*/
const callId = "3fa85f64-5717-4562-b3fc-2c963f66afa6";
// Call command examples
const dialCallExample = #{
request: #{
command: "dial",
params: #{
from: "+15551234567",
to: "+15559876543",
url: "https://example.com/swml",
caller_id: "+15551234567",
status_url: "https://example.com/status_callback",
status_events: #["answered", "ended"],
},
},
};
const updateCallExample = #{
request: #{
command: "update",
params: #{
id: callId,
url: "https://example.com/swml",
fallback_url: "https://example.com/fallback",
},
},
};
const hangupCallExample = #{
request: #{
command: "calling.end",
id: callId,
params: #{ reason: "hangup" },
},
};
const holdCallExample = #{
request: #{
command: "calling.ai_hold",
id: callId,
params: #{},
},
};
const unholdCallExample = #{
request: #{
command: "calling.ai_unhold",
id: callId,
params: #{},
},
};
const aiMessageExample = #{
request: #{
command: "calling.ai_message",
id: callId,
params: #{
role: "system",
message_text: "You are now in expert mode. Provide detailed technical responses and use industry terminology.",
},
},
};
// Live Transcribe examples
const liveTranscribeStartExample = #{
request: #{
command: "calling.live_transcribe",
id: callId,
params: #{
action: #{
start: #{
lang: "en-US",
direction: #["local-caller", "remote-caller"],
webhook: "https://example.com/transcription-events",
live_events: true,
ai_summary: true,
ai_summary_prompt: "Summarize the key points of this conversation.",
ai_model: "gpt-4.1-nano",
speech_engine: "deepgram",
},
},
},
},
};
const liveTranscribeStopExample = #{
request: #{
command: "calling.live_transcribe",
id: callId,
params: #{
action: "stop",
},
},
};
const liveTranscribeSummarizeExample = #{
request: #{
command: "calling.live_transcribe",
id: callId,
params: #{
action: #{
summarize: #{
webhook: "https://example.com/summary",
prompt: "Provide a bullet-point summary of the main topics discussed.",
},
},
},
},
};
// Live Translate examples
const liveTranslateStartExample = #{
request: #{
command: "calling.live_translate",
id: callId,
params: #{
action: #{
start: #{
from_lang: "en-US",
to_lang: "es-ES",
direction: #["local-caller", "remote-caller"],
from_voice: "elevenlabs.josh",
to_voice: "elevenlabs.josh",
filter_from: "professional",
webhook: "https://example.com/translation-events",
live_events: true,
ai_summary: true,
ai_model: "gpt-4.1-nano",
speech_engine: "deepgram",
},
},
},
},
};
const liveTranslateStopExample = #{
request: #{
command: "calling.live_translate",
id: callId,
params: #{
action: "stop",
},
},
};
const liveTranslateSummarizeExample = #{
request: #{
command: "calling.live_translate",
id: callId,
params: #{
action: #{
summarize: #{
webhook: "https://example.com/summary",
prompt: "Summarize the key agreements reached in both languages.",
},
},
},
},
};
const liveTranslateInjectExample = #{
request: #{
command: "calling.live_translate",
id: callId,
params: #{
action: #{
inject: #{
message: "Please hold while I transfer you to a specialist.",
direction: "remote-caller",
},
},
},
},
};