Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/data/nav/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ export default {
pages: [
{
name: 'Overview',
link: '/docs/account',
link: '/docs/platform/account',
index: true,
},
{
Expand Down
6 changes: 3 additions & 3 deletions src/pages/docs/ai-transport/messaging/citations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ meta_keywords: "citations, references, source attribution, message annotations,

AI agents often draw information from external sources such as documents, web pages, or databases. Citations to those sources enable users to verify information, explore sources in detail, and understand where responses came from. Ably's [message annotations](/docs/messages/annotations) provide a model-agnostic, structured way to attach source citations to AI responses without modifying the response content. It enables clients to append information to existing messages on a channel.

This pattern works when publishing complete responses as messages on a channel or when streaming responses using the [message-per-response](/docs/ai-transport/message-per-response) pattern.
This pattern works when publishing complete responses as messages on a channel or when streaming responses using the [message-per-response](/docs/ai-transport/token-streaming/message-per-response) pattern.

## Why citations matter <a id="why"/>

Expand All @@ -21,7 +21,7 @@ Including citations on AI responses provides:

Use [message annotations](/docs/messages/annotations) to attach source metadata to AI response messages without modifying the response content:

1. The agent publishes an AI response as a single message, or builds it incrementally using [message appends](/docs/ai-transport/message-per-response).
1. The agent publishes an AI response as a single message, or builds it incrementally using [message appends](/docs/ai-transport/token-streaming/message-per-response).
2. The agent publishes one or more annotations to attach citations to the response message, each referencing the response message [`serial`](/docs/messages#properties).
3. Ably automatically aggregates annotations and generates summaries showing total counts and groupings (for example, by source domain name).
4. Clients receive citation summaries automatically and can optionally subscribe to individual annotation events for detailed citation data as part of the realtime stream. Alternatively, clients can obtain annotations for a given message via the REST API.
Expand Down Expand Up @@ -182,7 +182,7 @@ channel.annotations.publish(msgSerial, citation2);
</Code>

<Aside data-type="note">
When streaming response tokens using the [message-per-response](/docs/ai-transport/message-per-response) pattern, you can publish citations while the response is still streaming since the `serial` of the response message becomes known after you [publish the initial message](/docs/ai-transport/token-streaming/message-per-response#publishing).
When streaming response tokens using the [message-per-response](/docs/ai-transport/token-streaming/message-per-response) pattern, you can publish citations while the response is still streaming since the `serial` of the response message becomes known after you [publish the initial message](/docs/ai-transport/token-streaming/message-per-response#publishing).
</Aside>

<Aside data-type="note">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ Set [`echoMessages`](/docs/api/realtime-sdk/types#client-options) to `false` in
The agent listens for human decisions and acts accordingly. When a response arrives, the agent retrieves the pending request using the `toolCallId`, verifies that the user is permitted to approve that specific action, and either executes the action or handles the rejection.
<Aside data-type="note">
For audit trails, use [integration rules](/docs/integrations) to stream approval messages to external systems.
For audit trails, use [integration rules](/docs/platform/integrations) to stream approval messages to external systems.
</Aside>
### Verify by user identity <a id="verify-identity"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ Ably recommends using token authentication with short-lived tokens and minimal c

### Agent capabilities <a id="agent-capabilities"/>

When using API key authentication, provision API keys through the [Ably dashboard](https://ably.com/dashboard) or [Control API](/docs/account/control-api) with only the capabilities required by the agent.
When using API key authentication, provision API keys through the [Ably dashboard](https://ably.com/dashboard) or [Control API](/docs/platform/account/control-api) with only the capabilities required by the agent.

The following example uses the Control API to create an API key with specific capabilities for a weather agent:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ An agent or user might resume an existing session when:

When you attach to a channel, Ably automatically syncs the complete current presence set to your client. You can then query the presence set or subscribe to presence events without any additional hydration steps. This works the same way for both users and agents.

For details on obtaining the synced presence set, see [Viewing who is online](/docs/ai-transport/sessions-and-identity/online-status#viewing-presence).
For details on obtaining the synced presence set, see [Viewing who is online](/docs/ai-transport/sessions-identity/online-status#viewing-presence).

## User resumes a session

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Token streaming with message-per-response is a pattern where every token generat

This pattern is useful for chat-style applications where you want each complete AI response stored as a single message in history, making it easy to retrieve and display multi-response conversation history. Each agent response becomes a single message that grows as tokens are appended, allowing clients joining mid-stream to catch up efficiently without processing thousands of individual tokens.

The message-per-response pattern includes [automatic rate limit protection](/docs/ai-transport/token-rate-limits#per-response) through rollups, making it the recommended approach for most token streaming use cases.
The message-per-response pattern includes [automatic rate limit protection](/docs/ai-transport/token-streaming/token-rate-limits#per-response) through rollups, making it the recommended approach for most token streaming use cases.

## How it works <a id="how-it-works"/>

Expand Down Expand Up @@ -215,7 +215,7 @@ The `appendRollupWindow` parameter controls how many tokens are combined into ea
The default 40ms window strikes a balance, delivering tokens at 25 messages per second - smooth enough for a great user experience while allowing you to run two simultaneous response streams on a single connection. If you need to support more concurrent streams, increase the rollup window (up to 500ms), accepting that tokens will arrive in more noticeable batches. Alternatively, instantiate a separate Ably client which uses its own connection, giving you access to additional message rate capacity.

<Aside data-type="further-reading">
For more details on rate limits and rollup behavior, see [Token streaming limits](/docs/ai-transport/token-rate-limits#rollup).
For more details on rate limits and rollup behavior, see [Token streaming limits](/docs/ai-transport/token-streaming/token-rate-limits#rollup).
</Aside>

## Subscribing to token streams <a id="subscribing"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ for (Event event : stream) {
This approach maximizes throughput while maintaining ordering guarantees, allowing you to stream tokens as fast as your AI model generates them.

<Aside data-type="important">
Unlike the [message-per-response](/docs/ai-transport/token-streaming/message-per-response) pattern, the message-per-token pattern requires you to [manage rate limits directly](/docs/ai-transport/token-rate-limits#per-token).
Unlike the [message-per-response](/docs/ai-transport/token-streaming/message-per-response) pattern, the message-per-token pattern requires you to [manage rate limits directly](/docs/ai-transport/token-streaming/token-rate-limits#per-token).
</Aside>

<Aside data-type="note">
Expand Down
10 changes: 5 additions & 5 deletions src/pages/docs/api/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ The API reference for the [Chat SDK](https://sdk.ably.com/builds/ably/ably-chat-

In addition to the API references listed previously, our developer documentation also provides information on how these interfaces are used, and this covers key concepts such as connections, channels, messages and the pub/sub pattern. You can find that information on the following pages:

* [Client library Realtime SDK - Overview](/docs/realtime)
* [Client library REST SDK - Overview](/docs/rest)
* [Realtime and REST interface use cases](/docs/realtime#realtime-vs-rest)
* [REST API - Overview](/docs/rest-api)
* [Client library Realtime SDK - Overview](/docs/api/realtime-sdk)
* [Client library REST SDK - Overview](/docs/api/rest-sdk)
* [Realtime and REST interface use cases](/docs/api/realtime-sdk#realtime-vs-rest)
* [REST API - Overview](/docs/api/rest-api)
* [SSE API - Overview](/docs/protocols/sse)
* [Control API - Overview](/docs/platform/account/control-api)
* [Control API - Overview](/docs/api/control-api)
2 changes: 1 addition & 1 deletion src/pages/docs/api/realtime-sdk.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ A reference to the [ARTLocalDevice](/docs/api/realtime-sdk/push#local-device) ob

### <If lang="csharp">`Channels`</If><If lang="javascript,nodejs,ruby,java,swift,objc,flutter">`channels`</If> <a id="channels" />

[Channels](/docs/api/realtime-sdk/channels#channels-object) is a reference to the [Channel](/docs/channels) collection instance for this library indexed by the channel name. You can use the [Get](/docs/api/realtime-sdk/channels#get) method of this to get a `Channel` instance. See [channels](/docs/channels) and [messages](/docs/channels/messages) for more information.
[Channels](/docs/api/realtime-sdk/channels#channels-object) is a reference to the [Channel](/docs/channels) collection instance for this library indexed by the channel name. You can use the [Get](/docs/api/realtime-sdk/channels#get) method of this to get a `Channel` instance. See [channels](/docs/channels) and [messages](/docs/messages) for more information.

### <If lang="csharp">`Connection`</If><If lang="javascript,nodejs,ruby,java,swift,objc,flutter">`connection`</If> <a id="connection" />

Expand Down
4 changes: 2 additions & 2 deletions src/pages/docs/api/realtime-sdk/history.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ A `PresenceMessage` represents an individual presence update that is sent to or
|----------|-------------|------|
| <If lang="java,javascript,nodejs,ruby,objc,swift">action</If><If lang="csharp">Action</If> | the event signified by a PresenceMessage. See [`PresenceMessage.action`](/docs/api/realtime-sdk/types#presence-action) | <If lang="java">`enum { ABSENT, PRESENT, ENTER, LEAVE, UPDATE }`</If><If lang="csharp">`enum { Absent, Present, Enter, Leave, Update }`</If><If lang="javascript,nodejs">`int enum { ABSENT, PRESENT, ENTER, LEAVE, UPDATE }`</If><If lang="ruby">`enum { :absent, :present, :enter, :leave, :update }`</If><If lang="objc,swift">`ARTPresenceAction`</If> |
| <If lang="javascript,nodejs,java,objc,swift,ruby">data</If><If lang="csharp">Data</If> | The presence update payload, if provided | <If lang="java">`String`, `ByteArray`, `JSONObject`, `JSONArray`</If><If lang="csharp">`String`, `byte[]`, plain C# object that can be converted to Json</If><If lang="javascript,nodejs">`String`, `StringBuffer`, `JSON Object`</If><If lang="ruby">`String`, `Binary` (ASCII-8BIT String), `Hash`, `Array`</If><If lang="swift">`String`, `NSData`, `Dictionary`, `Array`</If><If lang="objc">`NSString *`, `NSData *`, `NSDictionary *`, `NSArray *`</If> |
| <If lang="javascript,nodejs,java,objc,swift,ruby">extras</If><If lang="csharp">Extras</If> | Metadata and/or ancillary payloads, if provided. The only currently valid payloads for extras are the [`push`](/docs/push/publish#sub-channels), [`ref`](/docs/channels/messages#interactions) and [`privileged`](/docs/platform/integrations/webhooks#skipping) objects. | <If lang="java">`JSONObject`, `JSONArray`</If><If lang="csharp">plain C# object that can be converted to Json</If><If lang="javascript,nodejs">`JSON Object`</If><If lang="ruby">`Hash`, `Array`</If><If lang="swift">`Dictionary`, `Array`</If><If lang="objc">`NSDictionary *`, `NSArray *`</If> |
| <If lang="javascript,nodejs,java,objc,swift,ruby">extras</If><If lang="csharp">Extras</If> | Metadata and/or ancillary payloads, if provided. The only currently valid payloads for extras are the [`push`](/docs/push/publish#sub-channels), [`ref`](/docs/messages#interactions) and [`privileged`](/docs/platform/integrations/webhooks#skipping) objects. | <If lang="java">`JSONObject`, `JSONArray`</If><If lang="csharp">plain C# object that can be converted to Json</If><If lang="javascript,nodejs">`JSON Object`</If><If lang="ruby">`Hash`, `Array`</If><If lang="swift">`Dictionary`, `Array`</If><If lang="objc">`NSDictionary *`, `NSArray *`</If> |
| <If lang="javascript,nodejs,java,objc,swift,ruby">id</If><If lang="csharp">Id</If> | Unique ID assigned by Ably to this presence update | `String` |
| <If lang="javascript,nodejs">clientId</If><If lang="ruby">client_id</If><If lang="csharp">ClientId</If><If lang="java,objc,swift">clientId</If> | The client ID of the publisher of this presence update | `String` |
| <If lang="javascript,nodejs">connectionId</If><If lang="ruby">connection_id</If><If lang="csharp">ConnectionId</If><If lang="java,objc,swift">connectionId</If> | The connection ID of the publisher of this presence update | `String` |
Expand Down Expand Up @@ -701,7 +701,7 @@ Returns a new `PaginatedResult` loaded with the next page of results. If there a

`Task<PaginatedResult<T>> NextAsync()`

Returns a new [`PaginatedResult`](/docs/api/realtime-sdk/historypaginated-result) loaded with the next page of results. If there are no further pages, then a blank PaginatedResult will be returned. The method is asynchronous and return a Task which needs to be awaited to get the `PaginatedResult`
Returns a new [`PaginatedResult`](/docs/api/realtime-sdk/history#paginated-result) loaded with the next page of results. If there are no further pages, then a blank PaginatedResult will be returned. The method is asynchronous and return a Task which needs to be awaited to get the `PaginatedResult`

</If>

Expand Down
2 changes: 1 addition & 1 deletion src/pages/docs/api/realtime-sdk/presence.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,7 @@ A `PresenceMessage` represents an individual presence update that is sent to or
|----------|-------------|------|
| <If lang="flutter,javascript,nodejs,ruby,swift,objc">action</If><If lang="java">action</If><If lang="csharp">Action</If> | the event signified by a PresenceMessage. See <If lang="flutter,javascript,nodejs">[`Presence action`](/docs/api/realtime-sdk/types#presence-action)</If><If lang="java">[`PresenceMessage.action`](/docs/api/realtime-sdk/types#presence-action)</If><If lang="csharp">[`PresenceMessage.action`](/docs/api/realtime-sdk/types#presence-action)</If><If lang="ruby">[`PresenceMessage::ACTION`](/docs/api/realtime-sdk/types#presence-action)</If><If lang="swift,objc">[`PresenceMessage.action`](/docs/api/realtime-sdk/types#presence-action)</If> | <If lang="java">`enum { ABSENT, PRESENT, ENTER, LEAVE, UPDATE }`</If><If lang="csharp">`enum { Absent, Present, Enter, Leave, Update }`</If><If lang="javascript,nodejs">`int enum { ABSENT, PRESENT, ENTER, LEAVE, UPDATE }`</If><If lang="ruby">`enum { :absent, :present, :enter, :leave, :update }`</If><If lang="swift,objc">`ARTPresenceAction`</If> |
| <If lang="flutter,javascript,nodejs,java,ruby,swift,objc">data</If><If lang="csharp">Data</If> | The presence update payload, if provided | <If lang="java">`String`, `ByteArray`, `JSONObject`, `JSONArray`</If><If lang="csharp">`String`, `byte[]`, plain C# object that can be converted to Json</If><If lang="javascript,nodejs">`String`, `StringBuffer`, `JSON Object`</If><If lang="ruby">`String`, `Binary` (ASCII-8BIT String), `Hash`, `Array`</If><If lang="swift">`String`, `NSData`, `Dictionary`, `Array`</If><If lang="objc">`NSString *`, `NSData *`, `NSDictionary *`, `NSArray *`</If> |
| <If lang="flutter,javascript,nodejs,java,ruby,swift,objc">extras</If><If lang="csharp">Extras</If> | Metadata and/or ancillary payloads, if provided. The only currently valid payloads for extras are the [`push`](/docs/push/publish#sub-channels), [`ref`](/docs/channels/messages#interactions) and [`privileged`](/docs/platform/integrations/webhooks#skipping) objects. | <If lang="java">`JSONObject`, `JSONArray`</If><If lang="csharp">plain C# object that can be converted to Json</If><If lang="javascript,nodejs">`JSON Object`</If><If lang="ruby">`Hash`, `Array`</If><If lang="swift">`Dictionary`, `Array`</If><If lang="objc">`NSDictionary *`, `NSArray *`</If><If lang="flutter">`Map`, `List`</If> |
| <If lang="flutter,javascript,nodejs,java,ruby,swift,objc">extras</If><If lang="csharp">Extras</If> | Metadata and/or ancillary payloads, if provided. The only currently valid payloads for extras are the [`push`](/docs/push/publish#sub-channels), [`ref`](/docs/messages#interactions) and [`privileged`](/docs/platform/integrations/webhooks#skipping) objects. | <If lang="java">`JSONObject`, `JSONArray`</If><If lang="csharp">plain C# object that can be converted to Json</If><If lang="javascript,nodejs">`JSON Object`</If><If lang="ruby">`Hash`, `Array`</If><If lang="swift">`Dictionary`, `Array`</If><If lang="objc">`NSDictionary *`, `NSArray *`</If><If lang="flutter">`Map`, `List`</If> |
| <If lang="flutter,javascript,nodejs,java,ruby,swift,objc">id</If><If lang="csharp">Id</If> | Unique ID assigned by Ably to this presence update | `String` |
| <If lang="flutter,javascript,nodejs,java,swift,objc">clientId</If><If lang="ruby">client_id</If><If lang="csharp">ClientId</If> | The client ID of the publisher of this presence update | `String` |
| <If lang="flutter,javascript,nodejs,java,swift,objc">connectionId</If><If lang="ruby">connection_id</If><If lang="csharp">ConnectionId</If> | The connection ID of the publisher of this presence update | `String` |
Expand Down
Loading