Skip to content

docs(rust): sync async-openai version pin to 0.38#660

Merged
amavashev merged 1 commit into
mainfrom
docs/rust-async-openai-version-sync
May 16, 2026
Merged

docs(rust): sync async-openai version pin to 0.38#660
amavashev merged 1 commit into
mainfrom
docs/rust-async-openai-version-sync

Conversation

@amavashev
Copy link
Copy Markdown
Contributor

What

Follow-up to PR #659 (already merged). The companion cycles-client-rust PR (#37) had to bump async-openai 0.30 → 0.38 to clear `cargo audit --deny warnings` — 0.30.x pulled in two unmaintained transitive deps:

  • `backoff 0.4.0` (RUSTSEC-2025-0012)
  • `instant 0.1.13` (RUSTSEC-2024-0384, via backoff)

async-openai 0.31+ replaced the retry stack with `tower` and dropped both. The example in cycles-client-rust now pins `0.38`. This PR brings the docs in sync so the how-to matches what an evaluator will actually `cargo add` against.

Changes

`how-to/integrating-cycles-with-async-openai.md`:

  • Cargo.toml snippet: `async-openai = "0.30"` → `async-openai = { version = "0.38", default-features = false, features = ["chat-completion", "rustls"] }`. The 0.31+ split exposed per-API features; `chat-completion` is what makes `Client` and the chat-completion types available.
  • All three code blocks (basic, streaming, error-handling): import path `async_openai::types::` → `async_openai::types::chat::`. The chat-completion types moved out of the top-level `types::` module in 0.31.
  • Version commentary (the paragraph that said "type paths accurate to the 0.30.x line at publication"): replaced with an explanation of the 0.30 → 0.31+ transition (feature gating + `types::chat::` path move + tower-vs-backoff retry stack swap), so readers upgrading from 0.30 understand what changed.
  • Dropped the unused `Role` import from the basic example.

Why this is a separate PR

The version-sync commit was pushed to the old PR #659 branch after #659 had already been merged. Rather than reopen the merged PR, branching off main is the clean path.

Test plan

  • `npm run build` succeeds
  • The rendered page shows the new Cargo.toml feature flags + the `types::chat::` imports
  • No broken-link warnings (only Cargo.toml text and import paths changed; no link targets touched)

The cycles-client-rust PR (companion to this one) had to bump
async-openai 0.30 → 0.38 to clear `cargo audit --deny warnings` —
0.30.x pulled in `backoff` (RUSTSEC-2025-0012) and `instant`
(RUSTSEC-2024-0384), both flagged as unmaintained. 0.31+ replaced
the retry stack with `tower` and dropped both transitive deps.

Brings this doc in sync with the actual shipped example:

- Cargo.toml snippet: pin to `0.38` with
  `default-features = false, features = ["chat-completion", "rustls"]`
  (the 0.31+ split exposed per-API features; `chat-completion` is what
  makes `Client` and the chat types available).
- All three code blocks (basic, streaming, error-handling): update
  imports from `async_openai::types::` to `async_openai::types::chat::`
  (the chat-completion types moved out of the top-level `types::`
  module in 0.31).
- Replaced the "type paths accurate to the 0.30.x line" caveat with an
  explanation of the 0.30→0.31+ split (feature gating + `types::chat::`
  path move + tower-vs-backoff retry stack swap), so readers
  upgrading from 0.30 understand what changed.
- Dropped the unused `Role` import from the basic example.
@amavashev amavashev enabled auto-merge May 16, 2026 16:05
@amavashev amavashev merged commit 22b8739 into main May 16, 2026
5 checks passed
@amavashev amavashev deleted the docs/rust-async-openai-version-sync branch May 16, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant