Skip to content

Commit 41d0a10

Browse files
authored
Merge pull request #6350 from segmentio/copilot-update
AI Copilot Spec Update
2 parents f076f5b + 8b8a7d4 commit 41d0a10

File tree

1 file changed

+52
-38
lines changed

1 file changed

+52
-38
lines changed

src/connections/spec/copilot.md

Lines changed: 52 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ In this section, you'll find the tracked semantic events that serve as a startin
1818

1919
This table lists the events that you can track from any conversation:
2020

21-
| Event | Definition | Fields |
22-
| -------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
23-
| Conversation Started | When a new conversation begins | `conversationId` |
24-
| Message Sent | When the first message is added to a thread by user | `conversationId`, `messageId`, `message_body` |
25-
| Message Received | Non-custom response (text/voice) to user prompt by copilot | `conversationId`, `messageId`, `message_body` |
26-
| Conversation Ended | When a conversation is completed | `conversationId`, `message_count` |
27-
| Tool Invoked | When the model or user invokes a capability or tool | `conversationId`, `messageId`, `type`, `action` |
28-
| Media Generated | When the model generates an image/video/audio | `conversationId`, `messageId`, `type`, `sub_type` |
29-
| Component Loaded | When a new custom (non-text/voice) component is shown to a user | `conversationId`, `messageId`, `type` |
30-
| Feedback Submitted | When a user rates a conversation or message | `conversationId`, `messageId`, `rating` |
31-
| Identify | When a new user is identified anonymously or known | `userId` and/or `anonymousId` |
32-
| Standard Track Calls | For all events sent to Segment based on user actions taken, like `items purchased`, `support requested` | `conversationId`, `messageId`, `...` |
21+
| Event | Definition | Fields |
22+
| -------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
23+
| Conversation Started | When a new conversation begins | `conversationId` |
24+
| Message Sent | When the first message is added to a thread by user | `conversationId`, `messageId`, `message_body`, `role` (default is `"customer"`) |
25+
| Message Received | Non-custom response (text/voice) to user prompt by copilot | `conversationId`, `messageId`, `message_body`, `role` (default is `"agent"`) |
26+
| Conversation Ended | When a conversation is completed | `conversationId`, `message_count` |
27+
| Action Invoked | When the model or user invokes a capability or tool | `conversationId`, `messageId`, `type`, `action` |
28+
| Media Generated | When the model generates an image/video/audio | `conversationId`, `messageId`, `type`, `sub_type` |
29+
| Component Loaded | When a new custom (non-text/voice) component is shown to a user | `conversationId`, `messageId`, `type` |
30+
| Feedback Submitted | When a user rates a conversation or message | `conversationId`, `messageId`, `rating` |
31+
| Identify | When a new user is identified anonymously or known | `userId` and/or `anonymousId` |
32+
| Standard Track Calls | For all events sent to Segment based on user actions taken, like `items purchased`, `support requested` | `conversationId`, `messageId`, `...` |
3333

3434
### Live chat events
3535

@@ -39,7 +39,7 @@ Segment can also track the following live chat events:
3939
- Message Sent
4040
- Message Received
4141
- Custom Component Loaded
42-
- Tool Invoked
42+
- Action Invoked
4343
- Media Generated
4444
- Conversation Ended
4545

@@ -73,15 +73,17 @@ Here's an example of a Conversation Started call:
7373

7474
### Message Sent
7575

76-
The Message Sent event should be sent when a user adds a new message to a thread.
76+
The Message Sent event should be sent when a user adds a new message to a thread. The default for `role` is `"customer"`.
7777

7878
This event supports the following semantic properties:
7979

80-
| Property | Type | Description |
81-
| ---------------- | ------ | ------------------------------------- |
82-
| `conversationId` | string | The conversation's unique identifier. |
83-
| `messageId` | string | The message's unique identifier. |
84-
| `message_body` | string | The message's content. |
80+
| Property | Type | Description |
81+
| ---------------- | ------ | ---------------------------------------------- |
82+
| `conversationId` | string | The conversation's unique identifier. |
83+
| `messageId` | string | The message's unique identifier. |
84+
| `message_body` | string | The message's content. |
85+
| `role` | string | The message's sender; default is `"customer"`. |
86+
8587

8688
Here's an example of a Message Sent call:
8789

