Skip to content

Commit 7ac242c

Browse files
sahilsuman933cursoragentsahil
authored
Update event schemas with additional metadata and formatting details (#623)
Co-authored-by: Cursor Agent <[email protected]> Co-authored-by: sahil <[email protected]>
1 parent b27b98b commit 7ac242c

File tree

1 file changed

+31
-11
lines changed

1 file changed

+31
-11
lines changed

fern/server-url/events.mdx

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ All messages sent to your Server URL are `POST` requests with this body shape:
1616
}
1717
```
1818

19+
Common metadata included on most events:
20+
- `phoneNumber`, `timestamp`
21+
- `artifact` (recording, transcript, messages, etc.)
22+
- `assistant`, `customer`, `call`, `chat`
23+
1924
Most events are informational and do not require a response. Responses are only expected for these types sent to your Server URL:
2025
- "assistant-request"
2126
- "tool-calls"
@@ -168,13 +173,14 @@ Or return an error message to be spoken to the caller:
168173
"type": "end-of-call-report",
169174
"endedReason": "hangup",
170175
"call": { /* Call Object */ },
171-
"recordingUrl": "https://.../recordings/1234.wav",
172-
"summary": "The user asked about the weather...",
173-
"transcript": "AI: How can I help? User: What's the weather? ...",
174-
"messages": [
175-
{ "role": "assistant", "message": "How can I help?" },
176-
{ "role": "user", "message": "What's the weather?" }
177-
]
176+
"artifact": {
177+
"recording": { /* Recording object with URLs */ },
178+
"transcript": "AI: How can I help? User: What's the weather? ...",
179+
"messages": [
180+
{ "role": "assistant", "message": "How can I help?" },
181+
{ "role": "user", "message": "What's the weather?" }
182+
]
183+
}
178184
}
179185
}
180186
```
@@ -200,7 +206,8 @@ Sent when an update is committed to the conversation history.
200206
{
201207
"message": {
202208
"type": "conversation-update",
203-
"messages": [ /* current conversation messages */ ]
209+
"messages": [ /* current conversation messages */ ],
210+
"messagesOpenAIFormatted": [ /* openai-formatted messages */ ]
204211
}
205212
}
206213
```
@@ -216,7 +223,9 @@ Partial and final transcripts from the transcriber.
216223
"role": "user",
217224
"transcriptType": "partial",
218225
"transcript": "I'd like to book...",
219-
"isFiltered": false
226+
"isFiltered": false,
227+
"detectedThreats": [],
228+
"originalTranscript": "I'd like to book..."
220229
}
221230
}
222231
```
@@ -301,7 +310,8 @@ Sent when the transcriber switches based on detected language.
301310
```json
302311
{
303312
"message": {
304-
"type": "language-change-detected"
313+
"type": "language-change-detected",
314+
"language": "es"
305315
}
306316
}
307317
```
@@ -320,6 +330,15 @@ When requested in `assistant.serverMessages`, hangup and forwarding are delegate
320330
}
321331
```
322332

333+
```json
334+
{
335+
"message": {
336+
"type": "phone-call-control",
337+
"request": "hang-up"
338+
}
339+
}
340+
```
341+
323342
### Knowledge Base Request (Custom)
324343

325344
If using `assistant.knowledgeBase.provider = "custom-knowledge-base"`.
@@ -328,7 +347,8 @@ If using `assistant.knowledgeBase.provider = "custom-knowledge-base"`.
328347
{
329348
"message": {
330349
"type": "knowledge-base-request",
331-
"messages": [ /* conversation so far */ ]
350+
"messages": [ /* conversation so far */ ],
351+
"messagesOpenAIFormatted": [ /* openai-formatted messages */ ]
332352
}
333353
}
334354
```

0 commit comments

Comments
 (0)