You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pages/docs/ai-transport/features/token-streaming/message-per-response.mdx
+21-26Lines changed: 21 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,25 @@ This approach is ideal when:
37
37
You do not need to mark the message or token stream as completed; the final message will
38
38
automatically have the full response with all tokens appended to it.
39
39
40
+
## Setup
41
+
42
+
Message append functionality requires the "Message annotations, updates, and deletes" [channel rule](/docs/channels#rules) enabled for your channel or [namespace](/docs/channels#namespaces). This rule automatically enables message persistence.
43
+
44
+
To enable the channel rule:
45
+
46
+
1. Go to the [Ably dashboard](https://www.ably.com/dashboard) and select your app.
47
+
2. Navigate to the "Configuration" > "Rules" section from the left-hand navigation bar.
48
+
3. Choose "Add new rule".
49
+
4. Enter a channel name or namespace pattern (e.g. `ai:*` for all channels starting with `ai:`).
50
+
5. Select the "Message annotations, updates, and deletes" rule from the list.
51
+
6. Click "Create channel rule".
52
+
53
+
The examples in this guide use the `ai:` namespace prefix, which assumes you have configured the rule for `ai:*`.
54
+
55
+
### Message size limits
56
+
57
+
Standard Ably message [size limits](/docs/platform/pricing/limits#message) apply to the complete concatenated message. The system validates size limits before accepting append operations. If appending a token would exceed the maximum message size, the append is rejected.
58
+
40
59
## Publishing tokens
41
60
42
61
Publish tokens from a [Realtime](/docs/api/realtime-sdk) client, which maintains a
@@ -51,7 +70,7 @@ Use the [`get()`](/docs/api/realtime-sdk/channels#get) method to create or retri
0 commit comments