docs(ai-transport): add token streaming example, reframe append example#3448
Draft
rainbowFi wants to merge 1 commit into
Draft
docs(ai-transport): add token streaming example, reframe append example#3448rainbowFi wants to merge 1 commit into
rainbowFi wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
3ecb933 to
fd3ecc2
Compare
Add a runnable AI Transport token streaming example that uses the AI Transport SDK (v0.3.0), mirroring the Core SDK getting started: the agent flow (createAgentSession, createRun, start, loadConversation, pipe, end) and the client hooks (ClientSessionProvider, useView, useClientSession). The model is mocked so it runs without a key, but emits the same UIMessageChunk stream a production integration produces. Move the former ai-transport-message-per-response example to pub-sub-message-append under the Pub/Sub product, since it uses raw pub/sub appendMessage rather than the SDK. Reframe its copy to point to the token streaming example as the recommended approach for AI. Remove the ai-transport-message-per-token example. Wire up Sandpack and workspace dependencies (@ably/ai-transport, ai, bump ably to 2.23 for the SDK peer) and bump the AI Transport SDK version registry to 0.3. Update token-streaming and ai-chatbot pricing meta descriptions that referenced the retired pattern names.
fd3ecc2 to
00cbf76
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Refreshes the out-of-date AI Transport streaming examples (AIT-1030).
ai-transport-token-streaming(React). Uses the AI Transport SDK (v0.3.0), mirroring the Core SDK getting started: the agent flow (createAgentSession→createRun→start→loadConversation→pipe→end) and the client hooks (ClientSessionProvider,useView,useClientSession). The model is mocked so it runs without an API key, but the fake LLM emits the exactUIMessageChunkstream thatstreamText(...).toUIMessageStream()produces, so the agent code is identical to a production integration. The two necessary deviations (agent runs in-browser instead of a server route; token source is mocked) are commented in the code.ai-transport-message-per-response→pub-sub-message-append, reclassified under the Pub/Sub product. It already used raw pub/subappendMessage+rewindrather than the SDK, so the code is unchanged; the READMEs and gallery copy now describe it honestly and point to the token streaming example as the recommended approach for AI.ai-transport-message-per-token.@ably/ai-transport ~0.3.0,ai ^6, bumpedablyto~2.23.0for the SDK peer), bumped the AIT SDK version registry0.2 → 0.3.Cross-link audit
features/token-streaming.mdxandplatform/pricing/examples/ai-chatbot.mdxmeta descriptions updated to drop the retired "message-per-response / message-per-token pattern" names.redirect_fromslugs (/message-per-response,/message-per-token) kept so old URLs still redirect.run.pipe+useView).Notes / for reviewers
ViewAPI. Consistent with other single-language examples (chat UI, LiveObjects).@ably/ai-transport@0.3.0+ai@6+ably@2.23, and the import graph bundles. The live Sandpack preview was not run locally — add thereview-applabel and click through before merge.🤖 Generated with Claude Code