Update README and guide for Rust SDK#1259
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the root documentation and Getting Started guide to present the Rust SDK as an official, published crate alongside the other first-party SDKs, including adding Rust-specific install and usage examples throughout the walkthrough.
Changes:
- Add Rust to the root README (badges, SDK table, CLI installation notes, and guidance links) and remove it from the community SDK list.
- Extend
docs/getting-started.mdwith Rust examples for install, basic usage, streaming, event subscription, custom tools, interactive assistant, external server connection, telemetry, and reference links. - Refresh the documented runtime minimums (Node 20+, Go 1.24+, Rust 1.94+).
Show a summary per file
| File | Description |
|---|---|
| README.md | Adds Rust as a first-party SDK in the main landing documentation and updates CLI/bundling guidance accordingly. |
| docs/getting-started.md | Adds Rust sections and code samples across the end-to-end Getting Started walkthrough (including streaming/tools/telemetry). |
Copilot's findings
Comments suppressed due to low confidence (3)
docs/getting-started.md:783
- This Rust event-subscription snippet uses
while let Ok(event) = events.recv().await, which stops consuming events if the subscription ever returnsRecvError::Lagged(...)(a recoverable error indicating dropped events). Please handleLaggedby continuing the loop (and optionally logging skipped count), and only break onClosed.
tokio::spawn(async move {
while let Ok(event) = events.recv().await {
println!("Event: {}", event.event_type);
match event.event_type.as_str() {
docs/getting-started.md:1128
- In the Rust custom-tools example, the spawned subscriber loop exits on
RecvError::Lagged(...)because it useswhile let Ok(event) = events.recv().await. Since lag is expected/handled by the subscription API, the example should continue onLaggedand only stop onClosed, otherwise streaming output may stop unexpectedly.
tokio::spawn(async move {
while let Ok(event) = events.recv().await {
match event.event_type.as_str() {
"assistant.message_delta" => {
if let Some(text) =
docs/getting-started.md:1594
- The Rust interactive assistant example’s event loop uses
while let Ok(event) = events.recv().await, which will terminate onRecvError::Lagged(...)(recoverable) and stop printing deltas. Consider handlingLaggedby continuing the loop (optionally logging it) and breaking only onClosed.
tokio::spawn(async move {
while let Ok(event) = events.recv().await {
match event.event_type.as_str() {
"assistant.message_delta" => {
if let Some(text) =
- Files reviewed: 2/2 changed files
- Comments generated: 1
Comment on lines
+523
to
+534
| while let Ok(event) = events.recv().await { | ||
| match event.event_type.as_str() { | ||
| "assistant.message_delta" => { | ||
| if let Some(text) = | ||
| event.data.get("deltaContent").and_then(|value| value.as_str()) | ||
| { | ||
| print!("{text}"); | ||
| io::stdout().flush().ok(); | ||
| } | ||
| } | ||
| "assistant.message" => println!(), | ||
| _ => {} |
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.
Rust is now published as an official SDK crate, so the root documentation and getting-started walkthrough should present it alongside the other SDKs rather than as a community-maintained project.
Summary
Validation
cargo check --features derive --examplespythonis not available on PATH.