Skip to content

Conversation

@mschristensen
Copy link
Contributor

@mschristensen mschristensen commented Jan 7, 2026

Description

Adds an OpenAI message per response token streaming guide.
Similar to the OpenAI message per token guide, but using the message per response pattern with appends.

Checklist

- Uses a further-reading callout instead of note
- Removes repeated code initialising Ably client (OpenAI client already
  instantiated)
Adds an anchor tag to the "Client hydration" heading
@coderabbitai
Copy link

coderabbitai bot commented Jan 7, 2026

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mschristensen mschristensen added the review-app Create a Heroku review app label Jan 7, 2026
@ably-ci ably-ci temporarily deployed to ably-docs-feature-ait-8-zclhtb January 7, 2026 21:01 Inactive
Copy link
Member

@paddybyers paddybyers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

5. Select the "Message annotations, updates, deletes and appends" option from the list.
6. Click "Create channel rule".

The examples in this guide use the `ai:` namespace prefix, which assumes you have configured the rule for `ai:*`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it's worth mentioning that there's nothing specific/magical about using ai as the namespace. It's the kind of thing that people can assume without thinking.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When a new response begins, publish an initial message to create it. Ably assigns a [`serial`](/docs/messages#properties) identifier to the message. Use this `serial` to append each token to the message as it arrives from the OpenAI model.

<Aside data-type="note">
This implementation assumes each response contains a single `message` type output item. It filters out reasoning tokens and other non-`message` output items. For production use cases with multiple output items or content parts, consider tracking state per response ID and item ID.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth referencing here documentation that suggests how to handle reasoning events? Eg as annotations or as a chain of thought thread?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes definitely - those pages haven't landed yet though, so I've created a ticket to review cross-linking generally once the MVP pages have landed. https://ably.atlassian.net/browse/AIT-244

@ably-ci ably-ci temporarily deployed to ably-docs-feature-ait-8-zclhtb January 8, 2026 13:48 Inactive
Similar to the open ai message per token guide, but using the message
per response pattern with appends.
@mschristensen mschristensen force-pushed the feature/AIT-87-openai-message-per-response-guide branch from 0d203e9 to 188365f Compare January 8, 2026 13:49
@ably-ci ably-ci temporarily deployed to ably-docs-feature-ait-8-zclhtb January 8, 2026 13:49 Inactive
@mschristensen mschristensen merged commit fb0bf3e into AIT-129-AIT-Docs-release-branch Jan 8, 2026
7 checks passed
@mschristensen mschristensen deleted the feature/AIT-87-openai-message-per-response-guide branch January 8, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-app Create a Heroku review app

Development

Successfully merging this pull request may close these issues.

4 participants