chore: rename ChatCompletions to Completions#47
Conversation
|
Warning Review limit reached
More reviews will be available in 38 minutes and 47 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR renames ChatCompletions* to Completions* across the completions provider crate, its request/response types, builder/client API, provider implementations, vendor wrappers, docs/examples, and bumps related crate versions; it also removes the Streamed marker and related builder transition. ChangesCompletions Type Rename Across Provider and Wrappers
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@providers/cerebras/src/lib.rs`:
- Around line 19-21: The import line `use chat_completions::{CompletionsBuilder,
CompletionsClient, ReqwestTransport, Transport};` is misformatted and failing
rustfmt in CI; reformat the import to conform to rustfmt (or run `cargo fmt
--all`) so the `use chat_completions::{...}` line matches project formatting
rules and the build passes.
In `@providers/completions/src/lib.rs`:
- Around line 34-35: Run rustfmt (cargo fmt) on the file to fix signature
formatting issues; specifically reformat the generic struct signature for
CompletionsBuilder (the declaration "pub struct CompletionsBuilder<M =
WithoutModel, U = WithoutUrl, T: Transport = ReqwestTransport>") and any other
misformatted signatures around the second occurrence (lines showing the same
generics at 114-117) so they conform to rustfmt style and compile cleanly.
- Around line 24-25: Keep backwards compatibility by adding deprecated aliases
that re-export the new types under the old crate-root names: add deprecated
re-exports so ChatCompletionsClient points to CompletionsClient and
ChatCompletionsBuilder points to the new builder type (e.g., CompletionsBuilder
or the builder struct in crate::client) wherever the current pub use
crate::client::CompletionsClient is declared (also mirror for the exports around
lines 34-35). Mark these aliases as deprecated (using the #[deprecated]
attribute) and update their doc comment to point consumers to the new names.
In `@providers/deepseek/src/lib.rs`:
- Around line 26-28: The import line using chat_completions (the use
chat_completions::{CompletionsBuilder, CompletionsClient, ReqwestTransport,
Transport}; statement) is misformatted; run rustfmt to fix it—execute cargo fmt
--all and commit the resulting formatting changes so the use statement and
surrounding code conform to rustfmt rules and CI passes.
In `@providers/huggingface/src/lib.rs`:
- Around line 33-35: The grouped import line using chat_completions
(CompletionsBuilder, CompletionsClient, ReqwestTransport, Transport) is
misformatted for rustfmt; run cargo fmt --all or reformat the use statement so
it matches rustfmt style (e.g., one-per-line or properly wrapped) ensuring the
identifiers CompletionsBuilder, CompletionsClient, ReqwestTransport, and
Transport in lib.rs are formatted correctly to satisfy CI.
In `@providers/ollama/src/lib.rs`:
- Around line 28-31: The import block using chat_completions (use
chat_completions::{CompletionsBuilder, CompletionsClient, ChatError, Request,
ReqwestTransport, Transport, TransportError};) is misformatted for rustfmt; run
rustfmt by executing cargo fmt --all (or apply rustfmt formatting) so the use
statement is formatted according to the project's style and CI will pass.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: dca64fbf-e130-499e-8cba-a4ea600c999b
📒 Files selected for processing (14)
docs/content/docs/providers/completions.mdxexamples/completions/completion.rsproviders/cerebras/src/lib.rsproviders/completions/src/api/completion.rsproviders/completions/src/api/embedding.rsproviders/completions/src/api/stream.rsproviders/completions/src/api/types/request.rsproviders/completions/src/api/types/response.rsproviders/completions/src/client.rsproviders/completions/src/lib.rsproviders/deepseek/src/lib.rsproviders/huggingface/src/lib.rsproviders/ollama/src/lib.rsproviders/openrouter/src/lib.rs
There was a problem hiding this comment.
🧹 Nitpick comments (2)
providers/cerebras/Cargo.toml (1)
3-3: 💤 Low valueConsider a minor bump (0.3.0) rather than patch for the rename.
This crate re-exports the renamed
CompletionsBuilder/CompletionsClient, sochat_cerebras::ChatCompletions*paths break for downstream consumers. Under 0.x semver, a breaking public-API rename warrants a minor bump (0.2.4→0.3.0) rather than a patch.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@providers/cerebras/Cargo.toml` at line 3, Update the crate version to a minor bump to reflect the breaking rename: change the version in Cargo.toml from "0.2.5" to "0.3.0" so downstream consumers see the API-level change; this crate re-exports the renamed CompletionsBuilder/CompletionsClient (affecting chat_cerebras::ChatCompletions* paths), so publish as 0.3.0 to follow 0.x semver rules.providers/huggingface/Cargo.toml (1)
3-3: 💤 Low valueSame semver concern as the Cerebras wrapper.
The Hugging Face wrapper re-exports the renamed
CompletionsBuilder/CompletionsClient(breaking the oldChatCompletions*paths for consumers), so consider a minor bump (0.2.4→0.3.0) instead of patch.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@providers/huggingface/Cargo.toml` at line 3, The crate version in Cargo.toml should be bumped to a new minor release because the public API re-exports renamed types (CompletionsBuilder and CompletionsClient) which break the old ChatCompletions* paths; update the version from "0.2.5" to "0.3.0" in providers/huggingface/Cargo.toml and ensure any related package metadata (e.g., workspace/Cargo.lock notes or changelog/release notes) reflect the API change so consumers get a minor-version update.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@providers/cerebras/Cargo.toml`:
- Line 3: Update the crate version to a minor bump to reflect the breaking
rename: change the version in Cargo.toml from "0.2.5" to "0.3.0" so downstream
consumers see the API-level change; this crate re-exports the renamed
CompletionsBuilder/CompletionsClient (affecting chat_cerebras::ChatCompletions*
paths), so publish as 0.3.0 to follow 0.x semver rules.
In `@providers/huggingface/Cargo.toml`:
- Line 3: The crate version in Cargo.toml should be bumped to a new minor
release because the public API re-exports renamed types (CompletionsBuilder and
CompletionsClient) which break the old ChatCompletions* paths; update the
version from "0.2.5" to "0.3.0" in providers/huggingface/Cargo.toml and ensure
any related package metadata (e.g., workspace/Cargo.lock notes or
changelog/release notes) reflect the API change so consumers get a minor-version
update.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: fd4730ec-f45d-421a-a35c-9beefb8d82b5
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (22)
Cargo.tomlcore/Cargo.tomlcore/src/builder.rscore/src/chat/state.rsdocs/public/icon-dark.webpdocs/public/icon-light.webpdocs/public/logo-dark.webpdocs/public/logo-light.webpproviders/cerebras/Cargo.tomlproviders/cerebras/src/lib.rsproviders/claude/Cargo.tomlproviders/completions/Cargo.tomlproviders/completions/src/lib.rsproviders/deepseek/Cargo.tomlproviders/deepseek/src/lib.rsproviders/gemini/Cargo.tomlproviders/huggingface/Cargo.tomlproviders/huggingface/src/lib.rsproviders/ollama/Cargo.tomlproviders/ollama/src/lib.rsproviders/openrouter/Cargo.tomlsrc/lib.rs
💤 Files with no reviewable changes (1)
- core/src/chat/state.rs
✅ Files skipped from review due to trivial changes (7)
- providers/gemini/Cargo.toml
- providers/completions/Cargo.toml
- core/Cargo.toml
- providers/claude/Cargo.toml
- providers/openrouter/Cargo.toml
- providers/ollama/Cargo.toml
- providers/deepseek/Cargo.toml
🚧 Files skipped from review as they are similar to previous changes (5)
- providers/cerebras/src/lib.rs
- providers/deepseek/src/lib.rs
- providers/ollama/src/lib.rs
- providers/huggingface/src/lib.rs
- providers/completions/src/lib.rs
Summary by CodeRabbit
Refactor
Chores
Breaking change