From ef2b1143ac29ed83d1ff132c5ac64ff713be51a7 Mon Sep 17 00:00:00 2001 From: matt423 Date: Mon, 5 Jan 2026 11:38:46 +0000 Subject: [PATCH 01/15] chore: update message annotations terminology to include appends --- content/partials/types/_message.textile | 131 ++++++++++++++++++ .../token-streaming/message-per-response.mdx | 4 +- 2 files changed, 133 insertions(+), 2 deletions(-) create mode 100644 content/partials/types/_message.textile diff --git a/content/partials/types/_message.textile b/content/partials/types/_message.textile new file mode 100644 index 0000000000..272d7b8b28 --- /dev/null +++ b/content/partials/types/_message.textile @@ -0,0 +1,131 @@ +A @Message@ represents an individual message that is sent to or received from Ably. + +h6(#name). + default: name + csharp: Name + +The event name, if provided.
__Type: @String@__ + +h6(#data). + default: data + csharp: Data + +The message payload, if provided.
__Type: @String@, @StringBuffer@, @JSON Object@@String@, @ByteArray@, @JSONObject@, @JSONArray@@String@, @byte[]@, @plain C# object that can be serialized to JSON@@String@, @Binary@ (ASCII-8BIT String), @Hash@, @Array@@String@, @Bytearray@, @Dict@, @List@@String@, @Binary String@, @Associative Array@, @Array@@NSString *@, @NSData *@, @NSDictionary *@, @NSArray *@@String@, @NSData@, @Dictionary@, @Array@@String@, @Map@, @List@__ + +h6(#extras). + default: extras + csharp: Extras + +Metadata and/or ancillary payloads, if provided. Valid payloads include "@push@":/docs/push/publish#payload, "@headers@" (a map of strings to strings for arbitrary customer-supplied metadata), "@ephemeral@":/docs/pub-sub/advanced#ephemeral, and "@privileged@":/docs/platform/integrations/webhooks#skipping objects.
__Type: @JSONObject@, @JSONArray@plain C# object that can be converted to JSON@JSON Object@@Hash@, @Array@@Dict@, @List@@Dictionary@, @Array@@NSDictionary *@, @NSArray *@@Associative Array@, @Array@__ + +h6(#id). + default: id + csharp: Id + +A Unique ID assigned by Ably to this message.
__Type: @String@__ + +h6(#client-id). + default: clientId + csharp: ClientId + ruby: client_id + python: client_id + +The client ID of the publisher of this message.
__Type: @String@__ + +h6(#connection-id). + default: connectionId + csharp: ConnectionId + ruby: connection_id + python: connection_id + +The connection ID of the publisher of this message.
__Type: @String@__ + +h6(#connection-key). + default: connectionKey + csharp,go: ConnectionKey + ruby,python: connection_key + +A connection key, which can optionally be included for a REST publish as part of the "publishing on behalf of a realtime client functionality":/docs/pub-sub/advanced#publish-on-behalf.
__Type: @String@__ + +h6(#timestamp). + default: timestamp + csharp: Timestamp + +Timestamp when the message was first received by the Ably, as milliseconds since the epocha @Time@ object
.__Type: @Integer@@Long Integer@@DateTimeOffset@@Time@@NSDate@__ + +h6(#encoding). + default: encoding + csharp: Encoding + +This will typically be empty as all messages received from Ably are automatically decoded client-side using this value. However, if the message encoding cannot be processed, this attribute will contain the remaining transformations not applied to the @data@ payload.
__Type: @String@__ + +blang[jsall]. + + h6(#action). + default: action + + The action type of the message, one of the "@MessageAction@":#message-action enum values.
__Type: @int enum { MESSAGE_CREATE, MESSAGE_UPDATE, MESSAGE_DELETE, META, MESSAGE_SUMMARY }@__ + + h6(#serial). + default: serial + + A server-assigned identifier that will be the same in all future updates of this message. It can be used to add "annotations":/docs/messages/annotations to a message or to "update or delete":/docs/messages/updates-deletes it. Serial will only be set if you enable annotations, updates, deletes, and appends in "channel rules":/docs/channels#rules .
__Type: @String@__ + + h6(#annotations). + default: annotations + + An object containing information about annotations that have been made to the object.
__Type: "@MessageAnnotations@":/docs/api/realtime-sdk/types#message-annotations__ + + h6(#version). + default: version + + An object containing version metadata for messages that have been updated or deleted. See "updating and deleting messages":/docs/messages/updates-deletes for more information.
__Type: "@MessageVersion@":#message-version__ + +h3(constructors). + default: Message constructors + +h6(#message-from-encoded). + default: Message.fromEncoded + +bq(definition). + default: Message.fromEncoded(Object encodedMsg, ChannelOptions channelOptions?) -> Message + +A static factory method to create a "@Message@":/docs/api/realtime-sdk/types#message from a deserialized @Message@-like object encoded using Ably's wire protocol. + +h4. Parameters + +- encodedMsg := a @Message@-like deserialized object.
__Type: @Object@__ +- channelOptions := an optional "@ChannelOptions@":/docs/api/realtime-sdk/types#channel-options. If you have an encrypted channel, use this to allow the library can decrypt the data.
__Type: @Object@__ + +h4. Returns + +A "@Message@":/docs/api/realtime-sdk/types#message object + +h6(#message-from-encoded-array). + default: Message.fromEncodedArray + +bq(definition). + default: Message.fromEncodedArray(Object[] encodedMsgs, ChannelOptions channelOptions?) -> Message[] + +A static factory method to create an array of "@Messages@":/docs/api/realtime-sdk/types#message from an array of deserialized @Message@-like object encoded using Ably's wire protocol. + +h4. Parameters + +- encodedMsgs := an array of @Message@-like deserialized objects.
__Type: @Array@__ +- channelOptions := an optional "@ChannelOptions@":/docs/api/realtime-sdk/types#channel-options. If you have an encrypted channel, use this to allow the library can decrypt the data.
__Type: @Object@__ + +h4. Returns + +An @Array@ of "@Message@":/docs/api/realtime-sdk/types#message objects + +h3(#message-version). + default: MessageVersion + +h4. Properties + +|_. Property |_. Description |_. Type | +| serial | An Ably-generated ID that uniquely identifies this version of the message. Can be compared lexicographically to determine version ordering. For an original message with an action of @message.create@, this will be equal to the top-level @serial@. | @String@ | +| timestamp | The time this version was created (when the update or delete operation was performed). For an original message, this will be equal to the top-level @timestamp@. | @Integer@@Long Integer@@DateTimeOffset@@Time@@NSDate@ | +| clientId | The client identifier of the user who performed the update or delete operation. Only present for @message.update@ and @message.delete@ actions. | @String@ (optional) | +| description | Optional description provided when the update or delete was performed. Only present for @message.update@ and @message.delete@ actions. | @String@ (optional) | +| metadata | Optional metadata provided when the update or delete was performed. Only present for @message.update@ and @message.delete@ actions. | @Object@ (optional) | diff --git a/src/pages/docs/ai-transport/features/token-streaming/message-per-response.mdx b/src/pages/docs/ai-transport/features/token-streaming/message-per-response.mdx index a501f562a6..86f7787dc1 100644 --- a/src/pages/docs/ai-transport/features/token-streaming/message-per-response.mdx +++ b/src/pages/docs/ai-transport/features/token-streaming/message-per-response.mdx @@ -22,7 +22,7 @@ Standard Ably message [size limits](/docs/platform/pricing/limits#message) apply ## Enable appends -Message append functionality requires "Message annotations, updates, deletes and appends" to be enabled in a [channel rule](/docs/channels#rules) associated with the channel. +Message append functionality requires the "Message annotations, updates, deletes, and appends" [channel rule](/docs/channels#rules) enabled for your channel or [namespace](/docs/channels#namespaces).