docs: Add 4 provider-specific AI Transport getting started guides#3103
docs: Add 4 provider-specific AI Transport getting started guides#3103GregHolmes wants to merge 2 commits intomainfrom
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 |
7a3ebe5 to
02439a7
Compare
20df5cb to
01ab0f8
Compare
02439a7 to
0039e1d
Compare
86956c7 to
1a6be6c
Compare
2c964ba to
cd08990
Compare
cd08990 to
4da227e
Compare
|
I haven't gone through all the details yet, but a couple of quick questions
|
Thank you for the comments @rainbowFi For the first Q, I went with the auth step because AIT is architecturally different from Pub/Sub getting started guides, in that it always involves a backend agent + frontend client, and the client needs JWTs (not an API key). The human-in-the-loop flow also relies on a clientId from the JWT. I do agree it is heavy, we could slim it down by linking to a shared auth snippet or providing a ready-to-run auth server, so the guide focuses on the AI-specific parts, but this would complicate the maintenance of these guides for anyone in the future. What do you think? For the second Q, I agree, 3-5 files per guide is a lot of copy/paste. The simplest option could be where ever we store the feature guides code, we store the getting started guides in there too. It's currently a PR in docs, but I think it's still up for debate on where it's going. Something @mschristensen and @m-hulbert were discussing. We already have runnable examples in /examples/ for the message patterns, but these don't use actual providers. So unless we ask the user in the flow of the example to provide their API Key for the specific provider, the examples wouldn't otherwise be feasible. |
4da227e to
5c75a83
Compare
Add comprehensive getting started guide covering: - JWT-based user authentication with verified identities - Mock LLM implementation for provider-agnostic examples - Agent that streams token responses using message-per-response pattern - Interactive client with readline for user prompts - Message correlation using promptId headers - Channel rule setup for message appends Also update navigation to include getting started section.
…guides Split the single JavaScript/TypeScript getting-started guide (which used a mock LLM) into four provider-specific guides: Anthropic, OpenAI, Vercel AI SDK, and LangGraph. Each guide uses the real provider SDK, includes human-in-the-loop (HITL) tool call approval via a send_email tool, and follows a consistent structure with code split into digestible blocks.
5c75a83 to
7156557
Compare
rainbowFi
left a comment
There was a problem hiding this comment.
Thanks @GregHolmes
For the first question, I think it's better to have everything on one page rather than linking to some common example page. We don't want people to have to click through multiple pages to get this single "Getting Started" working, and I agree with you that the auth is necessary.
For the second one, let's say the code lives in whatever location we pick for the feature guide code, because it's the same problem of people needing a quick way to access it. I'm not going to gate approval of this PR on that discussion coming to a conclusion. Can you make sure that the work is tracked somewhere?
In terms of the actual content, I've put one request inline and tested the Anthropic example. I haven't reviewed the code for quality, if you have any concerns then I suggest you ask an engineer to take a look.
|
|
||
| The JWT includes two claims: | ||
| - `x-ably-clientId`: Establishes a verified identity that appears on all messages the user publishes. | ||
| - `ably.channel.*`: Assigns a role that agents can use to distinguish users from other agents on the channel. |
There was a problem hiding this comment.
Is this strictly required for anything else that is covered in the getting started guide? The way we're going to track AI transport usage will add an agent/human identifier to the connection parameters, so I'd rather not start people doing this through the JWT.
|
|
||
| The JWT includes two claims: | ||
| - `x-ably-clientId`: Establishes a verified identity that appears on all messages the user publishes. | ||
| - `ably.channel.*`: Assigns a role that agents can use to distinguish users from other agents on the channel. |
There was a problem hiding this comment.
Is this claim strictly required for anything in this Getting Started Guide? The plan for AI transport usage tracking is to specify human or agent as part of the connection parameters, so I don't want people also doing that through the JWT.
Summary
Adds 4 getting started guides for AI Transport, each using a real provider SDK:
@anthropic-ai/sdkwithclaude-sonnet-4-5openaiSDK withgpt-4oai@^6with provider-agnostic streaming@langchain/langgraphwith@langchain/anthropicEach guide walks through:
send_emailtool in the provider's format