@@ -93,7 +95,8 @@ Here's an example of a Message Sent call:
9395
"properties": {
9496
"conversationId": "1238041hdou",
9597
"messageId": "msg123",
96-
"message_body": "What's the best stock in the Nasdaq right now?"
98+
"message_body": "What's the best stock in the Nasdaq right now?",
99+
"role": "customer"
97100
}
98101
}
99102
```
@@ -102,13 +105,17 @@ Here's an example of a Message Sent call:
102105

103106
The Message Received event should be sent when the copilot gives a non-custom response (either text or voice) to something the user asked.
104107

108+
The default for `role` is `"agent"`. You can extend `role` to different agent type, like `ai_agent`, `human_agent`, `task_automation_agent`, and so on.
109+
105110
This event supports the following semantic properties:
106111

107-
| Property | Type | Description |
108-
| ---------------- | ------ | ------------------------------------- |
109-
| `conversationId` | string | The conversation's unique identifier. |
110-
| `messageId` | string | The message's unique identifier. |
111-
| `message_body` | string | The received message's content. |
112+
| Property | Type | Description |
113+
| ---------------- | ------ | ------------------------------------------- |
114+
| `conversationId` | string | The conversation's unique identifier. |
115+
| `messageId` | string | The message's unique identifier. |
116+
| `message_body` | string | The received message's content. |
117+
| `role` | string | The message's sender; default is `"agent"`. |
118+
112119

113120
```json
114121
{
@@ -119,7 +126,8 @@ This event supports the following semantic properties:
119126
"conversationId": "1238041hdou",
120127
"messageId": "msg124",
121128
"message_body": "Thank you for reaching out. How can I assist you today?"
122-
}
129+
},
130+
"role": "agent"
123131
}
124132
```
125133

@@ -146,31 +154,34 @@ Here's an example of a Conversation Ended call:
146154
}
147155
```
148156

149-
### Tool Invoked
157+
### Action Invoked
150158

151-
The Tool Invoked event should be sent when the copilot or user uses a custom capability or tool, like making a call to an external API.
159+
The Action nvoked event should be sent when the copilot or user uses a custom capability or tool, like making a call to an external API.
152160

153161
This event supports the following semantic properties:
154162

155-
| Property | Type | Description |
156-
| ---------------- | ------ | ---------------------------------------- |
157-
| `conversationId` | string | The conversation's unique identifier. |
158-
| `messageId` | string | The message's unique identifier. |
159-
| `type` | string | The type of tool invoked. |
160-
| `action` | String | The specific action taken with the tool. |
163+
| Property | Type | Description |
164+
| ---------------- | ------ | ---------------------------------------------- |
165+
| `conversationId` | string | The conversation's unique identifier. |
166+
| `messageId` | string | The message's unique identifier. |
167+
| `type` | string | The type of action invoked. |
168+
| `action` | String | The specific action taken with the tool. |
169+
| `role` | string | The message's sender; default is `"customer"`. |
170+
161171

162-
Here's an example of a Tool Invoked call:
172+
Here's an example of an Action Invoked call:
163173

164174
```json
165175
{
166176
"userId": "123",
167177
"action": "track",
168-
"event": "Tool Invoked",
178+
"event": "Action Invoked",
169179
"properties": {
170180
"conversationId": "1238041hdou",
171181
"messageId": "msg125",
172182
"type": "Inventory Request",
173-
"action": "check stock level"
183+
"action": "check stock level",
184+
"role": "customer"
174185
}
175186
}
176187
```
@@ -187,6 +198,8 @@ This event supports the following semantic properties:
187198
| `messageId` | string | The message's unique identifier. |
188199
| `type` | string | The type of media generated (like `"image"`, `"video"`) |
189200
| `sub_type` | String | Media data type (like `"gif"`, `"mp4"`, `"wav"`) |
201+
| `role` | string | The message's sender; default is `"agent"`. |
202+
190203

191204
Here's an example of a Media Generated call:
192205

@@ -198,8 +211,9 @@ Here's an example of a Media Generated call:
198211
"properties": {
199212
"conversationId": "1238041hdou",
200213
"messageId": "msg126",
214+
"role": "agent",
201215
"type": "image",
202-
"sub_type": "gif"
216+
"sub_type": "gif"
203217
}
204218
}
205219
```

0 commit comments

Comments
 (0)